Remove LDAP authentication (#15546)

Remove LDAP authentication from AWX
This commit is contained in:
Djebran Lezzoum
2024-10-02 15:40:16 +02:00
committed by jessicamack
parent 6dea7bfe17
commit f22b192fb4
67 changed files with 172 additions and 2813 deletions

View File

@@ -52,21 +52,6 @@ EXAMPLES = '''
name: "AWX_ISOLATION_SHOW_PATHS"
value: "'/var/lib/awx/projects/', '/tmp'"
register: testing_settings
- name: Set the LDAP Auth Bind Password
settings:
name: "AUTH_LDAP_BIND_PASSWORD"
value: "Password"
no_log: true
- name: Set all the LDAP Auth Bind Params
settings:
settings:
AUTH_LDAP_BIND_PASSWORD: "password"
AUTH_LDAP_USER_ATTR_MAP:
email: "mail"
first_name: "givenName"
last_name: "surname"
'''
from ..module_utils.controller_api import ControllerAPIModule

View File

@@ -7,36 +7,6 @@ import pytest
from awx.conf.models import Setting
@pytest.mark.django_db
def test_setting_flat_value(run_module, admin_user):
the_value = 'CN=service_account,OU=ServiceAccounts,DC=domain,DC=company,DC=org'
result = run_module('settings', dict(name='AUTH_LDAP_BIND_DN', value=the_value), admin_user)
assert not result.get('failed', False), result.get('msg', result)
assert result.get('changed'), result
assert Setting.objects.get(key='AUTH_LDAP_BIND_DN').value == the_value
@pytest.mark.django_db
def test_setting_dict_value(run_module, admin_user):
the_value = {'email': 'mail', 'first_name': 'givenName', 'last_name': 'surname'}
result = run_module('settings', dict(name='AUTH_LDAP_USER_ATTR_MAP', value=the_value), admin_user)
assert not result.get('failed', False), result.get('msg', result)
assert result.get('changed'), result
assert Setting.objects.get(key='AUTH_LDAP_USER_ATTR_MAP').value == the_value
@pytest.mark.django_db
def test_setting_nested_type(run_module, admin_user):
the_value = {'email': 'mail', 'first_name': 'givenName', 'last_name': 'surname'}
result = run_module('settings', dict(settings={'AUTH_LDAP_USER_ATTR_MAP': the_value}), admin_user)
assert not result.get('failed', False), result.get('msg', result)
assert result.get('changed'), result
assert Setting.objects.get(key='AUTH_LDAP_USER_ATTR_MAP').value == the_value
@pytest.mark.django_db
def test_setting_bool_value(run_module, admin_user):
for the_value in (True, False):