- Add LDAP docker container structure (01-base-structure.ldif) - Add .env.test with LDAP configuration for tests - Create tests/ldap_fixtures.py with LDAP-specific fixtures - Create tests/api/v1/employees/test_helpers.py with centralized helpers - Add LDAP markers to pytest.ini (ldap_required, ldap_optional) - Add comprehensive LDAP testing documentation - Fix test_department_head_rights.py to use centralized helpers New fixtures: - ldap_available: checks if LDAP server is accessible - ldap_config: returns LDAP configuration - ensure_ldap_enabled/disabled: force LDAP state for test - ldap_cleanup: auto-cleanup LDAP entries after test New helpers: - make_user(): centralized user creation - grant_permission(): permission assignment - make_department/position/role(): entity creation - extract_results(): paginated response helper Infrastructure: - OU=Users, OU=Departments, OU=Groups, OU=Positions, OU=Dismissed - Test groups: Developers, Managers - Test departments: IT, HR
68 lines
1.9 KiB
Plaintext
68 lines
1.9 KiB
Plaintext
# Базовая структура для тестового LDAP
|
|
# Создается при инициализации контейнера OpenLDAP
|
|
|
|
# OU для пользователей (Users)
|
|
dn: OU=Users,dc=eusrr,dc=local
|
|
objectClass: organizationalUnit
|
|
objectClass: top
|
|
ou: Users
|
|
description: Контейнер для пользователей EUSRR
|
|
|
|
# OU для отделов (Departments)
|
|
dn: OU=Departments,dc=eusrr,dc=local
|
|
objectClass: organizationalUnit
|
|
objectClass: top
|
|
ou: Departments
|
|
description: Контейнер для отделов
|
|
|
|
# OU для групп (Groups)
|
|
dn: OU=Groups,dc=eusrr,dc=local
|
|
objectClass: organizationalUnit
|
|
objectClass: top
|
|
ou: Groups
|
|
description: Контейнер для групп безопасности
|
|
|
|
# OU для должностей (Positions)
|
|
dn: OU=Positions,dc=eusrr,dc=local
|
|
objectClass: organizationalUnit
|
|
objectClass: top
|
|
ou: Positions
|
|
description: Контейнер для должностей
|
|
|
|
# OU для уволенных (Dismissed)
|
|
dn: OU=Dismissed,dc=eusrr,dc=local
|
|
objectClass: organizationalUnit
|
|
objectClass: top
|
|
ou: Dismissed
|
|
description: Контейнер для уволенных пользователей
|
|
|
|
# Тестовый отдел IT
|
|
dn: OU=IT,OU=Departments,dc=eusrr,dc=local
|
|
objectClass: organizationalUnit
|
|
objectClass: top
|
|
ou: IT
|
|
description: IT Department
|
|
|
|
# Тестовый отдел HR
|
|
dn: OU=HR,OU=Departments,dc=eusrr,dc=local
|
|
objectClass: organizationalUnit
|
|
objectClass: top
|
|
ou: HR
|
|
description: HR Department
|
|
|
|
# Группа безопасности - Developers
|
|
dn: CN=Developers,OU=Groups,dc=eusrr,dc=local
|
|
objectClass: groupOfNames
|
|
objectClass: top
|
|
cn: Developers
|
|
description: Developers group
|
|
member: cn=admin,dc=eusrr,dc=local
|
|
|
|
# Группа безопасности - Managers
|
|
dn: CN=Managers,OU=Groups,dc=eusrr,dc=local
|
|
objectClass: groupOfNames
|
|
objectClass: top
|
|
cn: Managers
|
|
description: Managers group
|
|
member: cn=admin,dc=eusrr,dc=local
|