*: use ManagedAppConfig everywhere (#14839)
This commit is contained in:
committed by
GitHub
parent
452639d6d2
commit
296031c5df
@ -1,12 +1,13 @@
|
||||
"""authentik API AppConfig"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikAPIConfig(AppConfig):
|
||||
class AuthentikAPIConfig(ManagedAppConfig):
|
||||
"""authentik API Config"""
|
||||
|
||||
name = "authentik.api"
|
||||
label = "authentik_api"
|
||||
mountpoint = "api/"
|
||||
verbose_name = "authentik API"
|
||||
default = True
|
||||
|
||||
14
authentik/blueprints/tests/test_managed_app_config.py
Normal file
14
authentik/blueprints/tests/test_managed_app_config.py
Normal file
@ -0,0 +1,14 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
from authentik.enterprise.apps import EnterpriseConfig
|
||||
from authentik.lib.utils.reflection import get_apps
|
||||
|
||||
|
||||
class TestManagedAppConfig(TestCase):
|
||||
def test_apps_use_managed_app_config(self):
|
||||
for app in get_apps():
|
||||
if app.name.startswith("authentik.enterprise"):
|
||||
self.assertIn(EnterpriseConfig, app.__class__.__bases__)
|
||||
else:
|
||||
self.assertIn(ManagedAppConfig, app.__class__.__bases__)
|
||||
@ -1,9 +1,9 @@
|
||||
"""authentik brands app"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikBrandsConfig(AppConfig):
|
||||
class AuthentikBrandsConfig(ManagedAppConfig):
|
||||
"""authentik Brand app"""
|
||||
|
||||
name = "authentik.brands"
|
||||
@ -12,3 +12,4 @@ class AuthentikBrandsConfig(AppConfig):
|
||||
mountpoints = {
|
||||
"authentik.brands.urls_root": "",
|
||||
}
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""Authentik policy dummy app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikPolicyDummyConfig(AppConfig):
|
||||
class AuthentikPolicyDummyConfig(ManagedAppConfig):
|
||||
"""Authentik policy_dummy app config"""
|
||||
|
||||
name = "authentik.policies.dummy"
|
||||
label = "authentik_policies_dummy"
|
||||
verbose_name = "authentik Policies.Dummy"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik Event Matcher policy app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikPoliciesEventMatcherConfig(AppConfig):
|
||||
class AuthentikPoliciesEventMatcherConfig(ManagedAppConfig):
|
||||
"""authentik Event Matcher policy app config"""
|
||||
|
||||
name = "authentik.policies.event_matcher"
|
||||
label = "authentik_policies_event_matcher"
|
||||
verbose_name = "authentik Policies.Event Matcher"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""Authentik policy_expiry app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikPolicyExpiryConfig(AppConfig):
|
||||
class AuthentikPolicyExpiryConfig(ManagedAppConfig):
|
||||
"""Authentik policy_expiry app config"""
|
||||
|
||||
name = "authentik.policies.expiry"
|
||||
label = "authentik_policies_expiry"
|
||||
verbose_name = "authentik Policies.Expiry"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""Authentik policy_expression app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikPolicyExpressionConfig(AppConfig):
|
||||
class AuthentikPolicyExpressionConfig(ManagedAppConfig):
|
||||
"""Authentik policy_expression app config"""
|
||||
|
||||
name = "authentik.policies.expression"
|
||||
label = "authentik_policies_expression"
|
||||
verbose_name = "authentik Policies.Expression"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""Authentik policy geoip app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikPolicyGeoIPConfig(AppConfig):
|
||||
class AuthentikPolicyGeoIPConfig(ManagedAppConfig):
|
||||
"""Authentik policy_geoip app config"""
|
||||
|
||||
name = "authentik.policies.geoip"
|
||||
label = "authentik_policies_geoip"
|
||||
verbose_name = "authentik Policies.GeoIP"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik Password policy app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikPoliciesPasswordConfig(AppConfig):
|
||||
class AuthentikPoliciesPasswordConfig(ManagedAppConfig):
|
||||
"""authentik Password policy app config"""
|
||||
|
||||
name = "authentik.policies.password"
|
||||
label = "authentik_policies_password"
|
||||
verbose_name = "authentik Policies.Password"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik ldap provider app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikProviderLDAPConfig(AppConfig):
|
||||
class AuthentikProviderLDAPConfig(ManagedAppConfig):
|
||||
"""authentik ldap provider app config"""
|
||||
|
||||
name = "authentik.providers.ldap"
|
||||
label = "authentik_providers_ldap"
|
||||
verbose_name = "authentik Providers.LDAP"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik radius provider app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikProviderRadiusConfig(AppConfig):
|
||||
class AuthentikProviderRadiusConfig(ManagedAppConfig):
|
||||
"""authentik radius provider app config"""
|
||||
|
||||
name = "authentik.providers.radius"
|
||||
label = "authentik_providers_radius"
|
||||
verbose_name = "authentik Providers.Radius"
|
||||
default = True
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
"""authentik SAML IdP app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikProviderSAMLConfig(AppConfig):
|
||||
class AuthentikProviderSAMLConfig(ManagedAppConfig):
|
||||
"""authentik SAML IdP app config"""
|
||||
|
||||
name = "authentik.providers.saml"
|
||||
label = "authentik_providers_saml"
|
||||
verbose_name = "authentik Providers.SAML"
|
||||
mountpoint = "application/saml/"
|
||||
default = True
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
"""authentik Recovery app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikRecoveryConfig(AppConfig):
|
||||
class AuthentikRecoveryConfig(ManagedAppConfig):
|
||||
"""authentik Recovery app config"""
|
||||
|
||||
name = "authentik.recovery"
|
||||
label = "authentik_recovery"
|
||||
verbose_name = "authentik Recovery"
|
||||
mountpoint = "recovery/"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik plex config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikSourcePlexConfig(AppConfig):
|
||||
class AuthentikSourcePlexConfig(ManagedAppConfig):
|
||||
"""authentik source plex config"""
|
||||
|
||||
name = "authentik.sources.plex"
|
||||
label = "authentik_sources_plex"
|
||||
verbose_name = "authentik Sources.Plex"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""Authenticator"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageAuthenticatorConfig(AppConfig):
|
||||
class AuthentikStageAuthenticatorConfig(ManagedAppConfig):
|
||||
"""Authenticator App config"""
|
||||
|
||||
name = "authentik.stages.authenticator"
|
||||
label = "authentik_stages_authenticator"
|
||||
verbose_name = "authentik Stages.Authenticator"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""SMS"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageAuthenticatorSMSConfig(AppConfig):
|
||||
class AuthentikStageAuthenticatorSMSConfig(ManagedAppConfig):
|
||||
"""SMS App config"""
|
||||
|
||||
name = "authentik.stages.authenticator_sms"
|
||||
label = "authentik_stages_authenticator_sms"
|
||||
verbose_name = "authentik Stages.Authenticator.SMS"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""TOTP"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageAuthenticatorTOTPConfig(AppConfig):
|
||||
class AuthentikStageAuthenticatorTOTPConfig(ManagedAppConfig):
|
||||
"""TOTP App config"""
|
||||
|
||||
name = "authentik.stages.authenticator_totp"
|
||||
label = "authentik_stages_authenticator_totp"
|
||||
verbose_name = "authentik Stages.Authenticator.TOTP"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""Authenticator Validation Stage"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageAuthenticatorValidateConfig(AppConfig):
|
||||
class AuthentikStageAuthenticatorValidateConfig(ManagedAppConfig):
|
||||
"""Authenticator Validation Stage"""
|
||||
|
||||
name = "authentik.stages.authenticator_validate"
|
||||
label = "authentik_stages_authenticator_validate"
|
||||
verbose_name = "authentik Stages.Authenticator.Validate"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik captcha app"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageCaptchaConfig(AppConfig):
|
||||
class AuthentikStageCaptchaConfig(ManagedAppConfig):
|
||||
"""authentik captcha app"""
|
||||
|
||||
name = "authentik.stages.captcha"
|
||||
label = "authentik_stages_captcha"
|
||||
verbose_name = "authentik Stages.Captcha"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik consent app"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageConsentConfig(AppConfig):
|
||||
class AuthentikStageConsentConfig(ManagedAppConfig):
|
||||
"""authentik consent app"""
|
||||
|
||||
name = "authentik.stages.consent"
|
||||
label = "authentik_stages_consent"
|
||||
verbose_name = "authentik Stages.Consent"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik deny stage app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageDenyConfig(AppConfig):
|
||||
class AuthentikStageDenyConfig(ManagedAppConfig):
|
||||
"""authentik deny stage config"""
|
||||
|
||||
name = "authentik.stages.deny"
|
||||
label = "authentik_stages_deny"
|
||||
verbose_name = "authentik Stages.Deny"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik dummy stage config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageDummyConfig(AppConfig):
|
||||
class AuthentikStageDummyConfig(ManagedAppConfig):
|
||||
"""authentik dummy stage config"""
|
||||
|
||||
name = "authentik.stages.dummy"
|
||||
label = "authentik_stages_dummy"
|
||||
verbose_name = "authentik Stages.Dummy"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik identification stage app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageIdentificationConfig(AppConfig):
|
||||
class AuthentikStageIdentificationConfig(ManagedAppConfig):
|
||||
"""authentik identification stage config"""
|
||||
|
||||
name = "authentik.stages.identification"
|
||||
label = "authentik_stages_identification"
|
||||
verbose_name = "authentik Stages.Identification"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik invitation stage app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageInvitationConfig(AppConfig):
|
||||
class AuthentikStageInvitationConfig(ManagedAppConfig):
|
||||
"""authentik invitation stage config"""
|
||||
|
||||
name = "authentik.stages.invitation"
|
||||
label = "authentik_stages_invitation"
|
||||
verbose_name = "authentik Stages.Invitation"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik core app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStagePasswordConfig(AppConfig):
|
||||
class AuthentikStagePasswordConfig(ManagedAppConfig):
|
||||
"""authentik password stage config"""
|
||||
|
||||
name = "authentik.stages.password"
|
||||
label = "authentik_stages_password"
|
||||
verbose_name = "authentik Stages.Password"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik prompt stage app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStagePromptConfig(AppConfig):
|
||||
class AuthentikStagePromptConfig(ManagedAppConfig):
|
||||
"""authentik prompt stage config"""
|
||||
|
||||
name = "authentik.stages.prompt"
|
||||
label = "authentik_stages_prompt"
|
||||
verbose_name = "authentik Stages.Prompt"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik redirect app"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageRedirectConfig(AppConfig):
|
||||
class AuthentikStageRedirectConfig(ManagedAppConfig):
|
||||
"""authentik redirect app"""
|
||||
|
||||
name = "authentik.stages.redirect"
|
||||
label = "authentik_stages_redirect"
|
||||
verbose_name = "authentik Stages.Redirect"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik delete stage app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageUserDeleteConfig(AppConfig):
|
||||
class AuthentikStageUserDeleteConfig(ManagedAppConfig):
|
||||
"""authentik delete stage config"""
|
||||
|
||||
name = "authentik.stages.user_delete"
|
||||
label = "authentik_stages_user_delete"
|
||||
verbose_name = "authentik Stages.User Delete"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik login stage app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageUserLoginConfig(AppConfig):
|
||||
class AuthentikStageUserLoginConfig(ManagedAppConfig):
|
||||
"""authentik login stage config"""
|
||||
|
||||
name = "authentik.stages.user_login"
|
||||
label = "authentik_stages_user_login"
|
||||
verbose_name = "authentik Stages.User Login"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik logout stage app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageUserLogoutConfig(AppConfig):
|
||||
class AuthentikStageUserLogoutConfig(ManagedAppConfig):
|
||||
"""authentik logout stage config"""
|
||||
|
||||
name = "authentik.stages.user_logout"
|
||||
label = "authentik_stages_user_logout"
|
||||
verbose_name = "authentik Stages.User Logout"
|
||||
default = True
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
"""authentik write stage app config"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
from authentik.blueprints.apps import ManagedAppConfig
|
||||
|
||||
|
||||
class AuthentikStageUserWriteConfig(AppConfig):
|
||||
class AuthentikStageUserWriteConfig(ManagedAppConfig):
|
||||
"""authentik write stage config"""
|
||||
|
||||
name = "authentik.stages.user_write"
|
||||
label = "authentik_stages_user_write"
|
||||
verbose_name = "authentik Stages.User Write"
|
||||
default = True
|
||||
|
||||
Reference in New Issue
Block a user