mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-06-05 22:44:17 +00:00
Cleanup [dec2025] (#101)
* Cleanup excessive comments. * Remove leftovers hanging around from previous refactor * Improve test coverage
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user