-
Notifications
You must be signed in to change notification settings - Fork 366
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
[GitHub] Add syntax to allow specific teams in a GitHub organization #449
[GitHub] Add syntax to allow specific teams in a GitHub organization #449
Conversation
@sgibson91 since you just commented on #265 (comment) would you mind testing this PR, and then merging if it works? |
Reduce confusion as team and org are used interchangeably when describing orgs
b43f891
to
2567271
Compare
@manics on my to-do list for tomorrow! Is there a recommended testing workflow?
@j0nnyr0berts just so I understand correctly. The behaviour I'm particularly looking for is member of org OR member of team in org. Is this what you're implying with the above statement? Update: I may need to double-check I've understood the requirements here (I'm translating someone else's workflow :D ) |
Thank you @j0nnyr0berts for this work!! I love to see that you have already provided a lot of test code! ❤️ 🎉 I'd like a think through about the API a bit. This makes allowed_organizations accept a Questions in my mind that may influence my opinion on the API choice This PR would also need an update of the documentation to make sure users become aware of the new feature. It should also be marked as "closes #265" to automatically close that issue. |
This would have been how I approached it. As in my above comment, I'm not sure if I'd need an or conditional (allow members from a given org or a given team). |
Hey! Functional testing is a little bit of a work up (or at least the way I approached it!). I created an organisation and team using my personal Github and generated a test oauth token to use with in the full example Dockerfile. Let me know if you could use a hand. |
Purely given ambiguity in interpretation here, I'd be all for having a separate |
Unfortunately, |
I tried to add an external collaborator to a team a few months ago and it wasn't possible, so I presume team members have to be a subset of organisation members. @sgibson91 for testing i think setting up a JupyterHub and checking only members in the specified team can login is sufficient. The unit tests check the logic but unfortunately they can't check an external API response for real. If they could reviewing PRs in this repo would be a lot easier! |
@sgibson91 @manics @j0nnyr0berts what do you think makes for a good configuration API exposed to users?
I think having |
I think I would expect to be able to use |
Can we see any more edge cases?
|
Is it correct that you mean to say you assume by using both, you can get the union of org_a, org_b, and org_c:team_c1 for example? I agree, that is what I'd expect and assume we would implement as well if we have # Example that can make sense
c.GitHubOAuthenticator.allowed_organizations = ["org_a", "org_b"]
c.GitHubOAuthenticator.allowed_teams = ["org_c:team_c1", "org_c:team_c2"] # Example that doesn't make sense and perhaps should cause
# a warning that org_d:team_d1 won't make sense to specify if
# org_d is allowed already.
c.GitHubOAuthenticator.allowed_organizations = ["org_d"]
c.GitHubOAuthenticator.allowed_teams = ["org_d:team_d1"] |
Hmm... But not all teams belong to that org? I think GitHub Teams are always associated with an org, and based on @manics answer above, I assume also that all team members of an org are members of the org as well. |
Exactly!
I think I meant something like the below example. You have defined an org with
|
I think the current code implementation is to lookup one org OR team at the time in a sequence via a REST APIcalls. An org or team membership will just influence what REST API endpoint is accessed to make the lookup, so X orgs + Y teams is no more problematic than X orgs or Y teams in isolation. |
Either seems fine to me. If you asked me to choose I'd go for a single property
is equivalent to
|
Okay 👍 for going with this api if @sgibson91 agree then! |
Sure, so long as we have some docs! :) |
To summarize then, @j0nnyr0berts update of documentation is what remains I think! |
24d504c
to
c3dcf55
Compare
I will also look to update the zero-to-jupyterhub-k8s auth docs if/when the |
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'm happy for this to be merged if others are :) Thank you @j0nnyr0berts!
Aaaaah thank you, you are welcome to do so right away in z2jh if you want @j0nnyr0berts, I'll cut a release quickly with this. |
c3dcf55
to
fac9cf3
Compare
Thank you @j0nnyr0berts, @sgibson91, and @manics ! |
This will be released as part of version 14.2.0 |
allowed_organisations = <organisation>:<team>
Working notes by Erik
<org>:<team>
syntax)