Skip to content

Commit

Permalink
Fix common names for user memberships in groups. Newer openldap overr…
Browse files Browse the repository at this point in the history
…ides the cn in the dn with the cn in the ldif entry.
  • Loading branch information
ggreer committed Jun 27, 2024
1 parent b3e0b3e commit 682f453
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ jobs:
- name: Run baton-ldap
run: ./baton-ldap
- name: Revoke grants
run: ./baton-ldap --revoke-grant 'group:cn=testgroup00000,dc=example,dc=org:member:user:cn=testuser00999,dc=example,dc=org' && ./baton-ldap --revoke-grant 'group:cn=othertestgroup00000,dc=example,dc=org:member:user:cn=testuser00999,dc=example,dc=org'
run: ./baton-ldap --revoke-grant 'group:cn=testgroup00000,dc=example,dc=org:member:user:cn=testuser00999@example.com,dc=example,dc=org' && ./baton-ldap --revoke-grant 'group:cn=othertestgroup00000,dc=example,dc=org:member:user:cn=testuser00999@example.com,dc=example,dc=org'
- name: Grant entitlements
run: ./baton-ldap --grant-entitlement 'group:cn=testgroup00000,dc=example,dc=org:member' --grant-principal 'cn=testuser00999,dc=example,dc=org' --grant-principal-type 'user' && ./baton-ldap --grant-entitlement 'group:cn=othertestgroup00000,dc=example,dc=org:member' --grant-principal 'cn=testuser00999,dc=example,dc=org' --grant-principal-type 'user'
run: ./baton-ldap --grant-entitlement 'group:cn=testgroup00000,dc=example,dc=org:member' --grant-principal 'cn=testuser00999@example.com,dc=example,dc=org' --grant-principal-type 'user' && ./baton-ldap --grant-entitlement 'group:cn=othertestgroup00000,dc=example,dc=org:member' --grant-principal 'cn=testuser00999@example.com,dc=example,dc=org' --grant-principal-type 'user'
8 changes: 4 additions & 4 deletions scripts/ldif.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ gidNumber: ${groupId}

for (let userId = 0; userId < userCount; userId++) {
const userIdStr = ("00000" + userId).slice(-5);
groupStr += `memberUid: testuser${userIdStr}
groupStr += `memberUid: testuser${userIdStr}@example.com
`;
}

Expand All @@ -72,12 +72,12 @@ for (let groupId = 0; groupId < groupCount; groupId++) {
objectClass: top
objectClass: groupOfUniqueNames
cn: othertestgroup${groupIdStr}
owner: cn=testuser00000,dc=example,dc=org
owner: cn=testuser00000@example.com,dc=example,dc=org
`;

for (let userId = 0; userId < userCount; userId++) {
const userIdStr = ("00000" + userId).slice(-5);
groupStr += `uniquemember: cn=testuser${userIdStr},dc=example,dc=org
groupStr += `uniquemember: cn=testuser${userIdStr}@example.com,dc=example,dc=org
`;
}

Expand All @@ -88,7 +88,7 @@ owner: cn=testuser00000,dc=example,dc=org
for (let userId = 0; userId < userCount; userId++) {
const userIdStr = ("00000" + userId).slice(-5);
const email = `testuser${userIdStr}@example.com`
write(`dn: cn=testuser${userIdStr},dc=example,dc=org
write(`dn: cn=${email},dc=example,dc=org
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
Expand Down

0 comments on commit 682f453

Please sign in to comment.