Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
  • Loading branch information
jrdnbradford and consideRatio authored Oct 1, 2024
1 parent 5209682 commit 125c701
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions oauthenticator/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,17 @@ def _fetch_member_groups(

if self.allow_nested_groups:
for group in member_groups:
if group not in processed_groups:
processed_groups.add(group)
nested_groups = self._fetch_member_groups(
f"{group}@{user_email_domain}",
user_email_domain,
http,
checked_groups,
processed_groups,
)
checked_groups.update(nested_groups)
if group in processed_groups:
continue
processed_groups.add(group)
nested_groups = self._fetch_member_groups(
f"{group}@{user_email_domain}",
user_email_domain,
http,
checked_groups,
processed_groups,
)
checked_groups.update(nested_groups)

self.log.debug(f"member_email {member_email} is a member of {checked_groups}")
return checked_groups
Expand Down
2 changes: 1 addition & 1 deletion oauthenticator/tests/test_google.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ async def test_hosted_domain_single_entry(
expect_admin,
):
"""
Tests that sign in is restricted fetchto the listed domain and that the username
Tests that sign in is restricted to the listed domain and that the username
represents the part before the `@domain.com` as expected when hosted_domain
contains a single entry.
"""
Expand Down

0 comments on commit 125c701

Please sign in to comment.