Skip to content

Commit

Permalink
feat(jans-cli-tui): grab values of tokenEndpointAuthMethod from swagg…
Browse files Browse the repository at this point in the history
…er doc (#7141)

Signed-off-by: Mustafa Baser <mbaser@mail.com>
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
Signed-off-by: Mustafa Baser <mbaser@mail.com>
  • Loading branch information
devrimyatar and moabu committed Dec 30, 2023
1 parent 11824e8 commit 64a1a51
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 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 @@ -230,8 +230,10 @@ def prepare_tabs(self) -> None:
acr_values_supported_list = [ (acr, acr) for acr in acr_values_supported ]


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

import json
open("/tmp/cl.json", "w").write(json.dumps(schema, indent=2))

self.tabs = OrderedDict()

Expand Down Expand Up @@ -261,6 +263,13 @@ def change_view_hide(me):
#if require_pkce is None:
# require_pkce = self.myparent.app_configuration.get('requirePkce', False)

token_endpoint_authmethods = [('none', 'none')]
for method in schema['properties']['tokenEndpointAuthMethod']['enum']:
if method == 'none':
continue
token_endpoint_authmethods.append((method, method))


basic_tab_widgets = [
self.myparent.getTitledText(
_("Client_ID"),
Expand Down Expand Up @@ -296,15 +305,18 @@ def change_view_hide(me):
schema, 'description'),
style=cli_style.check_box),

self.myparent.getTitledRadioButton(

self.myparent.getTitledWidget(
_("Authn Method token endpoint"),
name='tokenEndpointAuthMethod',
values=[('none', 'none'), ('client_secret_basic', 'client_secret_basic'), ('client_secret_post',
'client_secret_post'), ('client_secret_jwt', 'client_secret_jwt'), ('private_key_jwt', 'private_key_jwt')],
current_value=self.data.get('tokenEndpointAuthMethod'),
widget=DropDownWidget(
values=token_endpoint_authmethods,
value=self.data.get('tokenEndpointAuthMethod')
),
jans_help=self.myparent.get_help_from_schema(
schema, 'tokenEndpointAuthMethod'),
style=cli_style.radio_button),
style=cli_style.drop_down),


self.myparent.getTitledRadioButton(
_("Subject Type"),
Expand Down

0 comments on commit 64a1a51

Please sign in to comment.