Skip to content

feat(groups): add LDAP link manager and deprecate old API endpoints #2379

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

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

nejch
Copy link
Member

@nejch nejch commented Nov 17, 2022

This builds on #2371.

I realized #1612 already did something similar and the list() create() delete() interface is more intuitive for the user.
Additionally, #2367 will bring in a similar interface for SAML.
And finally, the delete endpoints used in the current method are actually deprecated upstream, so good to move away from that on our side

https://docs.gitlab.com/ee/api/groups.html#delete-ldap-group-link (deprecated)
https://docs.gitlab.com/ee/api/groups.html#delete-ldap-group-link-with-cn-or-filter (new endpoint)

@nejch nejch force-pushed the feat/ldap-group-links-manager branch from 1afa4ce to f6bc2a6 Compare November 17, 2022 17:29
@nejch nejch marked this pull request as ready for review November 17, 2022 17:40
@nejch nejch requested a review from JohnVillalovos November 17, 2022 17:40
Comment on lines -197 to -212
@cli.register_custom_action("Group")
@exc.on_http_error(exc.GitlabGetError)
def list_ldap_group_links(
self, **kwargs: Any
) -> Union[gitlab.GitlabList, List[Dict[str, Any]]]:
"""List LDAP group links.

Args:
**kwargs: Extra options to send to the server (e.g. sudo)

Raises:
GitlabAuthenticationError: If authentication is not correct
GitlabGetError: If the server cannot perform the request
"""
path = f"/groups/{self.encoded_id}/ldap_group_links"
return self.manager.gitlab.http_list(path, **kwargs)
Copy link
Member Author

Choose a reason for hiding this comment

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

No deprecation needed as we haven't released it yet.

Copy link
Member

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

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

Thanks @nejch 🙂

@JohnVillalovos JohnVillalovos merged commit 3a61f60 into main Nov 17, 2022
@JohnVillalovos JohnVillalovos deleted the feat/ldap-group-links-manager branch November 17, 2022 22:46
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