-
Notifications
You must be signed in to change notification settings - Fork 190
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
Enable caching contextual Login Credentials #1521
base: main
Are you sure you want to change the base?
Conversation
7070dd5
to
93cddf4
Compare
// NewOIDCAuthenticator returns a new OIDCAuthenticator. | ||
// The capacity is the number of authenticators to cache. | ||
// If the capacity is less than or equal to 0, the cache is disabled. | ||
func NewOIDCAuthenticator(opts ...OIDCAuthenticatorOptionFunc) (*OIDCAuthenticator, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can later on add retry
and evection
logic to that struct
93cddf4
to
e92327d
Compare
Provide an optional Cache to the Login Manager used to retrive contextual login credentials. Signed-off-by: Soule BA <[email protected]>
e92327d
to
5ecc6b1
Compare
disabled, found := os.LookupEnv("LOGIN_CACHE_DISABLED") | ||
if found && disabled == "true" { | ||
capacity = -1 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please implement this as a feature flag called CacheLoginTokens
enabled by default.
@@ -47,7 +47,7 @@ func NewCacheRecorder() *CacheRecorder { | |||
return &CacheRecorder{ | |||
cacheEventsCounter: prometheus.NewCounterVec( | |||
prometheus.CounterOpts{ | |||
Name: "gotk_cache_events_total", | |||
Name: "gotk_sc_cache_events_total", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the metric name is a breaking change, what is the reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a conflict in naming with the same metric in flux/pkg/cache
. I'll remove the SC internal cache
package to fix this.
Provide an optional Cache to the Login Manager used to retrive contextual login credentials.