Skip to content

Commit

Permalink
Fetch creds per call
Browse files Browse the repository at this point in the history
  • Loading branch information
jrdnbradford committed Oct 4, 2024
1 parent ed38219 commit 7884369
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oauthenticator/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,17 @@ async def _fetch_member_groups(
http=None,
checked_groups=None,
processed_groups=None,
credentials=None,
):
"""
Return a set with the google groups a given user/group is a member of, including nested groups if allowed.
"""
if not hasattr(self, 'credentials'):
self.credentials = await self._setup_credentials(user_email_domain)

credentials = credentials or await self._setup_credentials(user_email_domain)
checked_groups = checked_groups or set()
processed_groups = processed_groups or set()

headers = {'Authorization': f'Bearer {self.credentials.token}'}
headers = {'Authorization': f'Bearer {credentials.token}'}
url = f'https://www.googleapis.com/admin/directory/v1/groups?userKey={member_email}'
group_data = await self.httpfetch(
url, headers=headers, label="fetching google groups"
Expand Down

0 comments on commit 7884369

Please sign in to comment.