Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFromConfig ¶
func NewFromConfig(rawCfg *yaml.Node) (core.Authenticator, error)
NewFromConfig creates a BasicAuthenticator from a raw YAML config node.
Types ¶
type BasicAuthenticator ¶
type BasicAuthenticator struct {
// contains filtered or unexported fields
}
BasicAuthenticator implements Basic Auth (username:password in base64).
func NewBasicAuthenticator ¶
func NewBasicAuthenticator(credentialStore CredentialStore) *BasicAuthenticator
NewBasicAuthenticator creates a new BasicAuthenticator.
func (*BasicAuthenticator) Authenticate ¶
func (m *BasicAuthenticator) Authenticate( ctx context.Context, credential core.Credential, reqInfo *core.RequestInfo, ) (*core.AuthInfo, error)
Authenticate validates the Basic Auth token.
func (*BasicAuthenticator) Name ¶
func (m *BasicAuthenticator) Name() string
Name returns the authenticator name.
func (*BasicAuthenticator) Supports ¶ added in v0.1.0
func (m *BasicAuthenticator) Supports(credential core.Credential) bool
Supports checks if the credential carries a Basic Auth token.
type Config ¶
type Config struct {
// CredentialsPath is the path to the basic_auth.yaml file.
CredentialsPath string `yaml:"credentials_path"`
}
Config configures Basic Authentication.
type CredentialStore ¶
CredentialStore provides access to credentials for authentication.
type FileCredentialStore ¶
type FileCredentialStore struct {
// contains filtered or unexported fields
}
FileCredentialStore loads credentials from a YAML file.
func NewFileCredentialStore ¶
func NewFileCredentialStore(path string) (*FileCredentialStore, error)
NewFileCredentialStore creates a new FileCredentialStore.
func (*FileCredentialStore) VerifyCredentials ¶
func (m *FileCredentialStore) VerifyCredentials(username, password string) error
VerifyCredentials checks if the password matches the stored hash.
type PasswordHash ¶
type PasswordHash = string