Skip to content

Commit

Permalink
🐛 [#129] Move all endpoints to endpoints_config in setup config model
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Dec 10, 2024
1 parent 19ba313 commit 1134cd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions mozilla_django_oidc_db/setup_configuration/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Union
from typing import Literal, Union

from django_setup_configuration.fields import DjangoModelRef
from django_setup_configuration.models import ConfigurationModel
Expand All @@ -18,6 +18,12 @@ class OIDCFullEndpointConfig(ConfigurationModel):
oidc_op_user_endpoint: AnyUrl = DjangoModelRef(
OpenIDConnectConfig, "oidc_op_user_endpoint"
)
oidc_op_logout_endpoint: AnyUrl | Literal[""] = DjangoModelRef(
OpenIDConnectConfig, "oidc_op_logout_endpoint"
)
oidc_op_jwks_endpoint: AnyUrl | Literal[""] = DjangoModelRef(
OpenIDConnectConfig, "oidc_op_jwks_endpoint"
)


class OIDCDiscoveryEndpoint(ConfigurationModel):
Expand Down Expand Up @@ -80,8 +86,6 @@ class Meta:
"oidc_token_use_basic_auth",
"oidc_rp_sign_algo",
"oidc_rp_idp_sign_key",
"oidc_op_logout_endpoint",
"oidc_op_jwks_endpoint",
"oidc_use_nonce",
"oidc_nonce_size",
"oidc_state_size",
Expand Down
4 changes: 2 additions & 2 deletions mozilla_django_oidc_db/setup_configuration/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ def execute(self, model: AdminOIDCConfigurationModel) -> None:
"oidc_rp_client_secret": config_model.oidc_rp_client_secret,
"oidc_rp_sign_algo": config_model.oidc_rp_sign_algo,
"oidc_rp_scopes_list": config_model.oidc_rp_scopes_list,
"oidc_op_jwks_endpoint": config_model.oidc_op_jwks_endpoint,
"oidc_token_use_basic_auth": config_model.oidc_token_use_basic_auth,
"oidc_rp_idp_sign_key": config_model.oidc_rp_idp_sign_key,
"oidc_op_logout_endpoint": config_model.oidc_op_logout_endpoint,
"oidc_use_nonce": config_model.oidc_use_nonce,
"oidc_nonce_size": config_model.oidc_nonce_size,
"oidc_state_size": config_model.oidc_state_size,
Expand Down Expand Up @@ -66,6 +64,8 @@ def execute(self, model: AdminOIDCConfigurationModel) -> None:
oidc_op_authorization_endpoint=config_model.endpoint_config.oidc_op_authorization_endpoint,
oidc_op_token_endpoint=config_model.endpoint_config.oidc_op_token_endpoint,
oidc_op_user_endpoint=config_model.endpoint_config.oidc_op_user_endpoint,
oidc_op_logout_endpoint=config_model.endpoint_config.oidc_op_logout_endpoint,
oidc_op_jwks_endpoint=config_model.endpoint_config.oidc_op_jwks_endpoint,
)

form = OpenIDConnectConfigForm(
Expand Down

0 comments on commit 1134cd3

Please sign in to comment.