misc: remove authentic2_auth_fc from plugin system (#44369)
This commit is contained in:
parent
2ae771b542
commit
61c6d4bd4f
1
setup.py
1
setup.py
|
@ -170,6 +170,5 @@ setup(name="authentic2",
|
|||
entry_points={
|
||||
'authentic2.plugin': [
|
||||
'authentic2-provisionning-ldap = authentic2_provisionning_ldap:Plugin',
|
||||
'authentic2-auth-fc = authentic2_auth_fc:Plugin',
|
||||
],
|
||||
})
|
||||
|
|
|
@ -130,6 +130,7 @@ INSTALLED_APPS = (
|
|||
'django_select2',
|
||||
'django_tables2',
|
||||
'mellon',
|
||||
'authentic2_auth_fc',
|
||||
'authentic2_auth_saml',
|
||||
'authentic2_auth_oidc',
|
||||
'authentic2_idp_cas',
|
||||
|
@ -163,6 +164,7 @@ AUTHENTICATION_BACKENDS = (
|
|||
'django_rbac.backends.DjangoRBACBackend',
|
||||
'authentic2_auth_saml.backends.SAMLBackend',
|
||||
'authentic2_auth_oidc.backends.OIDCBackend',
|
||||
'authentic2_auth_fc.backends.FcBackend',
|
||||
)
|
||||
AUTHENTICATION_BACKENDS = plugins.register_plugins_authentication_backends(AUTHENTICATION_BACKENDS)
|
||||
CSRF_FAILURE_VIEW = 'authentic2.views.csrf_failure_view'
|
||||
|
@ -184,6 +186,7 @@ AUTH_USER_MODEL = 'custom_user.User'
|
|||
AUTH_FRONTENDS = (
|
||||
'authentic2_auth_saml.authenticators.SAMLAuthenticator',
|
||||
'authentic2_auth_oidc.authenticators.OIDCAuthenticator',
|
||||
'authentic2_auth_fc.authenticators.FcAuthenticator',
|
||||
) + plugins.register_plugins_authenticators((
|
||||
'authentic2.authenticators.LoginPasswordAuthenticator',))
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ from django.views.decorators.clickjacking import xframe_options_deny
|
|||
|
||||
from . import plugins, views
|
||||
from authentic2.decorators import setting_enabled, required, lasso_required
|
||||
import authentic2_auth_fc.urls
|
||||
import authentic2_auth_oidc.urls
|
||||
import authentic2_auth_saml.urls
|
||||
import authentic2_idp_cas.app_settings
|
||||
|
@ -171,6 +172,7 @@ authentic2_idp_cas_urls = required(
|
|||
)
|
||||
|
||||
urlpatterns = (
|
||||
authentic2_auth_fc.urls.urlpatterns +
|
||||
authentic2_idp_oidc.urls.urlpatterns +
|
||||
authentic2_idp_cas_urls +
|
||||
authentic2_auth_oidc.urls.urlpatterns +
|
||||
|
|
|
@ -20,38 +20,6 @@ from . import app_settings
|
|||
import django.apps
|
||||
|
||||
|
||||
class Plugin(object):
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
return urls.urlpatterns
|
||||
|
||||
def get_apps(self):
|
||||
return [__name__]
|
||||
|
||||
def get_authentication_backends(self):
|
||||
return ['authentic2_auth_fc.backends.FcBackend']
|
||||
|
||||
def get_authenticators(self):
|
||||
return ['authentic2_auth_fc.authenticators.FcAuthenticator']
|
||||
|
||||
def redirect_logout_list(self, request, **kwargs):
|
||||
from django.urls import reverse
|
||||
from . import utils
|
||||
|
||||
url = utils.build_logout_url(request, next_url=reverse('auth_logout'))
|
||||
# url is assumed empty if no active session on the OP.
|
||||
if url:
|
||||
return [url]
|
||||
return []
|
||||
|
||||
def registration_form_prefill(self, request):
|
||||
from . import utils
|
||||
|
||||
if app_settings.enable_registration_form_prefill:
|
||||
return [utils.get_mapped_attributes(request)]
|
||||
return []
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
|
||||
name = __name__
|
||||
|
@ -105,5 +73,24 @@ class AppConfig(django.apps.AppConfig):
|
|||
return False
|
||||
return True
|
||||
|
||||
def redirect_logout_list(self, request, **kwargs):
|
||||
from django.urls import reverse
|
||||
from . import utils
|
||||
|
||||
url = utils.build_logout_url(request, next_url=reverse('auth_logout'))
|
||||
# url is assumed empty if no active session on the OP.
|
||||
if url:
|
||||
return [url]
|
||||
return []
|
||||
|
||||
def registration_form_prefill(self, request):
|
||||
from . import utils
|
||||
|
||||
if app_settings.enable_registration_form_prefill:
|
||||
return [utils.get_mapped_attributes(request)]
|
||||
return []
|
||||
|
||||
|
||||
|
||||
|
||||
default_app_config = '%s.%s' % (__name__, 'AppConfig')
|
||||
|
|
Loading…
Reference in New Issue