Documentation
¶
Index ¶
- Constants
- func New(data map[string]any) (types.Authenticator, error)
- func RegistryEntry() types.RegistryEntry
- type Authenticator
- func (a *Authenticator) AddUser(username, password string) error
- func (a *Authenticator) AddUsersFromMap(users esLookup)
- func (a *Authenticator) Authenticate(r *http.Request) (*types.AuthResult, error)
- func (a *Authenticator) Clone() types.Authenticator
- func (a *Authenticator) ClonePtr() *Authenticator
- func (a *Authenticator) ExtractCredentials(r *http.Request) (string, string, error)
- func (a *Authenticator) IsObserveOnly() bool
- func (a *Authenticator) LoadUsers(path string, ff types.CredentialsFileFormat, replace bool) error
- func (a *Authenticator) LoadUsersFromMap(users esLookup)
- func (a *Authenticator) ProxyPreserve() bool
- func (a *Authenticator) RemoveUser(username string)
- func (a *Authenticator) Sanitize(r *http.Request)
- func (a *Authenticator) SetCredentials(r *http.Request, user, credential string) error
- func (a *Authenticator) SetExtractCredentialsFunc(f types.ExtractCredsFunc)
- func (a *Authenticator) SetObserveOnly(t bool)
- func (a *Authenticator) SetSetCredentialsFunc(f types.SetCredentialsFunc)
Constants ¶
View Source
const ID types.Provider = "basic"
Variables ¶
This section is empty.
Functions ¶
func RegistryEntry ¶
func RegistryEntry() types.RegistryEntry
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
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 (*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)
Click to show internal directories.
Click to hide internal directories.