-
Notifications
You must be signed in to change notification settings - Fork 674
Add initial support for manipulation of LDAP links #151
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
Conversation
|
Thank you for your work on this patch. It looks OK apart from a few syntax changes required. But I'm not comfortable merging it because this is a gitlab EE feature that I can't test. I'm not sure how I could automate testing and make sure the code works. |
|
Oh, I totally forgot this annoying detail :/ |
|
It's worth a try. I'd be happy to add EE features to the lib. Thanks! |
|
Just added a commit that changes the testing to use a fork of your |
|
I used Thank you for your work on this! |
|
I have this working (create/delete) on 1.4.0: from gitlab.base import RESTObject, RESTManager
from gitlab.mixins import CreateMixin, DeleteMixin
import gitlab.v4.objects
class GroupLdapGroupLink(RESTObject):
pass
class GroupLdapGroupLinkManager(CreateMixin, DeleteMixin, RESTManager):
_path = '/groups/%(group_id)s/ldap_group_links'
_obj_cls = GroupLdapGroupLink
_from_parent_attrs = {'group_id': 'id'}
_create_attrs = (('cn', 'group_access', 'provider'), tuple())
gitlab.v4.objects.GroupLdapGroupLinkManager = GroupLdapGroupLinkManager
gitlab.v4.objects.Group._managers = tuple(
gitlab.v4.objects.Group._managers + (('ldapgrouplinks', 'GroupLdapGroupLinkManager'), )
) |
|
The LDAP group link API endpoint being quite different from the other endpoints I implemented support for this feature as Group methods instead of new classes. See commit d6a61af. |
This PR add support for group.ldaplinks.create() and group.ldaplinks.delete().
It's unclear to me what the best way to implement .list() would be. Since the API returns the LDAP information embedded in the group, I see two options (maybe I'm missing something obvious):
Not sure how any of these could be implemented... :)