-
Notifications
You must be signed in to change notification settings - Fork 386
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
feat: forbid generating an access token without a session #1504
Merged
Conversation
This file contains 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
…hub.com:supabase/gotrue into j0/forbid_access_token_issuance_without_session
J0
commented
Mar 28, 2024
Pull Request Test Coverage Report for Build 8465197021Details
💛 - Coveralls |
kangmingtay
approved these changes
Mar 28, 2024
J0
added a commit
that referenced
this pull request
Apr 1, 2024
## What kind of change does this PR introduce? Enforces the precondition of a valid session before one can create an access token. This supports refactors around `generateAccessToken` and `updateMFASessionAndClaims`. Also allows for stronger guarantees within the function since one can always assume there is a valid session. There were a few test changes: - To mirror real world use, Access Tokens should now only exist where there is a valid session. We wrap `generateAccessToken` into a helper `generateAccessTokenAndSession` to replace previous occurrences where session was set to nil. - We split TestUpdatePassword into cases where reauthentication is required and reauthentication is not required. We also attach a session to two of the test cases as they were previously nil
kangmingtay
pushed a commit
that referenced
this pull request
Apr 3, 2024
🤖 I have created a release *beep* *boop* --- ## [2.146.0](v2.145.0...v2.146.0) (2024-04-03) ### Features * add custom sms hook ([#1474](#1474)) ([0f6b29a](0f6b29a)) * forbid generating an access token without a session ([#1504](#1504)) ([795e93d](795e93d)) ### Bug Fixes * add cleanup statement for anonymous users ([#1497](#1497)) ([cf2372a](cf2372a)) * generate signup link should not error ([#1514](#1514)) ([4fc3881](4fc3881)) * move all EmailActionTypes to mailer package ([#1510](#1510)) ([765db08](765db08)) * refactor mfa and aal update methods ([#1503](#1503)) ([31a5854](31a5854)) * rename from CustomSMSProvider to SendSMS ([#1513](#1513)) ([c0bc37b](c0bc37b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
uxodb
pushed a commit
to uxodb/auth
that referenced
this pull request
Nov 13, 2024
) ## What kind of change does this PR introduce? Enforces the precondition of a valid session before one can create an access token. This supports refactors around `generateAccessToken` and `updateMFASessionAndClaims`. Also allows for stronger guarantees within the function since one can always assume there is a valid session. There were a few test changes: - To mirror real world use, Access Tokens should now only exist where there is a valid session. We wrap `generateAccessToken` into a helper `generateAccessTokenAndSession` to replace previous occurrences where session was set to nil. - We split TestUpdatePassword into cases where reauthentication is required and reauthentication is not required. We also attach a session to two of the test cases as they were previously nil
uxodb
pushed a commit
to uxodb/auth
that referenced
this pull request
Nov 13, 2024
🤖 I have created a release *beep* *boop* --- ## [2.146.0](supabase/auth@v2.145.0...v2.146.0) (2024-04-03) ### Features * add custom sms hook ([supabase#1474](supabase#1474)) ([0f6b29a](supabase@0f6b29a)) * forbid generating an access token without a session ([supabase#1504](supabase#1504)) ([795e93d](supabase@795e93d)) ### Bug Fixes * add cleanup statement for anonymous users ([supabase#1497](supabase#1497)) ([cf2372a](supabase@cf2372a)) * generate signup link should not error ([supabase#1514](supabase#1514)) ([4fc3881](supabase@4fc3881)) * move all EmailActionTypes to mailer package ([supabase#1510](supabase#1510)) ([765db08](supabase@765db08)) * refactor mfa and aal update methods ([supabase#1503](supabase#1503)) ([31a5854](supabase@31a5854)) * rename from CustomSMSProvider to SendSMS ([supabase#1513](supabase#1513)) ([c0bc37b](supabase@c0bc37b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this pull request
Nov 13, 2024
) ## What kind of change does this PR introduce? Enforces the precondition of a valid session before one can create an access token. This supports refactors around `generateAccessToken` and `updateMFASessionAndClaims`. Also allows for stronger guarantees within the function since one can always assume there is a valid session. There were a few test changes: - To mirror real world use, Access Tokens should now only exist where there is a valid session. We wrap `generateAccessToken` into a helper `generateAccessTokenAndSession` to replace previous occurrences where session was set to nil. - We split TestUpdatePassword into cases where reauthentication is required and reauthentication is not required. We also attach a session to two of the test cases as they were previously nil
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this pull request
Nov 13, 2024
🤖 I have created a release *beep* *boop* --- ## [2.146.0](supabase/auth@v2.145.0...v2.146.0) (2024-04-03) ### Features * add custom sms hook ([supabase#1474](supabase#1474)) ([0f6b29a](supabase@0f6b29a)) * forbid generating an access token without a session ([supabase#1504](supabase#1504)) ([795e93d](supabase@795e93d)) ### Bug Fixes * add cleanup statement for anonymous users ([supabase#1497](supabase#1497)) ([cf2372a](supabase@cf2372a)) * generate signup link should not error ([supabase#1514](supabase#1514)) ([4fc3881](supabase@4fc3881)) * move all EmailActionTypes to mailer package ([supabase#1510](supabase#1510)) ([765db08](supabase@765db08)) * refactor mfa and aal update methods ([supabase#1503](supabase#1503)) ([31a5854](supabase@31a5854)) * rename from CustomSMSProvider to SendSMS ([supabase#1513](supabase#1513)) ([c0bc37b](supabase@c0bc37b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this pull request
Nov 15, 2024
) ## What kind of change does this PR introduce? Enforces the precondition of a valid session before one can create an access token. This supports refactors around `generateAccessToken` and `updateMFASessionAndClaims`. Also allows for stronger guarantees within the function since one can always assume there is a valid session. There were a few test changes: - To mirror real world use, Access Tokens should now only exist where there is a valid session. We wrap `generateAccessToken` into a helper `generateAccessTokenAndSession` to replace previous occurrences where session was set to nil. - We split TestUpdatePassword into cases where reauthentication is required and reauthentication is not required. We also attach a session to two of the test cases as they were previously nil
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this pull request
Nov 15, 2024
🤖 I have created a release *beep* *boop* --- ## [2.146.0](supabase/auth@v2.145.0...v2.146.0) (2024-04-03) ### Features * add custom sms hook ([supabase#1474](supabase#1474)) ([0f6b29a](supabase@0f6b29a)) * forbid generating an access token without a session ([supabase#1504](supabase#1504)) ([795e93d](supabase@795e93d)) ### Bug Fixes * add cleanup statement for anonymous users ([supabase#1497](supabase#1497)) ([cf2372a](supabase@cf2372a)) * generate signup link should not error ([supabase#1514](supabase#1514)) ([4fc3881](supabase@4fc3881)) * move all EmailActionTypes to mailer package ([supabase#1510](supabase#1510)) ([765db08](supabase@765db08)) * refactor mfa and aal update methods ([supabase#1503](supabase#1503)) ([31a5854](supabase@31a5854)) * rename from CustomSMSProvider to SendSMS ([supabase#1513](supabase#1513)) ([c0bc37b](supabase@c0bc37b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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 kind of change does this PR introduce?
Enforces the precondition of a valid session before one can create an access token. This supports refactors around
generateAccessToken
andupdateMFASessionAndClaims
. Also allows for stronger guarantees within the function since one can always assume there is a valid session.There were a few test changes:
generateAccessToken
into a helpergenerateAccessTokenAndSession
to replace previous occurrences where session was set to nil.