local

package
v1.4.32 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

Authenticator represents database connector.

func NewAuthenticator

func NewAuthenticator() *Authenticator

NewAuthenticator returns an instance of Authenticator.

func (*Authenticator) AddMfaToken added in v1.3.4

func (sa *Authenticator) AddMfaToken(r *requests.Request) error

AddMfaToken adds MFA token to a user.

func (*Authenticator) AddPublicKey added in v1.3.3

func (sa *Authenticator) AddPublicKey(r *requests.Request) error

AddPublicKey adds public key, e.g. GPG or SSH, for a user.

func (*Authenticator) AddUser added in v1.4.7

func (sa *Authenticator) AddUser(r *requests.Request) error

AddUser adds a user to database.

func (*Authenticator) AuthenticateUser

func (sa *Authenticator) AuthenticateUser(r *requests.Request) error

AuthenticateUser checks the database for the presence of a username/email and password and returns user claims.

func (*Authenticator) ChangePassword added in v1.2.9

func (sa *Authenticator) ChangePassword(r *requests.Request) error

ChangePassword changes password for a user.

func (*Authenticator) Configure

func (sa *Authenticator) Configure(fp string) error

Configure check database connectivity and required tables.

func (*Authenticator) DeleteMfaToken added in v1.3.4

func (sa *Authenticator) DeleteMfaToken(r *requests.Request) error

DeleteMfaToken removes MFA token associated with the user.

func (*Authenticator) DeletePublicKey added in v1.3.3

func (sa *Authenticator) DeletePublicKey(r *requests.Request) error

DeletePublicKey removes a public key, e.g. GPG or SSH, associated with the user.

func (*Authenticator) DeleteUser added in v1.4.7

func (sa *Authenticator) DeleteUser(r *requests.Request) error

DeleteUser delete a specific user from database.

func (*Authenticator) GetMfaTokens added in v1.3.4

func (sa *Authenticator) GetMfaTokens(r *requests.Request) error

GetMfaTokens returns a list of MFA token associated with a user.

func (*Authenticator) GetPublicKeys added in v1.3.3

func (sa *Authenticator) GetPublicKeys(r *requests.Request) error

GetPublicKeys returns a list of public keys associated with a user.

func (*Authenticator) GetUser added in v1.4.7

func (sa *Authenticator) GetUser(r *requests.Request) error

GetUser retrieves a specific user from database.

func (*Authenticator) GetUsers added in v1.4.7

func (sa *Authenticator) GetUsers(r *requests.Request) error

GetUsers retrieves users from database.

func (*Authenticator) IdentifyUser added in v1.4.32

func (sa *Authenticator) IdentifyUser(r *requests.Request) error

IdentifyUser returns user challenges.

type Backend

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

Backend represents authentication provider with local backend.

func NewDatabaseBackend

func NewDatabaseBackend(cfg *Config, logger *zap.Logger) *Backend

NewDatabaseBackend return an instance of authentication provider with local backend.

func (*Backend) Authenticate

func (b *Backend) Authenticate(r *requests.Request) error

Authenticate performs authentication.

func (*Backend) Configure added in v1.4.7

func (b *Backend) Configure() error

Configure configures Backend.

func (*Backend) GetConfig added in v1.4.7

func (b *Backend) GetConfig() string

GetConfig returns Backend configuration.

func (*Backend) GetMethod added in v1.1.3

func (b *Backend) GetMethod() string

GetMethod returns the authentication method associated with this backend.

func (*Backend) GetName added in v1.1.2

func (b *Backend) GetName() string

GetName return the name associated with this backend.

func (*Backend) GetRealm

func (b *Backend) GetRealm() string

GetRealm return authentication realm.

func (*Backend) Request added in v1.4.7

func (b *Backend) Request(op operator.Type, r *requests.Request) error

Request performs the requested backend operation.

func (*Backend) Validate

func (b *Backend) Validate() error

Validate checks whether Backend is functional.

type Config added in v1.4.7

type Config struct {
	Name   string `json:"name,omitempty"`
	Method string `json:"method,omitempty"`
	Realm  string `json:"realm,omitempty"`
	Path   string `json:"path,omitempty"`
}

Config holds the configuration for the backend.

Jump to

Keyboard shortcuts

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