Documentation
¶
Index ¶
- Constants
- type CertificateAuthenticator
- type CertificateAuthenticatorOption
- type Conn
- type Credential
- type CredentialAuthenticator
- type CredentialOptionFn
- type CredentialStore
- type DefaultCredentialAuthenticator
- type EncryptFunc
- type Manager
- type Mechanism
- type Query
- type QueryOption
- type QueryOptionFn
- func WithQueryEncryptFunc(encryptFunc EncryptFunc) QueryOptionFn
- func WithQueryGroup(group string) QueryOptionFn
- func WithQueryMechanism(mech string) QueryOptionFn
- func WithQueryOptions(opts ...any) QueryOptionFn
- func WithQueryPassword(password string) QueryOptionFn
- func WithQueryUsername(username string) QueryOptionFn
Constants ¶
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 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)
}
type Query ¶ added in v1.0.0
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.