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

feat: add GitLab OAuth client #4828

Closed
wants to merge 4 commits into from

Conversation

almereyda
Copy link
Contributor

@almereyda almereyda commented Jun 14, 2024

This adds a GitLab OAuth client, based on the Google and GitHub examples.

This adds a new authentication_error_code() convenience method to oauth.py, in order to reduce code duplication.

To raise exceptions when OAuth is malconfigured, it also adds an additional OAUTH_NOT_CONFIGURED error.

This also adds execute permission to the files apiserver/bin/docker-entrypoint-beat.sh and apiserver/bin/docker-entrypoint-migrator.sh, as it was a dependency to being able to develop. (#4630)

There is a bit of code duplication between admin, web and spaces, but that may be a design choice.

This has been tested successfully against a custom GitLab instance and should work similarly against the default instance.

addresses #408
addresses #413
closes #4630

@almereyda
Copy link
Contributor Author

almereyda commented Jun 14, 2024

Please review what when wrong with clicking on the "Resolve conflicts" button:

The introduction of the convenience method authentication_error_code() brings distinct error codes for each different case of self.provider and for the unknown case, which is rarely reached.

I'm unable to give a reproducer at the moment, but there was a case during development, when OAUTH_NOT_CONFIGURED was needed to be thrown.

almereyda referenced this pull request Jun 14, 2024
* dev: oauth exception handling

* dev: reset password on deactivation
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes basically help to resolve the code duplication discussed in #4828 (comment)

@almereyda
Copy link
Contributor Author

almereyda commented Jun 14, 2024

Again, please excuse the earlier confusion with #4692 (comment) by incurring more work.

@almereyda almereyda force-pushed the feat/gitlab-oauth branch 2 times, most recently from a38b9b9 to 45d7fe0 Compare June 14, 2024 14:35
@almereyda
Copy link
Contributor Author

Ready for review.

@sriramveeraghanta
Copy link
Contributor

We have already squashed all your changes. We will review and fix things as a part of the internal release testing process. So closing this PR for now.

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.

None yet

2 participants