-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use env-var and base url (#178)
- Loading branch information
Showing
16 changed files
with
1,062 additions
and
1,645 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
OIDC_TOKEN_URL=https://localhost:8443/connect/token | ||
OIDC_TOKEN_URL_WITH_BASE_PATH=https://localhost:8443/some-base-path/connect/token | ||
OIDC_AUTHORIZE_URL=https://localhost:8443/connect/authorize | ||
OIDC_INTROSPECTION_URL=https://localhost:8443/connect/introspect | ||
OIDC_USERINFO_URL=https://localhost:8443/connect/userinfo | ||
OIDC_GRANTS_URL=https://localhost:8443/grants | ||
OIDC_MANAGE_USERS_URL=https://localhost:8443/api/v1/user | ||
OIDC_DISCOVERY_ENDPOINT=https://localhost:8443/.well-known/openid-configuration | ||
OIDC_DISCOVERY_ENDPOINT_WITH_BASE_PATH=https://localhost:8443/some-base-path/.well-known/openid-configuration | ||
OIDC_BASE_URL=https://localhost:8443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { from, logger } from 'env-var'; | ||
import * as dotenv from 'dotenv'; | ||
import { URL } from 'node:url'; | ||
dotenv.config(); | ||
const env = from(process.env, undefined, logger); | ||
|
||
export const oidcBaseUrl = env.get('OIDC_BASE_URL').required().asUrlObject(); | ||
export const basePath = 'some-base-path'; | ||
|
||
export const oidcTokenUrl = new URL('/connect/token', oidcBaseUrl); | ||
export const oidcTokenUrlWithBasePath = new URL(`/${basePath}/connect/token`, oidcBaseUrl); | ||
export const oidcAuthorizeUrl = new URL('connect/authorize', oidcBaseUrl); | ||
export const oidcIntrospectionUrl = new URL('/connect/introspect', oidcBaseUrl); | ||
export const oidcUserInfoUrl = new URL('/connect/userinfo', oidcBaseUrl); | ||
export const oidcGrantsUrl = new URL('/grants', oidcBaseUrl); | ||
export const oidcUserManagementUrl = new URL('/api/v1/user', oidcBaseUrl); | ||
export const oidcDiscoveryEndpoint = new URL('/.well-known/openid-configuration', oidcBaseUrl); | ||
export const oidcDiscoveryEndpointWithBasePath = new URL(`/${basePath}/.well-known/openid-configuration`, oidcBaseUrl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.