Use idioms such as in set(group.name for group in spawner.user.groups) instead of having custom routines to extract the membership claims from the token.
For cognito, this requires config setting to use the id token (because the userinfo endpoint does not expose the membership claim).
Use idioms such as
in set(group.name for group in spawner.user.groups)
instead of having custom routines to extract the membership claims from the token.For cognito, this requires config setting to use the id token (because the userinfo endpoint does not expose the membership claim).
This facilitates #1.
Should substantially reduce line-count.