Skip to content
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

authn: Handle case when a user is not in any group #323

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented Oct 11, 2023

Description of proposed changes

In this case, the "cognito:groups" claim does not exist. Previously, this resulted in a KeyError upon login and whoami commands.

Related issue(s)

N/A

Checklist

  • nextstrain login and nextstrain whoami works locally for group-less user in testing environment
  • Checks pass

@victorlin victorlin requested a review from tsibley October 11, 2023 18:13
@victorlin victorlin self-assigned this Oct 11, 2023
Copy link
Member

@tsibley tsibley left a comment

Choose a reason for hiding this comment

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

Nice little bug fix! Thanks. One minor tweak to the fallback value.

nextstrain/cli/authn.py Outdated Show resolved Hide resolved
In this case, the "cognito:groups" claim does not exist. Previously,
this resulted in a KeyError upon login and whoami commands.
@victorlin victorlin force-pushed the victorlin/fix-groupless-experience branch from 1ccbed2 to 9cbb804 Compare October 11, 2023 20:01
@victorlin victorlin merged commit cea70d2 into master Oct 11, 2023
41 checks passed
@victorlin victorlin deleted the victorlin/fix-groupless-experience branch October 11, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants