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

fix(jans-cli-tui): Transaction Token properties to TUI client panel #8483

Merged
merged 2 commits into from
May 10, 2024
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 @@ -51,7 +51,14 @@
ERROR_GETTING_CLIENTS = _("Error getting clients")
ATTRIBUTE_SCHEMA_PATH = '#/components/schemas/ClientAttributes'
URL_SUFFIX_FORMATTER = 'inum:{}'
INTROSPECTION_ALG_PROPERTIES = ('introspectionSignedResponseAlg', 'introspectionEncryptedResponseAlg', 'introspectionEncryptedResponseEnc')
ATTRIBUTE_ALG_PROPERTIES = (
'introspectionSignedResponseAlg',
'introspectionEncryptedResponseAlg',
'introspectionEncryptedResponseEnc',
'txTokenSignedResponseAlg',
'txTokenEncryptedResponseAlg',
'txTokenEncryptedResponseEnc',
)
APP = get_app()


Expand Down Expand Up @@ -162,7 +169,7 @@ def save(self) -> None:
self.data['displayName'] = self.data['clientName']
self.data['attributes']['jansAuthorizedAcr'] = self.data.pop('jansAuthorizedAcr')

for intro_attr in INTROSPECTION_ALG_PROPERTIES:
for intro_attr in ATTRIBUTE_ALG_PROPERTIES:
if intro_attr in self.data:
self.data['attributes'][intro_attr] = self.data.pop(intro_attr)

Expand Down Expand Up @@ -751,10 +758,6 @@ def change_view_hide(me):

self.drop_down_select_first = []

# keep this line until this issue is closed https://github.com/JanssenProject/jans/issues/2372
self.myparent.cli_object.openid_configuration['access_token_singing_alg_values_supported'] = [
'HS256', 'HS384', 'HS512', 'RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512', 'PS256', 'PS384', 'PS512']

for title, swagger_key, openid_key in (

(_("ID Token Alg for Signing "), 'idTokenSignedResponseAlg',
Expand All @@ -764,7 +767,7 @@ def change_view_hide(me):
(_("ID Token Enc for Encryption"), 'idTokenEncryptedResponseEnc',
'id_token_encryption_enc_values_supported'),
(_("Access Token Alg for Signing "), 'accessTokenSigningAlg',
'access_token_singing_alg_values_supported'), # ?? openid key
'access_token_signing_alg_values_supported'),

(_("User Info for Signing "), 'userInfoSignedResponseAlg',
'userinfo_signing_alg_values_supported'),
Expand All @@ -787,14 +790,22 @@ def change_view_hide(me):
(_("Introspection Encrypted Response Enc"), 'introspectionEncryptedResponseEnc',
'id_token_encryption_enc_values_supported'),

(_("Transaction Token Alg for Signing"), 'txTokenSignedResponseAlg',
'tx_token_signing_alg_values_supported'),
(_("Transaction Token Alg for Encryption"), 'txTokenEncryptedResponseAlg',
'tx_token_encryption_alg_values_supported'),
(_("Transaction Token Enc for Encryption"), 'txTokenEncryptedResponseEnc',
'tx_token_encryption_enc_values_supported'),


):

self.drop_down_select_first.append(swagger_key)

values = [(alg, alg) for alg in self.myparent.cli_object.openid_configuration.get(
openid_key, [])]

value = self.data.get('attributes', {}).get(swagger_key) if swagger_key in INTROSPECTION_ALG_PROPERTIES else self.data.get(swagger_key)
value = self.data.get('attributes', {}).get(swagger_key) if swagger_key in ATTRIBUTE_ALG_PROPERTIES else self.data.get(swagger_key)

encryption_signing.append(self.myparent.getTitledWidget(
title,
Expand Down