Skip to content

Commit

Permalink
rename type into typeS
Browse files Browse the repository at this point in the history
  • Loading branch information
aramovic79 committed Feb 11, 2025
1 parent 18a7ccd commit 574b7c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ npm install @cap-js/ord

To enforce authentication in the ORD Plugin, set the following environment variables:

* `ORD_AUTH`: Specifies the authentication type.
* `ORD_AUTH`: Specifies the authentication types.
* `BASIC_AUTH`: Contains credentials for `basic` authentication.

If `ORD_AUTH` is not set, the application starts without authentication. This variable accepts `open` and `basic` (UCL-mTLS is also planned).
Expand All @@ -47,7 +47,7 @@ Alternatively, configure authentication in `.cdsrc.json`:

```json
"authentication": {
"type": ["basic"],
"types": ["basic"],
"credentials": {
"user": "password"
}
Expand Down
2 changes: 1 addition & 1 deletion lib/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function createAuthConfig() {

authConfig.types = process.env.ORD_AUTH ?
[...new Set(JSON.parse(process.env.ORD_AUTH))] :
[...new Set(cds.env.authentication?.type)];
[...new Set(cds.env.authentication?.types)];

if (authConfig.types.length === 0) {
Logger.error('createAuthConfig:', 'No authorization type is provided. Defaulting to "Open" authentication');
Expand Down
2 changes: 1 addition & 1 deletion xmpl/.cdsrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"customOrdContentFile": "./ord/custom.ord.json"
},
"authentication": {
"type": ["basic"],
"types": ["basic"],
"credentials": {
"admin": "secret"
}
Expand Down

0 comments on commit 574b7c0

Please sign in to comment.