Skip to content

Commit

Permalink
🔧 [#3623] Ensure all configuration options are exposed in the admin
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Feb 16, 2024
1 parent 0213cca commit 8e3e6b7
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
51 changes: 48 additions & 3 deletions src/digid_eherkenning_oidc_generics/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class OpenIDConnectConfigBaseAdmin(SingletonModelAdmin):
"oidc_rp_scopes_list",
"oidc_rp_sign_algo",
"oidc_rp_idp_sign_key",
"userinfo_claims_source",
)
},
),
Expand All @@ -45,12 +44,28 @@ class OpenIDConnectConfigBaseAdmin(SingletonModelAdmin):
"oidc_op_jwks_endpoint",
"oidc_op_authorization_endpoint",
"oidc_op_token_endpoint",
"oidc_token_use_basic_auth",
"oidc_op_user_endpoint",
"oidc_op_logout_endpoint",
)
},
),
(_("Keycloak specific settings"), {"fields": ("oidc_keycloak_idp_hint",)}),
(
_("Advanced settings"),
{
"fields": (
"oidc_use_nonce",
"oidc_nonce_size",
"oidc_state_size",
"oidc_exempt_urls",
"userinfo_claims_source",
),
"classes": [
"collapse in",
],
},
),
)


Expand Down Expand Up @@ -82,7 +97,6 @@ class OpenIDConnectConfigDigiDMachtigenAdmin(SingletonModelAdmin):
"oidc_rp_scopes_list",
"oidc_rp_sign_algo",
"oidc_rp_idp_sign_key",
"userinfo_claims_source",
)
},
),
Expand All @@ -103,12 +117,28 @@ class OpenIDConnectConfigDigiDMachtigenAdmin(SingletonModelAdmin):
"oidc_op_jwks_endpoint",
"oidc_op_authorization_endpoint",
"oidc_op_token_endpoint",
"oidc_token_use_basic_auth",
"oidc_op_user_endpoint",
"oidc_op_logout_endpoint",
)
},
),
(_("Keycloak specific settings"), {"fields": ("oidc_keycloak_idp_hint",)}),
(
_("Advanced settings"),
{
"fields": (
"oidc_use_nonce",
"oidc_nonce_size",
"oidc_state_size",
"oidc_exempt_urls",
"userinfo_claims_source",
),
"classes": [
"collapse in",
],
},
),
)


Expand All @@ -130,7 +160,6 @@ class OpenIDConnectConfigEHerkenningBewindvoeringAdmin(SingletonModelAdmin):
"oidc_rp_scopes_list",
"oidc_rp_sign_algo",
"oidc_rp_idp_sign_key",
"userinfo_claims_source",
)
},
),
Expand All @@ -151,10 +180,26 @@ class OpenIDConnectConfigEHerkenningBewindvoeringAdmin(SingletonModelAdmin):
"oidc_op_jwks_endpoint",
"oidc_op_authorization_endpoint",
"oidc_op_token_endpoint",
"oidc_token_use_basic_auth",
"oidc_op_user_endpoint",
"oidc_op_logout_endpoint",
)
},
),
(_("Keycloak specific settings"), {"fields": ("oidc_keycloak_idp_hint",)}),
(
_("Advanced settings"),
{
"fields": (
"oidc_use_nonce",
"oidc_nonce_size",
"oidc_state_size",
"oidc_exempt_urls",
"userinfo_claims_source",
),
"classes": [
"collapse in",
],
},
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def test_digid_oidc_disable_allowed(self):
form["enabled"] = False
# set the value manually, normally this is done through JS
form["oidc_rp_scopes_list"] = json.dumps(config.oidc_rp_scopes_list)
form["oidc_exempt_urls"] = json.dumps(config.oidc_exempt_urls)
response = form.submit()

self.assertEqual(response.status_code, 302)
Expand All @@ -72,6 +73,7 @@ def test_digid_oidc_disable_not_allowed(self):
form["enabled"] = False
# set the value manually, normally this is done through JS
form["oidc_rp_scopes_list"] = json.dumps(config.oidc_rp_scopes_list)
form["oidc_exempt_urls"] = json.dumps(config.oidc_exempt_urls)
response = form.submit()

self.assertEqual(response.status_code, 200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def test_eherkenning_oidc_disable_allowed(self):
form["enabled"] = False
# set the value manually, normally this is done through JS
form["oidc_rp_scopes_list"] = json.dumps(config.oidc_rp_scopes_list)
form["oidc_exempt_urls"] = json.dumps(config.oidc_exempt_urls)
response = form.submit()

self.assertEqual(response.status_code, 302)
Expand All @@ -72,6 +73,7 @@ def test_eherkenning_oidc_disable_not_allowed(self):
form["enabled"] = False
# set the value manually, normally this is done through JS
form["oidc_rp_scopes_list"] = json.dumps(config.oidc_rp_scopes_list)
form["oidc_exempt_urls"] = json.dumps(config.oidc_exempt_urls)
response = form.submit()

self.assertEqual(response.status_code, 200)
Expand Down

0 comments on commit 8e3e6b7

Please sign in to comment.