mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-07-16 10:32:22 -04:00
fix(proxy): honor access token cache ttl
This commit is contained in:
committed by
Ralf Haferkamp
parent
fcde95750b
commit
4734c57f2b
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user