gofmt the updated files.

This commit is contained in:
2025-02-19 11:56:31 +00:00
parent 803a1e5e21
commit d194cd778a
4 changed files with 37 additions and 37 deletions
+11 -11
View File
@@ -709,17 +709,17 @@ func (t *TraefikOidc) buildAuthURL(redirectURL, state, nonce string) string {
// startTokenCleanup starts the token cleanup goroutine // startTokenCleanup starts the token cleanup goroutine
func (t *TraefikOidc) startTokenCleanup() { func (t *TraefikOidc) startTokenCleanup() {
ticker := time.NewTicker(1 * time.Minute) // Run cleanup every minute ticker := time.NewTicker(1 * time.Minute) // Run cleanup every minute
go func() { go func() {
defer ticker.Stop() defer ticker.Stop()
for range ticker.C { for range ticker.C {
t.logger.Debug("Starting token cleanup cycle") t.logger.Debug("Starting token cleanup cycle")
t.tokenCache.Cleanup() t.tokenCache.Cleanup()
t.tokenBlacklist.Cleanup() t.tokenBlacklist.Cleanup()
t.jwkCache.Cleanup() // Assuming jwkCache is the cache from cache.go t.jwkCache.Cleanup() // Assuming jwkCache is the cache from cache.go
// Removed runtime.GC() call // Removed runtime.GC() call
} }
}() }()
} }
// RevokeToken adds the token to the blacklist // RevokeToken adds the token to the blacklist
+4 -4
View File
@@ -1782,7 +1782,7 @@ func TestBuildAuthURL(t *testing.T) {
issuerURL string issuerURL string
redirectURL string redirectURL string
state string state string
nonce string nonce string
expectedPrefix string expectedPrefix string
}{ }{
{ {
@@ -1791,7 +1791,7 @@ func TestBuildAuthURL(t *testing.T) {
issuerURL: "https://auth.example.com", issuerURL: "https://auth.example.com",
redirectURL: "https://app.example.com/callback", redirectURL: "https://app.example.com/callback",
state: "test-state", state: "test-state",
nonce: "test-nonce", nonce: "test-nonce",
expectedPrefix: "https://auth.example.com/oauth/authorize?", expectedPrefix: "https://auth.example.com/oauth/authorize?",
}, },
{ {
@@ -1800,7 +1800,7 @@ func TestBuildAuthURL(t *testing.T) {
issuerURL: "https://logto.example.com", issuerURL: "https://logto.example.com",
redirectURL: "https://app.example.com/callback", redirectURL: "https://app.example.com/callback",
state: "test-state", state: "test-state",
nonce: "test-nonce", nonce: "test-nonce",
expectedPrefix: "https://logto.example.com/oidc/auth?", expectedPrefix: "https://logto.example.com/oidc/auth?",
}, },
{ {
@@ -1809,7 +1809,7 @@ func TestBuildAuthURL(t *testing.T) {
issuerURL: "https://auth.example.com:8443", issuerURL: "https://auth.example.com:8443",
redirectURL: "https://app.example.com/callback", redirectURL: "https://app.example.com/callback",
state: "test-state", state: "test-state",
nonce: "test-nonce", nonce: "test-nonce",
expectedPrefix: "https://auth.example.com:8443/sign-in?", expectedPrefix: "https://auth.example.com:8443/sign-in?",
}, },
} }