basic

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 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 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

type CredentialStore interface {
	VerifyCredentials(username, password string) error
}

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

type UserName

type UserName = string

Jump to

Keyboard shortcuts

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