Skip to content

feat(api): add support for user identity provider deletion #1181

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
Sep 9, 2020

Conversation

nejch
Copy link
Member

@nejch nejch commented Sep 7, 2020

Closes #1070.

This one is weird because the endpoint is kind of special (only supports delete, plus the creation of identities is inconsistent with this endpoint).

https://docs.gitlab.com/ee/api/users.html#delete-authentication-identity-from-user

I couldn't do user.identities for the manager because that's the attribute returned in the nested JSON. Maybe this could be done by having a __repr__() that returns that list from the attribute of the parent manager? But it felt like I would just be adding to the inconsistency, not sure. I didn't find any other examples that solved it for nested json.

I opted for user.identityproviders.delete() since its explicit and the provider is a required param. I also considered user.identity.delete(), user.delete_identity() (custom method) and user.providers.delete(), I'm open to any other suggestions here 😁

@nejch nejch requested a review from max-wittig September 7, 2020 21:56
Copy link
Member

@max-wittig max-wittig left a comment

Choose a reason for hiding this comment

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

I like it and it's also intuitiv this way. Thank you!

@max-wittig max-wittig merged commit 35f9cb8 into master Sep 9, 2020
@max-wittig max-wittig deleted the feat/delete-user-identities branch September 9, 2020 07:27
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.

How to delete identities with the API?
2 participants