-
Notifications
You must be signed in to change notification settings - Fork 173
feat: Add support for Connection Profiles and Express Configuration on Clients #1204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a3bdc72
feat: add connection profiles support
kushalshit27 44cd20b
Merge branch 'master' into DXCDT-1281-superfed
kushalshit27 6722c85
docs: update connection profiles section in resource-specific documen…
kushalshit27 94d74cf
Merge branch 'master' into DXCDT-1281-superfed
kushalshit27 e2237b6
Merge branch 'master' into DXCDT-1281-superfed
kushalshit27 8d1b80f
Merge branch 'master' into DXCDT-1281-superfed
kushalshit27 8c1cb0f
Merge branch 'master' into DXCDT-1281-superfed
kushalshit27 85462d7
feat: update connection name prefix template and handle pagination er…
kushalshit27 f2f9971
feat: add connectionProfiles to YAML context and mockMgmtClient
kushalshit27 1696c7c
feat: enhance client handling and mapping
kushalshit27 f99a3b2
feat: update tests for clients and selfServiceProfiles handlers
kushalshit27 4fb2bdd
feat: update clientGrants and resourceServers handlers
kushalshit27 f951e26
recordings updated
kushalshit27 2b044c0
Merge branch 'master' into DXCDT-1281-superfed
kushalshit27 41546f2
feat(clients.ts): add early return for clients without express config…
kushalshit27 db45d85
feat(test): add tests for clients and connectionProfiles handling
kushalshit27 74a532e
feat(docs): update resource-specific documentation for clients
kushalshit27 2eb298b
feat(clients): add My App with Express Config example
kushalshit27 ff1e6b5
Merge branch 'master' into DXCDT-1281-superfed
kushalshit27 e433315
feat(docs): clarify express_configuration usage in connection profile…
kushalshit27 ea502d1
Merge branch 'DXCDT-1281-superfed' of https://github.com/auth0/auth0-…
kushalshit27 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,13 @@ | ||
| { | ||
| "name": "My Express App", | ||
| "app_type": "regular_web", | ||
| "express_configuration": { | ||
| "initiate_login_uri_template": "https://myapp.com/sso/start?org={organization_name}&conn={connection_name}", | ||
| "user_attribute_profile_id": "My User Attribute Profile", | ||
| "connection_profile_id": "Enterprise SSO Profile", | ||
| "enable_client": true, | ||
| "enable_organization": true, | ||
| "okta_oin_client_id": "My Okta OIN Client", | ||
| "admin_login_domain": "login.myapp.com" | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
examples/directory/connection-profiles/Basic Connection Profile.json
This file contains hidden or 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,10 @@ | ||
| { | ||
| "name": "Basic Connection Profile", | ||
| "organization": { | ||
| "show_as_button": "optional", | ||
| "assign_membership_on_login": "optional" | ||
| }, | ||
| "enabled_features": [ | ||
| "scim" | ||
| ] | ||
| } |
27 changes: 27 additions & 0 deletions
27
examples/directory/connection-profiles/Enterprise SSO Profile.json
This file contains hidden or 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,27 @@ | ||
| { | ||
| "name": "Enterprise SSO Profile", | ||
| "organization": { | ||
| "show_as_button": "required", | ||
| "assign_membership_on_login": "required" | ||
| }, | ||
| "connection_name_prefix_template": "org-{org_name}", | ||
| "enabled_features": [ | ||
| "scim", | ||
| "universal_logout" | ||
| ], | ||
| "strategy_overrides": { | ||
| "samlp": { | ||
| "enabled_features": [ | ||
| "universal_logout" | ||
| ], | ||
| "connection_config": {} | ||
| }, | ||
| "oidc": { | ||
| "enabled_features": [ | ||
| "scim", | ||
| "universal_logout" | ||
| ], | ||
| "connection_config": {} | ||
| } | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
examples/directory/user-attribute-profiles/My User Attribute Profile.json
This file contains hidden or 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,12 @@ | ||
| { | ||
| "name": "My User Attribute Profile", | ||
| "description": "My User Attribute Profile Description", | ||
| "user_attributes": [ | ||
| { | ||
| "name": "email", | ||
| "description": "Email", | ||
| "type": "email", | ||
| "required": true | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,65 @@ | ||
| import path from 'path'; | ||
| import fs from 'fs-extra'; | ||
| import { ConnectionProfile } from 'auth0'; | ||
| import { constants } from '../../../tools'; | ||
| import log from '../../../logger'; | ||
|
|
||
| import { dumpJSON, existsMustBeDir, getFiles, loadJSON, sanitize } from '../../../utils'; | ||
| import DirectoryContext from '..'; | ||
| import { ParsedAsset } from '../../../types'; | ||
|
|
||
| type ParsedConnectionProfiles = ParsedAsset<'connectionProfiles', Partial<ConnectionProfile>[]>; | ||
|
|
||
| function parse(context: DirectoryContext): ParsedConnectionProfiles { | ||
| const connectionProfilesFolder = path.join( | ||
| context.filePath, | ||
| constants.CONNECTION_PROFILES_DIRECTORY | ||
| ); | ||
| if (!existsMustBeDir(connectionProfilesFolder)) return { connectionProfiles: null }; // Skip | ||
|
|
||
| const files = getFiles(connectionProfilesFolder, ['.json']); | ||
|
|
||
| const connectionProfiles = files.map((f) => { | ||
| const profile = { | ||
| ...loadJSON(f, { | ||
| mappings: context.mappings, | ||
| disableKeywordReplacement: context.disableKeywordReplacement, | ||
| }), | ||
| }; | ||
| return profile; | ||
| }); | ||
|
|
||
| return { | ||
| connectionProfiles, | ||
| }; | ||
| } | ||
|
|
||
| async function dump(context: DirectoryContext): Promise<void> { | ||
| const { connectionProfiles } = context.assets; | ||
| if (!connectionProfiles) return; | ||
|
|
||
| const connectionProfilesFolder = path.join( | ||
| context.filePath, | ||
| constants.CONNECTION_PROFILES_DIRECTORY | ||
| ); | ||
| fs.ensureDirSync(connectionProfilesFolder); | ||
|
|
||
| connectionProfiles.forEach((profile) => { | ||
| const profileFile = path.join(connectionProfilesFolder, sanitize(`${profile.name}.json`)); | ||
| log.info(`Writing ${profileFile}`); | ||
|
|
||
| // Remove read-only fields | ||
| if ('id' in profile) { | ||
| delete profile.id; | ||
| } | ||
|
|
||
| dumpJSON(profileFile, profile); | ||
| }); | ||
| } | ||
|
|
||
| const connectionProfilesHandler = { | ||
| parse, | ||
| dump, | ||
| }; | ||
|
|
||
| export default connectionProfilesHandler; |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.