Merge pull request #1699 from owncloud/fix-token-ttl

fix token cache TTL
This commit is contained in:
Jörn Friedrich Dreyer
2021-02-22 20:36:05 +01:00
committed by GitHub
2 changed files with 6 additions and 2 deletions
@@ -0,0 +1,5 @@
Bugfix: Fix the ttl of the authentication middleware cache
The authentication cache ttl was multiplied with `time.Second` multiple times. This resulted in a ttl that was not intended.
https://github.com/owncloud/ocis/pull/1699
+1 -2
View File
@@ -5,7 +5,6 @@ import (
"net/http" "net/http"
"regexp" "regexp"
"strings" "strings"
"time"
) )
var ( var (
@@ -114,7 +113,7 @@ func newOIDCAuth(options Options) func(http.Handler) http.Handler {
HTTPClient(options.HTTPClient), HTTPClient(options.HTTPClient),
OIDCIss(options.OIDCIss), OIDCIss(options.OIDCIss),
TokenCacheSize(options.UserinfoCacheSize), TokenCacheSize(options.UserinfoCacheSize),
TokenCacheTTL(time.Second*time.Duration(options.UserinfoCacheTTL)), TokenCacheTTL(options.UserinfoCacheTTL),
CredentialsByUserAgent(options.CredentialsByUserAgent), CredentialsByUserAgent(options.CredentialsByUserAgent),
) )
} }