chore: create variables to hitphone integration and changelog

feat-hitphone-integration
Henrriky 2024-05-08 12:22:24 -03:00
parent 5b0334c18b
commit bc4efc299d
2 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,13 @@
# Requisitos
## Variáveis de Ambiente
- Definir as variáveis do Hitphone para possibilitar a integração:
```env
CLIENT_HITPHONE_JWT_ALGORITHM="RS256"
CLIENT_HITPHONE_JWT_AUDIENCE="http://localhost:5174"
CLIENT_HITPHONE_JWT_ISSUER="http://localhost:3000"
CLIENT_ID_HITPHONE="asdas"dadasd
CLIENT_HITPHONE_SERVICE_URL="http://localhost:3333"
CLIENT_HITPHONE_SERVICE_KEY="sadadasd"
```

View File

@ -1,6 +1,20 @@
import { readFileSync } from "fs";
import path from "path";
export default {
secret: process.env.JWT_SECRET || "mysecret",
expiresIn: "15m",
refreshSecret: process.env.JWT_REFRESH_SECRET || "myanothersecret",
refreshExpiresIn: "7d"
refreshExpiresIn: "7d",
hitphone: {
jwtPublicKey: readFileSync(path.join(__dirname, "../../keys/jwtHITRS256.key.pub")),
jwtAlgorithm: process.env.CLIENT_HITPHONE_JWT_ALGORITHM || "RS256",
jwtAudience: process.env.CLIENT_HITPHONE_JWT_AUDIENCE || "AUDIENCE",
jwtIssuer: process.env.CLIENT_HITPHONE_JWT_ISSUER || "ISSUER",
teams: {
CLIENT_ID: process.env.CLIENT_ID_HITPHONE || "CLIENTID",
},
CLIENT_SERVICE_URL: process.env.CLIENT_HITPHONE_SERVICE_URL || "http://localhost:3333",
CLIENT_SERVICE_API_KEY: process.env.CLIENT_HITPHONE_SERVICE_KEY || "APIKEY",
}
};