mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-15 04:18:03 +00:00
review fixes apr 2026 (#130)
* Multiple fixes - refresh coordinator dedup + memory pressure wire - middleware sse consolidation + timer leak + claim cache - universal cache sync backfill + isDebug gate - lazy background task race - memory monitor stw cached + refresh() api * fix(auth): suppress OIDC redirects on non-navigation requests - [x] Add isNonNavigationRequest using Sec-Fetch-Mode and Accept headers - [x] Add comprehensive TestIsNonNavigationRequest - [x] Update ServeHTTP to 401 non-navigation and AJAX requests Fixes #129 * feat(config): add custom CA and insecure skip verify for OIDC TLS - [x] Add CACertPath, CACertPEM, InsecureSkipVerify to Config - [x] Implement loadCACertPool for CA bundle loading - [x] Update HTTPClientConfig with RootCAs and InsecureSkipVerify - [x] Apply CA pool and skip verify to pooled HTTP clients - [x] Enhance configKey to distinguish TLS configs - [x] Add comprehensive ca_cert_test.go Fixes #125 * feat(oidc): add custom CA certificate support for private OIDC providers - [x] Add caCertPath, caCertPEM, insecureSkipVerify config options - [x] Update traefik.yml with new OIDC client config fields - [x] Add configuration schema descriptions for new options - [x] Update README table and add Custom CA Certificates section * Fix the documentation. * test(redis): add oversized argument rejection test - [x] Add TestRedisConn_RejectOversizedArgumentBytes - [x] Import strings package * Dependencies cleanup
This commit is contained in:
+13
-6
@@ -548,17 +548,24 @@ func (gc *GenericCache) Delete(key string) {
|
||||
delete(gc.data, key)
|
||||
}
|
||||
|
||||
// cleanupRoutine periodically cleans up the cache
|
||||
// cleanupRoutine periodically wipes the cache.
|
||||
//
|
||||
// NOTE: GenericCache does not track per-entry timestamps, so this is a
|
||||
// "clear-all on tick" strategy — every `gc.ttl` interval the entire map
|
||||
// is replaced, regardless of when each entry was written. This is the
|
||||
// intentional (simplified) behavior of GenericCache, which exists mainly
|
||||
// as a generic fallback for tests and non-typed caches. Callers that
|
||||
// require true per-entry TTL must use UniversalCache / UnifiedCache which
|
||||
// track expiry per entry.
|
||||
func (gc *GenericCache) cleanupRoutine() {
|
||||
ticker := time.NewTicker(gc.ttl)
|
||||
defer ticker.Stop()
|
||||
wipeTicker := time.NewTicker(gc.ttl)
|
||||
defer wipeTicker.Stop()
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
case <-wipeTicker.C:
|
||||
gc.mu.Lock()
|
||||
// Simple cleanup - clear all data after TTL
|
||||
// In production, you'd track individual entry TTLs
|
||||
// Clear-all on tick, not per-entry TTL (see function doc).
|
||||
gc.data = make(map[string]interface{})
|
||||
gc.mu.Unlock()
|
||||
case <-gc.stopChan:
|
||||
|
||||
Reference in New Issue
Block a user