diff --git a/mozilla_django_oidc_db/backends.py b/mozilla_django_oidc_db/backends.py index 7105b50..8c07e22 100644 --- a/mozilla_django_oidc_db/backends.py +++ b/mozilla_django_oidc_db/backends.py @@ -11,8 +11,9 @@ OIDCAuthenticationBackend as _OIDCAuthenticationBackend, ) +from .constants import UserInformationClaimsSources from .mixins import GetAttributeMixin, SoloConfigMixin -from .models import OpenIDConnectConfig, UserInformationClaimsSources +from .models import OpenIDConnectConfig from .utils import obfuscate_claims logger = logging.getLogger(__name__) diff --git a/mozilla_django_oidc_db/constants.py b/mozilla_django_oidc_db/constants.py index e5f538b..5e24f81 100644 --- a/mozilla_django_oidc_db/constants.py +++ b/mozilla_django_oidc_db/constants.py @@ -1,3 +1,6 @@ +from django.db import models +from django.utils.translation import gettext_lazy as _ + # Mapping the configuration model fieldnames for endpoints to their # corresponding names in the OIDC spec OIDC_MAPPING = { @@ -8,3 +11,8 @@ } OPEN_ID_CONFIG_PATH = ".well-known/openid-configuration" + + +class UserInformationClaimsSources(models.TextChoices): + userinfo_endpoint = "userinfo_endpoint", _("Userinfo endpoint") + id_token = "id_token", _("ID token") diff --git a/mozilla_django_oidc_db/models.py b/mozilla_django_oidc_db/models.py index 0b4636e..45ad3e5 100644 --- a/mozilla_django_oidc_db/models.py +++ b/mozilla_django_oidc_db/models.py @@ -14,11 +14,7 @@ import mozilla_django_oidc_db.settings as oidc_settings from .compat import classproperty - - -class UserInformationClaimsSources(models.TextChoices): - userinfo_endpoint = "userinfo_endpoint", _("Userinfo endpoint") - id_token = "id_token", _("ID token") +from .constants import UserInformationClaimsSources def get_default_scopes() -> List[str]: