Skip to content

Commit e78b048

Browse files
committed
fix: add TTL to cached id_token objects
1 parent cd694f4 commit e78b048

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pipeline/mutate/mutator_id_token.go

+10-5
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,16 @@ func (a *MutatorIDToken) tokenToCache(config *CredentialsIDTokenConfig, session
109109
}
110110

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

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

0 commit comments

Comments
 (0)