Skip to content

Commit

Permalink
fix(jans-cli-tui): hide attrbiute requirePkce for clients (#7066)
Browse files Browse the repository at this point in the history
Signed-off-by: Mustafa Baser <mbaser@mail.com>
  • Loading branch information
devrimyatar committed Dec 12, 2023
1 parent 4fbdb44 commit ff44f9c
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions jans-cli-tui/cli_tui/plugins/010_auth_server/edit_client_dialog.py 100755 → 100644
@@ -1,3 +1,5 @@
import copy

from collections import OrderedDict
from functools import partial
from typing import Any
Expand Down Expand Up @@ -102,7 +104,7 @@ def save(self) -> None:
"""method to invoked when saving the dialog (Save button is pressed)
"""

current_data = self.data
current_data = copy.deepcopy(self.data)
self.data = self.make_data_from_dialog()
self.data['disabled'] = not self.data['disabled']

Expand All @@ -114,7 +116,7 @@ def save(self) -> None:
'requestUris',
'claimRedirectUris',
):
if self.data[list_key]:
if list_key in self.data:
self.data[list_key] = self.data[list_key].splitlines()

self.data['scopes'] = [item[0] for item in self.client_scopes.entries]
Expand All @@ -126,29 +128,29 @@ def save(self) -> None:
self.data['rptAsJwt'] = self.data['rptAsJwt'] == 'jwt'

self.data['attributes'] = {}
self.data['attributes'] = {
'redirectUrisRegex': self.data['redirectUrisRegex']}
self.data['attributes'] = {'parLifetime': self.data['parLifetime']}
self.data['attributes'] = {'requirePar': self.data['requirePar']}
self.data['attributes']['redirectUrisRegex'] = self.data.pop('redirectUrisRegex')
self.data['attributes']['parLifetime'] = self.data.pop('parLifetime')
self.data['attributes']['requirePar'] = self.data.pop('requirePar')
#self.data['attributes']['requirePkce'] = self.data.pop('requirePkce', False)

for list_key in (
'backchannelLogoutUri',
'additionalAudience',
'rptClaimsScripts',
'spontaneousScopeScriptDns',
'tlsClientAuthSubjectDn',
):
if self.data[list_key]:
self.data['attributes'][list_key] = self.data[list_key].splitlines()
if list_key in self.data:
self.data['attributes'][list_key] = self.data.pop(list_key,'').splitlines()

for list_key in (
for key in (
'runIntrospectionScriptBeforeJwtCreation',
'backchannelLogoutSessionRequired',
'jansDefaultPromptLogin',
'allowSpontaneousScopes',
'tlsClientAuthSubjectDn',
):
if self.data[list_key]:
self.data['attributes'][list_key] = self.data[list_key]
if key in self.data:
self.data['attributes'][key] = self.data.pop(key)

for scr_var in self.scripts_widget_dict:
values = self.scripts_widget_dict[scr_var].get_values()
Expand All @@ -175,6 +177,9 @@ def save(self) -> None:
if prop not in self.data:
self.data[prop] = current_data[prop]

# remove authenticationMethod, it is read only
self.data.pop('authenticationMethod', None)

if self.save_handler:
self.save_handler(self)

Expand Down Expand Up @@ -252,6 +257,9 @@ def change_view_hide(me):

client_secret_next_widget.handler = partial(change_view_hide, client_secret_widget)

#require_pkce = self.data.get('attributes', {}).get('redirectUrisRegex')
#if require_pkce is None:
# require_pkce = self.myparent.app_configuration.get('requirePkce', False)

basic_tab_widgets = [
self.myparent.getTitledText(
Expand Down Expand Up @@ -341,6 +349,13 @@ def change_view_hide(me):
jans_help=self.myparent.get_help_from_schema(schema, 'trustedClient'),
style=cli_style.check_box),

#self.myparent.getTitledCheckBox(
# _("Require PKCE"),
# name='requirePkce',
# checked=require_pkce,
# jans_help=self.myparent.get_help_from_schema(schema, 'requirePkce'),
# style=cli_style.check_box),

self.myparent.getTitledRadioButton(
_("Application Type"),
name='applicationType',
Expand Down

0 comments on commit ff44f9c

Please sign in to comment.