feat: add configurable session cache to cookie_session authenticator#1244
Open
wewelll wants to merge 5 commits intoory:masterfrom
Open
feat: add configurable session cache to cookie_session authenticator#1244wewelll wants to merge 5 commits intoory:masterfrom
wewelll wants to merge 5 commits intoory:masterfrom
Conversation
0297bd1 to
492cd5f
Compare
5 tasks
4298cee to
3429778
Compare
…to reduce session store requests and prevent rate limit errors
…nticators - Change MaxCost type from int to int64 to match oauth2_introspection and oauth2_client_credentials - Extract cache tests to separate file following established pattern - Remove cache tests from main authenticator test file
c807ed3 to
917e7a4
Compare
917e7a4 to
0693b8a
Compare
|
What is still needed for this to be merged? @aeneasr |
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.
This pull request adds a configurable session cache to the
cookie_sessionauthenticator, reducing load on session stores and preventing rate limit errors during high traffic periods. The implementation aligns with the existing cache patterns used inoauth2_introspectionandoauth2_client_credentialsauthenticators.Key Features
enabled,ttl, andmax_costsettingsConfiguration Example
Benefits
Related issue(s)
Fixes #1167
Completes #1232
Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got the approval (please contact
security@ory.sh) from the maintainers to push
the changes.
works.
Further Comments
This PR completes the work started in #1232 by adding cache support to the
cookie_sessionauthenticator. The implementation follows the exact same patterns as the OAuth2 authenticators to ensure consistency across the codebase:authenticator_cookie_session_cache_test.go)The default TTL was set to 1 second (instead of 60s) to balance the benefits of caching with the need for fresh session data in most use cases. Users can configure longer TTLs based on their specific requirements.