Skip to content

Commit

Permalink
fix: add TTL to cached id_token objects
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Wobrock committed Nov 11, 2024
1 parent 5aa1069 commit 15258e3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pipeline/mutate/mutator_id_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,16 @@ func (a *MutatorIDToken) tokenToCache(config *CredentialsIDTokenConfig, session
}

key := a.cacheKey(config, ttl, claims, session)
a.tokenCache.Set(key, &idTokenCacheContainer{
TTL: ttl,
ExpiresAt: expiresAt,
Token: token,
}, 0)
a.tokenCache.SetWithTTL(
key,
&idTokenCacheContainer{
TTL: ttl,
ExpiresAt: expiresAt,
Token: token,
},
0,
ttl,
)
}

func (a *MutatorIDToken) Mutate(r *http.Request, session *authn.AuthenticationSession, config json.RawMessage, rl pipeline.Rule) error {
Expand Down

0 comments on commit 15258e3

Please sign in to comment.