Cleanup [dec2025] (#101)

* Cleanup excessive comments.

* Remove leftovers hanging around from previous refactor

* Improve test coverage
This commit is contained in:
2025-12-09 01:38:02 +00:00
committed by GitHub
parent 9126c74723
commit c474bbafd6
172 changed files with 25141 additions and 52206 deletions
-16
View File
@@ -12,10 +12,6 @@ import (
"time"
)
// =============================================================================
// LOGGING UTILITIES
// =============================================================================
// safeLogDebug provides nil-safe logging for debug messages
func (t *TraefikOidc) safeLogDebug(msg string) {
if t.logger != nil {
@@ -51,10 +47,6 @@ func (t *TraefikOidc) safeLogInfo(msg string) {
}
}
// =============================================================================
// DOMAIN VALIDATION
// =============================================================================
// isAllowedUser checks if a user identifier is authorized based on the configured user identifier claim.
// When using email as the identifier (default), it validates against allowedUsers and allowedUserDomains.
// When using non-email identifiers (sub, oid, upn, etc.), it only validates against allowedUsers
@@ -161,10 +153,6 @@ func keysFromMap(m map[string]struct{}) []string {
return keys
}
// =============================================================================
// ERROR HANDLING
// =============================================================================
// sendErrorResponse sends an appropriate error response based on the request's Accept header.
// It sends JSON responses for clients that accept JSON, otherwise sends HTML error pages.
// Parameters:
@@ -220,10 +208,6 @@ func (t *TraefikOidc) sendErrorResponse(rw http.ResponseWriter, req *http.Reques
_, _ = rw.Write([]byte(htmlBody)) // Safe to ignore: error response write
}
// =============================================================================
// CLEANUP
// =============================================================================
// Close gracefully shuts down the TraefikOidc middleware instance.
// It cancels contexts, stops background goroutines, closes HTTP connections,
// cleans up caches, and releases all resources. Safe to call multiple times.