Skip to content

Commit b03e292

Browse files
committed
fix: add TTL to cached id_token objects
1 parent bd369ba commit b03e292

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pipeline/mutate/mutator_id_token.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,16 @@ func (a *MutatorIDToken) tokenToCache(config *CredentialsIDTokenConfig, session
108108
}
109109

110110
key := a.cacheKey(config, ttl, claims, session)
111-
a.tokenCache.Set(key, &idTokenCacheContainer{
112-
TTL: ttl,
113-
ExpiresAt: expiresAt,
114-
Token: token,
115-
}, 0)
111+
a.tokenCache.SetWithTTL(
112+
key,
113+
&idTokenCacheContainer{
114+
TTL: ttl,
115+
ExpiresAt: expiresAt,
116+
Token: token,
117+
},
118+
0,
119+
ttl,
120+
)
116121
}
117122

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

0 commit comments

Comments
 (0)