fix(proxy): honor access token cache ttl

This commit is contained in:
Elias Schneider
2026-07-01 18:57:04 +02:00
committed by Ralf Haferkamp
parent fcde95750b
commit 4734c57f2b
2 changed files with 9 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ func NewOIDCAuthenticator(opts ...Option) *OIDCAuthenticator {
userInfoCache: options.UserInfoCache,
HTTPClient: options.HTTPClient,
OIDCIss: options.OIDCIss,
DefaultTokenCacheTTL: options.DefaultAccessTokenTTL,
oidcClient: options.OIDCClient,
AccessTokenVerifyMethod: options.AccessTokenVerifyMethod,
skipUserInfo: options.SkipUserInfo,

View File

@@ -53,6 +53,14 @@ var _ = Describe("Authenticating requests", Label("OIDCAuthenticator"), func() {
}
})
It("should apply the default access token ttl option", func() {
ttl := 5 * time.Minute
authenticator := NewOIDCAuthenticator(DefaultAccessTokenTTL(ttl))
Expect(authenticator.DefaultTokenCacheTTL).To(Equal(ttl))
})
When("the request contains correct data", func() {
It("should successfully authenticate", func() {
req := httptest.NewRequest(http.MethodGet, "http://example.com/example/path", http.NoBody)