1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-23 09:54:21 +01:00
This commit is contained in:
sohalt 2020-04-07 19:15:31 +02:00
parent b5907ce340
commit 1549a172f7
13 changed files with 28 additions and 28 deletions

View File

@ -25,12 +25,12 @@ admin-lv2:
# ad: # ad:
# - Administrators # - Administrators
developpers: developers:
display_name: Developpers display_name: Developpers
description: Developpers of the system description: Developpers of the system
backends_groups: backends_groups:
ldap: ldap:
- cn=developpers,ou=Group,dc=example,dc=org - cn=developers,ou=Group,dc=example,dc=org
- cn=users,ou=Group,dc=example,dc=org - cn=users,ou=Group,dc=example,dc=org
users: users:

View File

@ -30,7 +30,7 @@ groups = {
'ad' : ['Domain Users', 'Domain Users 2'], 'ad' : ['Domain Users', 'Domain Users 2'],
'ldap': ['cn=users,ou=group,dc=example,dc=com', 'ldap': ['cn=users,ou=group,dc=example,dc=com',
'cn=nagios admins,ou=group,dc=example,dc=com', 'cn=nagios admins,ou=group,dc=example,dc=com',
'cn=developpers,ou=group,dc=example,dc=com', 'cn=developers,ou=group,dc=example,dc=com',
], ],
'toto': ['not a group'], 'toto': ['not a group'],
} }

View File

@ -21,10 +21,10 @@ users:
display_name: Administrators Level 3 display_name: Administrators Level 3
description: description description: description
subroles: {} subroles: {}
developpers: developers:
backends_groups: backends_groups:
ad: [Domain Users] ad: [Domain Users]
ldap: ['cn=developpers,ou=group,dc=example,dc=com'] ldap: ['cn=developers,ou=group,dc=example,dc=com']
display_name: Developpers display_name: Developpers
description: description description: description
subroles: {} subroles: {}

View File

@ -23,12 +23,12 @@ admin-lv2:
ad: ad:
- Domain Users - Domain Users
developpers: developers:
display_name: Developpers display_name: Developpers
description: description description: description
backends_groups: backends_groups:
ldap: ldap:
- cn=developpers,ou=group,dc=example,dc=com - cn=developers,ou=group,dc=example,dc=com
- cn=users,ou=group,dc=example,dc=com - cn=users,ou=group,dc=example,dc=com
ad: ad:
- Domain Users - Domain Users

View File

@ -23,12 +23,12 @@ admin-lv2:
ad: ad:
- Administrators - Administrators
#developpers: #developers:
# display_name: Developpers # display_name: Developpers
# description: Developpers of the system # description: Developpers of the system
# backends_groups: # backends_groups:
# ldap: # ldap:
# - cn=developpers,ou=Group,dc=example,dc=org # - cn=developers,ou=Group,dc=example,dc=org
# - cn=users,ou=Group,dc=example,dc=org # - cn=users,ou=Group,dc=example,dc=org
#users: #users:

View File

@ -23,12 +23,12 @@ admin -lv2:
ad: ad:
- Domain Users - Domain Users
developpers: developers:
display_name: Developpers display_name: Developpers
description: description description: description
backends_groups: backends_groups:
ldap: ldap:
- cn=developpers,ou=group,dc=example,dc=com - cn=developers,ou=group,dc=example,dc=com
- cn=users,ou=group,dc=example,dc=com - cn=users,ou=group,dc=example,dc=com
ad: ad:
- Domain Users - Domain Users

View File

@ -23,12 +23,12 @@ admin -lv3:
ad: ad:
- Domain Users - Domain Users
developpers: developers:
display_name: Developpers display_name: Developpers
description: description description: description
backends_groups: backends_groups:
ldap: ldap:
- cn=developpers,ou=group,dc=example,dc=com - cn=developers,ou=group,dc=example,dc=com
- cn=users,ou=group,dc=example,dc=com - cn=users,ou=group,dc=example,dc=com
ad: ad:
- Domain Users - Domain Users

View File

@ -17,12 +17,12 @@ admin-lv2:
display_name: Administrators Level 2 display_name: Administrators Level 2
description: description description: description
developpers: developers:
display_name: Developpers display_name: Developpers
description: description description: description
backends_groups: backends_groups:
ldap: ldap:
- cn=developpers,ou=group,dc=example,dc=com - cn=developers,ou=group,dc=example,dc=com
- cn=users,ou=group,dc=example,dc=com - cn=users,ou=group,dc=example,dc=com
ad: ad:
- Domain Users - Domain Users

View File

@ -22,12 +22,12 @@ admin-lv2:
ad: ad:
- Domain Users - Domain Users
developpers: developers:
display_name: Developpers display_name: Developpers
description: description description: description
backends_groups: backends_groups:
ldap: ldap:
- cn=developpers,ou=group,dc=example,dc=com - cn=developers,ou=group,dc=example,dc=com
- cn=users,ou=group,dc=example,dc=com - cn=users,ou=group,dc=example,dc=com
ad: ad:
- Domain Users - Domain Users

View File

@ -17,12 +17,12 @@ admin-lv2:
- cn=nagios admins,ou=Group,dc=example,dc=org - cn=nagios admins,ou=Group,dc=example,dc=org
- cn=users,ou=Group,dc=example,dc=org - cn=users,ou=Group,dc=example,dc=org
developpers: developers:
display_name: Developpers display_name: Developpers
description: Developpers of the system description: Developpers of the system
backends_groups: backends_groups:
ldap: ldap:
- cn=developpers,ou=Group,dc=example,dc=org - cn=developers,ou=Group,dc=example,dc=org
- cn=users,ou=Group,dc=example,dc=org - cn=users,ou=Group,dc=example,dc=org
users: users:

View File

@ -107,10 +107,10 @@ class TestError(object):
'description': 'description', 'description': 'description',
'display_name': 'Administrators Level 3' 'display_name': 'Administrators Level 3'
}, },
'developpers': { 'developers': {
'backends_groups': { 'backends_groups': {
'ad': ['Domain Users'], 'ad': ['Domain Users'],
'ldap': ['cn=developpers,ou=group,dc=example,dc=com', 'ldap': ['cn=developers,ou=group,dc=example,dc=com',
'cn=users,ou=group,dc=example,dc=com']}, 'cn=users,ou=group,dc=example,dc=com']},
'description': 'description', 'description': 'description',
'display_name': 'Developpers' 'display_name': 'Developpers'
@ -152,7 +152,7 @@ class TestError(object):
def testGetAllRoles(self): def testGetAllRoles(self):
inv = Roles('./tests/cfg/roles.yml') inv = Roles('./tests/cfg/roles.yml')
res = inv.get_allroles() res = inv.get_allroles()
expected = ['developpers', 'admin-lv3', 'admin-lv2', 'users'] expected = ['developers', 'admin-lv3', 'admin-lv2', 'users']
assert res == expected assert res == expected
def testGetAllRoles(self): def testGetAllRoles(self):
@ -187,9 +187,9 @@ class TestError(object):
'ad' : ['Domain Users', 'Domain Users 2'], 'ad' : ['Domain Users', 'Domain Users 2'],
'ldap': ['cn=users,ou=group,dc=example,dc=com', 'ldap': ['cn=users,ou=group,dc=example,dc=com',
'cn=nagios admins,ou=group,dc=example,dc=com', 'cn=nagios admins,ou=group,dc=example,dc=com',
'cn=developpers,ou=group,dc=example,dc=com', 'cn=developers,ou=group,dc=example,dc=com',
], ],
'toto': ['not a group'], 'toto': ['not a group'],
} }
expected = {'unusedgroups': {'toto': set(['not a group']), 'ad': set(['Domain Users 2'])}, 'roles': set(['developpers', 'admin-lv2', 'users'])} expected = {'unusedgroups': {'toto': set(['not a group']), 'ad': set(['Domain Users 2'])}, 'roles': set(['developers', 'admin-lv2', 'users'])}
assert inv.get_roles(groups) == expected assert inv.get_roles(groups) == expected

View File

@ -103,9 +103,9 @@ cn: users
description: Basic Users description: Basic Users
member: cn=Sheri Smith,ou=people,dc=example,dc=org member: cn=Sheri Smith,ou=people,dc=example,dc=org
dn: cn=developpers,ou=group,dc=example,dc=org dn: cn=developers,ou=group,dc=example,dc=org
objectclass: groupofnames objectclass: groupofnames
cn: developpers cn: developers
description: Developpers description: Developpers
member: cn=Sheri Smith,ou=people,dc=example,dc=org member: cn=Sheri Smith,ou=people,dc=example,dc=org

View File

@ -20,12 +20,12 @@ admin-lv2:
- cn=nagios admins,ou=Group,dc=example,dc=org - cn=nagios admins,ou=Group,dc=example,dc=org
- cn=users,ou=Group,dc=example,dc=org - cn=users,ou=Group,dc=example,dc=org
developpers: developers:
display_name: Developpers display_name: Developpers
description: description description: description
backends_groups: backends_groups:
ldap: ldap:
- cn=developpers,ou=Group,dc=example,dc=org - cn=developers,ou=Group,dc=example,dc=org
- cn=users,ou=Group,dc=example,dc=org - cn=users,ou=Group,dc=example,dc=org
users: users: