Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuthMiddleware ¶
func BasicAuthMiddleware() gin.HandlerFunc
BasicAuthMiddleware implements HTTP Basic authentication for system credentials
func LastInvalidatedAt ¶
LastInvalidatedAt returns the most recent invalidation time for the given system_key, or the zero time if none was ever recorded.
func StartAuthInvalidator ¶
StartAuthInvalidator subscribes to the cross-service auth invalidation channel and purges every cached credential entry for a system as soon as backend signals the change. Without this hook the cache naturally expires within SystemAuthCacheTTL (default 10 minutes); the bus makes the propagation sub-second.
The subscriber runs in its own goroutine and stops when ctx is done. A Redis outage logs a warning and disables the bus — natural TTL expiration still catches up with the change eventually.
func WebhookAuthMiddleware ¶
func WebhookAuthMiddleware() gin.HandlerFunc
WebhookAuthMiddleware validates the Bearer token in the Authorization header against ALERTING_HISTORY_WEBHOOK_SECRET. If the secret is not configured, the endpoint rejects all requests to prevent accidental open access.
Types ¶
This section is empty.