Documentation ¶
Overview ¶
Package authcache implements a cache for token auth to hold auth- results with cpu/mem inexpensive methods instead of always using secure but expensive methods to validate the token
Index ¶
Constants ¶
This section is empty.
Variables ¶
ErrUnauthorized denotes the token could not be found in any backend auth method and therefore is not an user
Functions ¶
This section is empty.
Types ¶
type AuthFunc ¶
AuthFunc is a backend-function to resolve a token to a list of modules the token is authorized for, an expiry-time and an error. The error MUST be ErrUnauthorized in case the user is not found, if the error is another, the backend resolve will be cancelled and no further backends are queried.
type CacheEntry ¶
type CacheEntry struct { AuthResult error // Allows for negative caching ExpiresAt time.Time Modules []string }
CacheEntry represents an entry in the cache Service
Click to show internal directories.
Click to hide internal directories.