mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
remove more unnecessary feature flagging for AUTHENTICATION_BACKENDS
This commit is contained in:
@@ -134,17 +134,6 @@ class AuthenticationBackendsField(fields.StringListField):
|
|||||||
('django.contrib.auth.backends.ModelBackend', []),
|
('django.contrib.auth.backends.ModelBackend', []),
|
||||||
])
|
])
|
||||||
|
|
||||||
REQUIRED_BACKEND_FEATURE = {
|
|
||||||
'awx.sso.backends.LDAPBackend': 'ldap',
|
|
||||||
'awx.sso.backends.LDAPBackend1': 'ldap',
|
|
||||||
'awx.sso.backends.LDAPBackend2': 'ldap',
|
|
||||||
'awx.sso.backends.LDAPBackend3': 'ldap',
|
|
||||||
'awx.sso.backends.LDAPBackend4': 'ldap',
|
|
||||||
'awx.sso.backends.LDAPBackend5': 'ldap',
|
|
||||||
'awx.sso.backends.RADIUSBackend': 'enterprise_auth',
|
|
||||||
'awx.sso.backends.SAMLAuth': 'enterprise_auth',
|
|
||||||
}
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_all_required_settings(cls):
|
def get_all_required_settings(cls):
|
||||||
all_required_settings = set(['LICENSE'])
|
all_required_settings = set(['LICENSE'])
|
||||||
@@ -167,10 +156,8 @@ class AuthenticationBackendsField(fields.StringListField):
|
|||||||
for backend, required_settings in self.REQUIRED_BACKEND_SETTINGS.items():
|
for backend, required_settings in self.REQUIRED_BACKEND_SETTINGS.items():
|
||||||
if backend not in backends:
|
if backend not in backends:
|
||||||
continue
|
continue
|
||||||
required_feature = self.REQUIRED_BACKEND_FEATURE.get(backend, '')
|
if all([getattr(settings, rs, None) for rs in required_settings]):
|
||||||
if not required_feature:
|
continue
|
||||||
if all([getattr(settings, rs, None) for rs in required_settings]):
|
|
||||||
continue
|
|
||||||
backends = [x for x in backends if x != backend]
|
backends = [x for x in backends if x != backend]
|
||||||
return backends
|
return backends
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user