From e50d0ac00b8367714b0467109501b047a43bbcb4 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 26 May 2021 18:09:28 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20account=20claim=20?= =?UTF-8?q?map=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/components/form/auth-method/index.hbs | 1 + .../form/auth-method/oidc/index.hbs | 39 +++++++++++++++++++ .../app/routes/scopes/scope/auth-methods.js | 15 ++++++- .../scope/auth-methods/auth-method/index.hbs | 1 + 4 files changed, 55 insertions(+), 1 deletion(-) diff --git a/ui/admin/app/components/form/auth-method/index.hbs b/ui/admin/app/components/form/auth-method/index.hbs index 048be9d25..77cf37d4d 100644 --- a/ui/admin/app/components/form/auth-method/index.hbs +++ b/ui/admin/app/components/form/auth-method/index.hbs @@ -6,5 +6,6 @@ cancel=@cancel removeItemByIndex=@removeItemByIndex addStringItem=@addStringItem + addAccountClaimMapItem=@addAccountClaimMapItem }} {{/if}} \ No newline at end of file diff --git a/ui/admin/app/components/form/auth-method/oidc/index.hbs b/ui/admin/app/components/form/auth-method/oidc/index.hbs index 8b82c6467..335392e08 100644 --- a/ui/admin/app/components/form/auth-method/oidc/index.hbs +++ b/ui/admin/app/components/form/auth-method/oidc/index.hbs @@ -472,6 +472,45 @@ {{/each}} + + + + + + + + + {{#each this.toClaims as |toClaim|}} + {{toClaim}} + {{/each}} + + + + + + {{t 'actions.add'}} + + + diff --git a/ui/admin/app/routes/scopes/scope/auth-methods.js b/ui/admin/app/routes/scopes/scope/auth-methods.js index 00666c1fb..31c0778a5 100644 --- a/ui/admin/app/routes/scopes/scope/auth-methods.js +++ b/ui/admin/app/routes/scopes/scope/auth-methods.js @@ -151,7 +151,7 @@ export default class ScopesScopeAuthMethodsRoute extends Route { /** * Adds a string item to array `property` on the passed `authMethod`. - * This is used to manage entries in fragment string array fields such + * This is used to manage entries in fragment OIDC string array fields such * as `signing_algorithms`. * @param {AuthMethodModel} authMethod * @param {string} property @@ -162,4 +162,17 @@ export default class ScopesScopeAuthMethodsRoute extends Route { const array = authMethod.get(property); array.addObject({ value }); } + + /** + * Adds an account claim map fragment to the passed OIDC `authMethod`. + * @param {AuthMethodModel} authMethod + * @param {string} property + * @param {string} value + */ + @action + async addAccountClaimMapItem(authMethod, from, to) { + const array = authMethod.attributes.account_claim_maps; + const value = { from, to }; + array.addObject(value); + } } diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/index.hbs index 2c477bb7c..e3302df0b 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/index.hbs @@ -4,4 +4,5 @@ @cancel={{route-action 'cancel' @model}} @removeItemByIndex={{route-action 'removeItemByIndex' @model}} @addStringItem={{route-action 'addStringItem' @model}} + @addAccountClaimMapItem={{route-action 'addAccountClaimMapItem' @model}} /> \ No newline at end of file