oauthenticator icon indicating copy to clipboard operation
oauthenticator copied to clipboard

[GitLab] Group membership check fails for subgroups

Open zragge opened this issue 4 years ago • 1 comments
trafficstars

Bug description

When using subgroup-membership for authorization the gitlab authenticator always says that the user is not a member of the groups. It seems to me that this is because the _check_membership_allowed_groups does url-encoding twice. First on row 206 in the mapping function (url_escape) and then on row 209 in the quote function. This causes the / in between the main and the subgroup to first becoming %2F, and then %252F when encoded the second time. When this then is sent to the gitlab-api it does not recognise the group.

I tried to remove one of the encoding functions in _check_membership_allowed_groups, and that seems to work for me.

Expected behaviour

Authorization succeeds

Actual behaviour

Authorization fails

How to reproduce

Create a subgroup in gitlab and use gitlab oauthenticator

zragge avatar Apr 08 '21 11:04 zragge

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Apr 08 '21 11:04 welcome[bot]