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

Make encoding user groups in access tokens configurable #2085

Merged
merged 5 commits into from
Sep 21, 2021

Conversation

ishank011
Copy link
Contributor

@ishank011 ishank011 commented Sep 20, 2021

This PR adds a shared config parameter skip_user_groups_in_token which can be used to control whether user groups should be encoded in the reva access tokens or not. If these are skipped, these are retrieved from the userprovider service and cached in the authentication interceptors, where these tokens are dismantled.

Closes #2084

@ishank011 ishank011 requested a review from labkode as a code owner September 20, 2021 11:59
@ishank011 ishank011 force-pushed the jwt-token-reduce-size branch from 3dcbb3f to bfe1d61 Compare September 20, 2021 15:49
@ishank011 ishank011 changed the title Don't encode user groups in JWT tokens Make encoding user groups in access tokens configurable Sep 20, 2021
@ishank011 ishank011 requested a review from glpatcern September 20, 2021 15:53
@ishank011 ishank011 force-pushed the jwt-token-reduce-size branch from edfaef0 to dfc453f Compare September 20, 2021 16:18
@ishank011
Copy link
Contributor Author

Size of token for user einstein (member of three groups):

  • Before the change: 620 bytes
  • After the change: 538 bytes

Copy link
Member

@glpatcern glpatcern left a comment

Choose a reason for hiding this comment

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

Looks good to me, as far as I can understand. Hopefully we'll see the immediate benefit with the token provided to WOPI :)

@ishank011
Copy link
Contributor Author

Merging, since all the changes are controlled by a flag so we've ensured it doesn't break anything.

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.

Reduce JWT token size
2 participants