Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More options for ldap group membership #22

Merged
merged 1 commit into from
Oct 27, 2016

Conversation

m0zes
Copy link
Contributor

@m0zes m0zes commented Sep 28, 2016

LDAP groups are not entirely one standard. I've added rfc2307 support, as rfc2307bis was mostly there.

rfc2307 defines members of a group to be a short name associated with the memberUid attribute. Think of /etc/group

rfc2307bis defines members as full DNs associated with either member or uniqueMember attributes.

This adds memberUid and uniqueMember to the search query and attribute list for the group membership search.

Copy link
Collaborator

@yuvipanda yuvipanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the patch - and apologies for the very delayed review!

I've one comment, but otherwise happy to merge. Can you tell me which server is using this schema?

'(uniqueMember={userdn})'
'(memberUid={uid})'
')'
).format(userdn=userdn, uid=username)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to also pass uid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am passing the uid/username. uid in the sense of rfc2307. According to the RFC:

To avoid confusion, the term "login name" refers to the user's login
name (being the value of the uid attribute) and the term "user ID"
refers to he user's integer identification number (being the value of
the uidNumber attribute).

So in this sense, group members are listed in the group with the following ldif:

dn: cn=some_group,ou=Groups,dc=example,dc=com
cn: some_group
gidNumber: 10000
objectClass: posixGroup
objectClass: top
memberUid: someusername
memberUid: someotherusername

@m0zes
Copy link
Contributor Author

m0zes commented Oct 18, 2016

OpenLDAP is extensible and can be setup to provide either RFC2307 or RFC2307bis trivially. My LDAP schema was defined several years ago based on RFC2307.

@yuvipanda yuvipanda merged commit 33e5621 into jupyterhub:master Oct 27, 2016
@yuvipanda
Copy link
Collaborator

Thanks for the patch! I'll cut a release soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants