Skip to content
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

feat(jans-cli-tui): acr values are checkboxlist on client advanced properties #4548

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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