basic

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ID types.Provider = "basic"

Variables

This section is empty.

Functions

func New

func New(data map[string]any) (types.Authenticator, error)

func RegistryEntry

func RegistryEntry() types.RegistryEntry

Types

type Authenticator

type Authenticator struct {
	// contains filtered or unexported fields
}

func NewPtr

func NewPtr(data map[string]any) (*Authenticator, error)

func (*Authenticator) AddUser

func (a *Authenticator) AddUser(username, password string) error

AddUser adds a new user to the users list

func (*Authenticator) AddUsersFromMap

func (a *Authenticator) AddUsersFromMap(users esLookup)

AddUsersFromMap merges in users from a map[string]any

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(r *http.Request) (*types.AuthResult, error)

Authenticate checks the BasicAuth credentials

func (*Authenticator) Clone

func (a *Authenticator) Clone() types.Authenticator

Clone clones a new Authenticator (i) from a

func (*Authenticator) ClonePtr

func (a *Authenticator) ClonePtr() *Authenticator

Clone returns a new, completely independent clone of the Authenticator

func (*Authenticator) ExtractCredentials

func (a *Authenticator) ExtractCredentials(r *http.Request) (
	string, string, error,
)

func (*Authenticator) IsObserveOnly

func (a *Authenticator) IsObserveOnly() bool

func (*Authenticator) LoadUsers

func (a *Authenticator) LoadUsers(
	path string, ff types.CredentialsFileFormat, replace bool,
) error

LoadUsers resets the users list, then loads from the htpasswd-formatted file

func (*Authenticator) LoadUsersFromMap

func (a *Authenticator) LoadUsersFromMap(users esLookup)

LoadUsersFromMap resets the users list, then loads from a map[string]any via AddUsersFromMap

func (*Authenticator) ProxyPreserve

func (a *Authenticator) ProxyPreserve() bool

func (*Authenticator) RemoveUser

func (a *Authenticator) RemoveUser(username string)

RemoveUser removes a user from the users list

func (*Authenticator) Sanitize

func (a *Authenticator) Sanitize(r *http.Request)

func (*Authenticator) SetCredentials

func (a *Authenticator) SetCredentials(
	r *http.Request, user, credential string,
) error

func (*Authenticator) SetExtractCredentialsFunc

func (a *Authenticator) SetExtractCredentialsFunc(f types.ExtractCredsFunc)

func (*Authenticator) SetObserveOnly

func (a *Authenticator) SetObserveOnly(t bool)

func (*Authenticator) SetSetCredentialsFunc

func (a *Authenticator) SetSetCredentialsFunc(f types.SetCredentialsFunc)

Jump to

Keyboard shortcuts

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