-
Notifications
You must be signed in to change notification settings - Fork 367
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
[GitLab] possible fix to #545 : unionize allowed lists in GitLab Oauth #546
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
fix case of no_config_specified: let authenticator decide
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the simplest path to a solution, and makes sense to me
@@ -179,6 +179,11 @@ async def authenticate(self, handler, data=None): | |||
|
|||
no_config_specified = not (is_group_specified or is_project_id_specified) | |||
|
|||
if (is_group_specified and user_in_group) or ( | |||
is_project_id_specified and user_in_project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add allowed_users
to this condition, because we don't want to start populating it if it's empty and unused?
Cases to check:
|
@minrk Thanks for your comments and sorry for the late answer. As you can see the version is several commits late, but I still update this patch as a temporary solution for gitlab users like me until #594 reaches a consensus and a general solution.
In the proposed patch, I considered that allowed_users was the only "entrypoint" of Authenticator.
|
The reason I asked for an I checked, and blocked_users does indeed take precedence, so no need to worry about that. |
#594 developed to resolve this as well for all authenticators and is now merged. For GitLab it means that a user part of Thank you @floriandeboissieu for working this, and thanks for writing up a PR description that for example linked to other issues. Your work has helped me develop an understanding of the needs and behaviors for various authenticators in this project! If you have time to contribute further, feedback on if #594 works out correctly would be great! |
@minrk, sorry, I did not find the time to study the cases you were suggesting... |
This is a fix issue #545 : it adds the username to the set of allowed_users if it passes the allowed_gitlab_groups or the allowed_projects_ids .
I am not sure it is a good practice to edit the allowed_users set while in an async function, so I let the maintainers of oauthenticator review that solution, but it is working as expected when tested on my side.