Documentation ¶
Index ¶
Constants ¶
const (
// AuthenticatorTypePlainString represents an authenticator type of plain.
AuthenticatorTypePlainString = "plain"
)
Variables ¶
var ( ErrInvalid = errors.New("invalid") ErrAuthentication = errors.New("authentication failed") )
Functions ¶
func NewErrInvalidUserPassword ¶
func NewErrInvalidUserPassword() error
NewErrInvalidUserPassword returns an error for invalid username or password.
Types ¶
type AuthManager ¶
AuthManager represent an authenticator manager.
func NewAuthManager ¶
func NewAuthManager() AuthManager
NewAuthManager returns a new authenticator manager.
type AuthenticatorType ¶
type AuthenticatorType int
AuthenticatorType represents an authenticator type.
const ( // AuthenticatorTypeNone represents an authenticator type of none. AuthenticatorTypeNone AuthenticatorType = iota // AuthenticatorTypePlain represents an authenticator type of plain. AuthenticatorTypePlain )
func NewAuthenticatorTypeFrom ¶
func NewAuthenticatorTypeFrom(str string) (AuthenticatorType, error)
NewAuthenticatorTypeFrom returns an authenticator type from the specified string.
func (AuthenticatorType) String ¶
func (t AuthenticatorType) String() string
String returns a string representation of the authenticator type.
type CertificateAuthenticator ¶ added in v1.3.5
type CertificateAuthenticator = auth.CertificateAuthenticator
CertificateAuthenticator represent a certificate authenticator.
type Credential ¶ added in v1.3.5
type Credential = auth.Credential
Credential represents a credential.
func NewCredential ¶ added in v1.3.5
func NewCredential(opts ...CredentialOptionFn) Credential
NewCredential returns a new credential with options.
type CredentialAuthenticator ¶ added in v1.3.5
type CredentialAuthenticator = auth.CredentialAuthenticator
CredentialAuthenticator represent a credential authenticator.
type CredentialOptionFn ¶ added in v1.3.5
type CredentialOptionFn = auth.CredentialOptionFn
CredentialOptionFn represents an option function for a credential.
func WithCredentialGroup ¶ added in v1.3.5
func WithCredentialGroup(group string) CredentialOptionFn
WithCredentialGroup returns an option to set the group.
func WithCredentialPassword ¶ added in v1.3.5
func WithCredentialPassword(password string) CredentialOptionFn
WithCredentialPassword returns an option to set the password.
func WithCredentialUsername ¶ added in v1.3.5
func WithCredentialUsername(username string) CredentialOptionFn
WithCredentialUsername returns an option to set the username.
type CredentialStore ¶ added in v1.3.5
type CredentialStore = auth.CredentialStore
CredentialStore represent a credential store.
type PlainConfig ¶ added in v1.3.5
type PlainConfig struct { Enabled bool `mapstructure:"enabled"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` }
PlainConfig represents a plain configuration for authenticator.
func NewPlainConfigFrom ¶ added in v1.3.5
func NewPlainConfigFrom(config config.Config, path ...string) ([]PlainConfig, error)
NewPlainConfigFrom returns a new plain authenticator configuration from the specified configuration.
type Query ¶ added in v1.3.5
Query represents a query.
func NewQuery ¶ added in v1.3.5
func NewQuery(opts ...QueryOptionFn) Query
NewQuery returns a new query with options.
type QueryOption ¶ added in v1.3.5
type QueryOption = auth.QueryOption
QueryOption represents an option for a query.
type QueryOptionFn ¶ added in v1.3.5
type QueryOptionFn = auth.QueryOptionFn
QueryOptionFn represents an option function for a query.
func WithQueryGroup ¶ added in v1.3.5
func WithQueryGroup(group string) QueryOptionFn
WithQueryGroup returns an option to set the group.
func WithQueryMechanism ¶ added in v1.3.5
func WithQueryMechanism(mech string) QueryOptionFn
WithQueryMechanism returns an option to set the mechanism.
func WithQueryPassword ¶ added in v1.3.5
func WithQueryPassword(password string) QueryOptionFn
WithQueryPassword returns an option to set the password.
func WithQueryUsername ¶ added in v1.3.5
func WithQueryUsername(username string) QueryOptionFn
WithQueryUsername returns an option to set the username.