Documentation
¶
Index ¶
- func Info(cfg *config.AuthConfig) *url.Userinfo
- func List(name string, names ...string) []auth.Authenticator
- func ParseAuther(cfg *config.AutherConfig) auth.Authenticator
- func ParseAutherFromAuth(au *config.AuthConfig) auth.Authenticator
- func ParseAutherWithError(cfg *config.AutherConfig) (auth.Authenticator, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Info ¶
func Info(cfg *config.AuthConfig) *url.Userinfo
Info extracts authentication credentials from an AuthConfig as a url.Userinfo. It supports reading the first line from a password file when cfg.File is set, or falls back to inline username/password fields.
func List ¶
func List(name string, names ...string) []auth.Authenticator
List resolves one or more authenticator names from the registry. It returns only the authenticators that were found, skipping any that are not registered.
func ParseAuther ¶
func ParseAuther(cfg *config.AutherConfig) auth.Authenticator
ParseAuther converts an AutherConfig into an auth.Authenticator. It handles plugin backends (HTTP or gRPC), inline auth credentials, and optional file, Redis, and HTTP hot-reload sources.
A configuration error, e.g. an unsupported auth file format, is logged and the affected loader is skipped. Use ParseAutherWithError to get the error instead.
func ParseAutherFromAuth ¶
func ParseAutherFromAuth(au *config.AuthConfig) auth.Authenticator
ParseAutherFromAuth creates a simple authenticator from a single username/password pair in an AuthConfig. Returns nil if the config is nil or has no username.
func ParseAutherWithError ¶ added in v0.28.1
func ParseAutherWithError(cfg *config.AutherConfig) (auth.Authenticator, error)
ParseAutherWithError is like ParseAuther but reports a configuration error, e.g. an unsupported auth file format. An invalid format is a configuration error: it is reported instead of being silently ignored, because silently ignoring it would leave the auther without credentials.
Types ¶
This section is empty.