Skip to content

Commit

Permalink
feat(jans-cli-tui): acr values are listbox on client advanced propert…
Browse files Browse the repository at this point in the history
…ies (#4548)
  • Loading branch information
devrimyatar authored Apr 11, 2023
1 parent 10052f6 commit 743bfca
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions jans-cli-tui/cli_tui/plugins/010_auth_server/edit_client_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def save(self) -> None:
'contacts',
'authorizedOrigins',
'requestUris',
'defaultAcrValues',
'claimRedirectUris',
):
if self.data[list_key]:
Expand All @@ -128,12 +127,10 @@ def save(self) -> None:
self.data['attributes'] = {'requirePar': self.data['requirePar']}

for list_key in (

'backchannelLogoutUri',
'additionalAudience',
'rptClaimsScripts',
'spontaneousScopeScriptDns',
'jansAuthorizedAcr',
'tlsClientAuthSubjectDn',
'spontaneousScopes',
'updateTokenScriptDns',
Expand All @@ -156,6 +153,7 @@ def save(self) -> None:
self.data['attributes'][list_key] = self.data[list_key]

self.data['displayName'] = self.data['clientName']
self.data['attributes']['jansAuthorizedAcr'] = self.data.pop('jansAuthorizedAcr')

cfr = self.check_required_fields()

Expand Down Expand Up @@ -215,6 +213,11 @@ def prepare_tabs(self) -> None:
"""Prepare the tabs for Edil Client Dialogs
"""

acr_values_supported = self.myparent.cli_object.openid_configuration.get('acr_values_supported', [])[:]

acr_values_supported_list = [ (acr, acr) for acr in acr_values_supported ]


schema = self.myparent.cli_object.get_schema_from_reference(
'', '#/components/schemas/Client')

Expand Down Expand Up @@ -814,25 +817,22 @@ def allow_spontaneous_changed(cb):
schema, 'requestUris'),
style=cli_style.check_box),

self.myparent.getTitledText(_("Default ACR"), # height =3 >> "the type is array" cant be dropdown
self.myparent.getTitledCheckBoxList(_("Default ACRs"), # height =3 >> "the type is array" cant be dropdown
name='defaultAcrValues',
value='\n'.join(self.data.get(
'defaultAcrValues', [])),
height=3,
values=acr_values_supported_list,
current_values=self.data.get('defaultAcrValues', []),
jans_help=self.myparent.get_help_from_schema(
schema, 'defaultAcrValues'),
style=cli_style.check_box),
schema, 'defaultAcrValues'),
style=cli_style.check_box),

self.myparent.getTitledText(_("Allowed ACR"), # height =3 insted of the <+> button
self.myparent.getTitledCheckBoxList(_("Allowed ACRs"), # height =3 insted of the <+> button
name='jansAuthorizedAcr',
value='\n'.join(self.data.get(
'attributes', {}).get('jansAuthorizedAcr', [])),
height=3,
values=acr_values_supported_list,
current_values=self.data.get('attributes', {}).get('jansAuthorizedAcr', []),
jans_help=self.myparent.get_help_from_schema(
self.myparent.cli_object.get_schema_from_reference(
'', ATTRIBUTE_SCHEMA_PATH),
'jansAuthorizedAcr'),
style=cli_style.check_box),
self.myparent.cli_object.get_schema_from_reference(
'', ATTRIBUTE_SCHEMA_PATH), 'jansAuthorizedAcr'),
style=cli_style.check_box),

self.myparent.getTitledText(
_("TLS Subject DN"),
Expand Down Expand Up @@ -939,9 +939,7 @@ def scope_exists(self, scope_dn: str) -> bool:
if item_id == scope_dn:
return True
return False
# 3
# 3
# 3


def add_scopes(self) -> None:

Expand Down

0 comments on commit 743bfca

Please sign in to comment.