auth

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2025 License: Apache-2.0 Imports: 4 Imported by: 7

Documentation

Index

Constants

View Source
const (
	Version = "v1.0.5"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateAuthenticator

type CertificateAuthenticator interface {
	// VerifyCertificate verifies the client certificate.
	VerifyCertificate(conn tls.Conn) (bool, error)
}

CertificateAuthenticator is the interface for authenticating a client using TLS certificates.

func NewCertificateAuthenticator added in v1.0.0

func NewCertificateAuthenticator(opts ...CertificateAuthenticatorOption) (CertificateAuthenticator, error)

NewCertificateAuthenticator returns a new certificate authenticator with the options.

type CertificateAuthenticatorOption

type CertificateAuthenticatorOption = func(*certificateAuthenticator) error

CertificateAuthenticatorOption is a function to set the certificate authenticator options.

func WithCommonNameRegexp added in v1.0.0

func WithCommonNameRegexp(regexps ...string) CertificateAuthenticatorOption

WithCertificateAuthenticatorCommonName sets the common name.

type Conn

type Conn = auth.Conn

Conn represents a connection interface.

type Credential added in v1.0.0

type Credential = auth.Credential

Credential represents a credential.

func NewCredential added in v1.0.0

func NewCredential(opts ...CredentialOptionFn) Credential

NewCredential returns a new credential with options.

type CredentialAuthenticator

type CredentialAuthenticator = auth.CredentialAuthenticator

CredentialAuthenticator is the interface for authenticating a client using credential.

type CredentialOptionFn added in v1.0.0

type CredentialOptionFn = auth.CredentialOptionFn

CredentialOptionFn represents an option function for a credential.

func WithCredentialGroup added in v1.0.0

func WithCredentialGroup(group string) CredentialOptionFn

WithCredentialGroup returns an option to set the group.

func WithCredentialPassword added in v1.0.0

func WithCredentialPassword(password string) CredentialOptionFn

WithCredentialPassword returns an option to set the password.

func WithCredentialUsername added in v1.0.0

func WithCredentialUsername(username string) CredentialOptionFn

WithCredentialUsername returns an option to set the username.

type CredentialStore

type CredentialStore = auth.CredentialStore

CredentialAuthenticator is the credential authenticator.

type DefaultCredentialAuthenticator added in v1.0.4

type DefaultCredentialAuthenticator = auth.DefaultCredentialAuthenticator

DefaultCredentialAuthenticator is the default credential authenticator.

func NewCredentialAuthenticator added in v1.0.4

func NewCredentialAuthenticator() DefaultCredentialAuthenticator

NewCredentialAuthenticator returns a new credential authenticator.

type EncryptFunc added in v1.0.3

type EncryptFunc = auth.EncryptFunc

EncryptFunc represents an encrypt function.

type Manager

type Manager interface {
	// Mechanisms returns the mechanisms.
	Mechanisms() []Mechanism
	// Mechanism returns a mechanism by name.
	Mechanism(name string) (Mechanism, error)
	// SetCredentialAuthenticator sets the credential authenticator.
	SetCredentialAuthenticator(auth CredentialAuthenticator)
	// SetCredentialStore sets the credential store.
	SetCredentialStore(store CredentialStore)
	// CredentialStore returns the credential store.
	CredentialStore() CredentialStore
	// VerifyCredential verifies the client credential.
	VerifyCredential(conn Conn, q Query) (bool, error)
	// SetCertificateAuthenticator sets the certificate authenticator.
	SetCertificateAuthenticator(auth CertificateAuthenticator)
	// VerifyCertificate verifies the client certificate.
	VerifyCertificate(conn tls.Conn) (bool, error)
}

func NewManager

func NewManager() Manager

NewManager returns a new manager.

type Mechanism added in v1.0.2

type Mechanism = sasl.Mechanism

Mechanism represents a SASL mechanism.

type Query added in v1.0.0

type Query = auth.Query

Query represents a query.

func NewQuery added in v1.0.0

func NewQuery(opts ...QueryOptionFn) (Query, error)

NewQuery returns a new query with options.

type QueryOption added in v1.0.0

type QueryOption = auth.QueryOption

QueryOption represents an option for a query.

type QueryOptionFn added in v1.0.0

type QueryOptionFn = auth.QueryOptionFn

QueryOptionFn represents an option function for a query.

func WithQueryEncryptFunc added in v1.0.3

func WithQueryEncryptFunc(encryptFunc EncryptFunc) QueryOptionFn

WithQueryEncryptFunc returns an option to set the encrypt function.

func WithQueryGroup added in v1.0.0

func WithQueryGroup(group string) QueryOptionFn

WithQueryGroup returns an option to set the group.

func WithQueryMechanism added in v1.0.0

func WithQueryMechanism(mech string) QueryOptionFn

WithQueryMechanism returns an option to set the mechanism.

func WithQueryOptions added in v1.0.3

func WithQueryOptions(opts ...any) QueryOptionFn

WithQueryOptions returns an option to set the options.

func WithQueryPassword added in v1.0.0

func WithQueryPassword(password string) QueryOptionFn

WithQueryPassword returns an option to set the password.

func WithQueryUsername added in v1.0.0

func WithQueryUsername(username string) QueryOptionFn

WithQueryUsername returns an option to set the username.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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