Add cognito authentication flow token schema support.#68
Merged
Conversation
This is so that both the old token format, and the new Cognito token format both get supported at the same time w/o any changes to the domain logic.
…o the tests helper generated token can be signed.
…WT token structure that tests helper needs to create.
…ema type. This is because in reality, regardless of what schema is expected under the hood, the parse schema representing incoming data will always be TokenPresentation, just with different keys.
… self for assertions.
All this rule ensures is that tests names are unreadable.
… our controlled values rather than jwt generator defaults.
… that generates token dynamically.
… with dynamically generated one to prevent future gitguardian noise.
…to' token schema in addition to the old Hackney token schema.
…mGroups' case that compiler forces to address.
LBHTKarki
reviewed
Feb 25, 2026
LBHTKarki
reviewed
Feb 25, 2026
LBHTKarki
reviewed
Feb 25, 2026
…r presentation layer tests only (jwt str + token obj), meaning only TokenPresentation is needed for the setups. Removed code is remanants of a different approach.
This was referenced Feb 25, 2026
This was referenced Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Groupskey construction based on incoming token schema (groups are either inGroupsorCustomGroups).Why:
Groupsfield encoded asJSON Array. However, the new schema aims to reduce the size of hackney token (due to 4kB cookie size limitation) by cutting out all the JSON syntax (which analysis shows increases token size by ~11%) and replacing it with;separator joinedstring. Additionally, within the new token schema Google groups are stored undercustom:groupskey.Notes:
JWTtests setup to use generated tokens instead of using the hardcoded one. Done this to prevent having something that looks like real secrets in the code base needlessly alarming developers. Also did this to reduce the git guardian noise.