Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Using groups.list with a userkey parameter to determine group membership instead of members.list (#469) #500

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andrewrosezen
Copy link

An initial whack at simplifying the authorization check for the Google/GSuite provider when specifying a list of allowed groups.

I've tested this informally, but so far it works as expected.

@ploxiln
Copy link
Contributor

ploxiln commented Nov 14, 2017

Looks like a nice simplifying change.

I looked around the api a bit and I see there's a way you might be able to get all groups for a user: https://godoc.org/google.golang.org/api/admin/directory/v1#GroupsListCall.UserKey - this might involve a bit more code than what you managed here, but fewer requests to google's api.

@andrewrosezen
Copy link
Author

@ploxiln good point, the API docs suggest that this call could work fine. At a certain point, it is probably significantly less bound by http wait times. https://developers.google.com/admin-sdk/directory/v1/reference/groups/list

I'll look into this when I get a little more time.

@andrewrosezen andrewrosezen changed the title Using members.get to determine group membership instead of members.list (#469) Using groups.list with a userkey parameter to determine group membership instead of members.list (#469) Nov 16, 2017
@ploxiln
Copy link
Contributor

ploxiln commented Nov 20, 2017

@hlhendy since it looks like you're merging stuff these days, I'd just like to point out this PR as a good little cleanup. (Although I haven't tested it myself, since I currently only use the github provider.)

@jehiah jehiah added this to the v2.3 milestone Nov 21, 2017
@hlhendy hlhendy self-requested a review November 30, 2017 19:56
Copy link
Contributor

@hlhendy hlhendy left a comment

Choose a reason for hiding this comment

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

This looks good to me. Ready for merge?

@andrewrosezen
Copy link
Author

Yes, this can be merged (if it was waiting on me, sorry!)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

4 participants