auth

package
v0.28.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL