* Add ability to disable replay protection. - This is useful for runs with multiple traefik replicas to avoid false positives and tokens re-creation.
* Enhance the CI/CD pipelines
* Increase test coverage.
* Update vendored dependencies.
* Update behaviour on forceHTTPS as per issue #82
This commit is contained in:
2025-10-16 10:56:28 +01:00
committed by GitHub
parent 79e9b164f9
commit ae59a5e88a
74 changed files with 10748 additions and 234 deletions
+5 -4
View File
@@ -171,6 +171,7 @@ func NewWithContext(ctx context.Context, config *Config, next http.Handler, name
strictAudienceValidation: config.StrictAudienceValidation,
allowOpaqueTokens: config.AllowOpaqueTokens,
requireTokenIntrospection: config.RequireTokenIntrospection,
disableReplayDetection: config.DisableReplayDetection,
scopes: func() []string {
userProvidedScopes := deduplicateScopes(config.Scopes)
@@ -213,7 +214,7 @@ func NewWithContext(ctx context.Context, config *Config, next http.Handler, name
t.logger.Debugf("No custom audience specified, using clientID as audience: %s", t.clientID)
}
t.sessionManager, _ = NewSessionManager(config.SessionEncryptionKey, config.ForceHTTPS, config.CookieDomain, t.logger)
t.sessionManager, _ = NewSessionManager(config.SessionEncryptionKey, config.ForceHTTPS, config.CookieDomain, t.logger) // Safe to ignore: session manager creation with fallback to defaults
t.errorRecoveryManager = NewErrorRecoveryManager(t.logger)
// Initialize token resilience manager with default configuration
@@ -303,11 +304,11 @@ func NewWithContext(ctx context.Context, config *Config, next http.Handler, name
t.initializeMetadata(config.ProviderURL)
}()
// Setup cleanup hook for when context is cancelled
// Setup cleanup hook for when context is canceled
if pluginCtx != nil {
go func() {
<-pluginCtx.Done()
t.Close()
_ = t.Close() // Safe to ignore: cleanup on context cancellation
}()
}
@@ -424,7 +425,7 @@ func (t *TraefikOidc) startMetadataRefresh(providerURL string) {
// Start the task if not already running
if !rm.IsTaskRunning(taskName) {
rm.StartBackgroundTask(taskName)
_ = rm.StartBackgroundTask(taskName) // Safe to ignore: task registration succeeded, start is best-effort
t.logger.Debug("Started singleton metadata refresh task")
} else {
t.logger.Debug("Metadata refresh task already running, skipping duplicate")