Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAnhNguyenFOKUSFAME committed Feb 1, 2024
1 parent a524b96 commit 32e917d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ CLM_ROOT_PASSWORD=ABC123
DISABLE_ERR_RESPONSE=false

# WHETHER TO ALLOW ACCESS_TOKEN FROM EXTERNAL OIDC PROVIDERS
OIDC_PROVIDERS=[]
OIDC_PROVIDERS=[]

# API TOKEN FOR TO ACCESS THE CLM API
API_TOKEN=MGMT_SERVICE
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ This service functions as a web microservice that can be orchestrated through a
| `SMTP_PASS` | `examplepassword` | No | Configurations for the SMTP service used for sending emails. |
| `REDIS_CONFIG` | `localhost:6379` | No | Configuration information for Redis. Defaults to example value if not set. |
| `DISABLE_ERR_RESPONSE` | `true` | No | Flag to control whether error responses should be returned. Defaults to example value if not set. |
| `OIDC_PROVIDERS` | [{"authorization_endpoint": "http://to_authorization_endpoint" }] | NO | Whether to allow access_token from external OIDC providers |

| `OIDC_PROVIDERS` | [{"authorization_endpoint": "http://to_authorization_endpoint" }] | No | Whether to allow access_token from external OIDC providers |
| `API_TOKEN` | | No | Defaults to MGMT_SERVICE if not set. Needed to access the CLM-API
3. `npm run dev` for development with nodemon.
4. `npm start` for deployment.

Expand Down
3 changes: 2 additions & 1 deletion src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ export const CONFIG = {
REDIS_CONFIG: process.env.REDIS_CONFIG || 'localhost|6379',
OIDC_PROVIDERS: JSON.parse(
process.env.OIDC_PROVIDERS || `[]`
)
),
API_TOKEN: process.env.API_TOKEN || 'MGMT_SERVICE'
}
2 changes: 1 addition & 1 deletion src/config/configureDeps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default async function configureDependencies(app: any, excludedPaths: str
immutable: true
}))

await pathBDTOInstance.registerRoutes(app, excludedPaths, 'MGMT_SERVICE', rootUser)
await pathBDTOInstance.registerRoutes(app, excludedPaths, CONFIG.API_TOKEN, rootUser)

let user = (await UserDAO.findByAttributes({ email: rootUser }))[0]
if (!user) UserDAO.insert(new UserModel({
Expand Down

0 comments on commit 32e917d

Please sign in to comment.