storage

package
v4.30.5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package storage is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoU2FDeviceHandle error thrown when no U2F device handle has been found in DB.
	ErrNoU2FDeviceHandle = errors.New("no U2F device handle found")

	// ErrNoTOTPSecret error thrown when no TOTP secret has been found in DB.
	ErrNoTOTPSecret = errors.New("no TOTP secret registered")
)

Functions

This section is empty.

Types

type MockProvider

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

MockProvider is a mock of Provider interface

func NewMockProvider

func NewMockProvider(ctrl *gomock.Controller) *MockProvider

NewMockProvider creates a new mock instance

func (*MockProvider) AppendAuthenticationLog

func (m *MockProvider) AppendAuthenticationLog(attempt models.AuthenticationAttempt) error

AppendAuthenticationLog mocks base method

func (*MockProvider) DeleteTOTPSecret

func (m *MockProvider) DeleteTOTPSecret(username string) error

DeleteTOTPSecret mocks base method

func (*MockProvider) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockProvider) FindIdentityVerificationToken

func (m *MockProvider) FindIdentityVerificationToken(token string) (bool, error)

FindIdentityVerificationToken mocks base method

func (*MockProvider) LoadLatestAuthenticationLogs

func (m *MockProvider) LoadLatestAuthenticationLogs(username string, fromDate time.Time) ([]models.AuthenticationAttempt, error)

LoadLatestAuthenticationLogs mocks base method

func (*MockProvider) LoadPreferred2FAMethod

func (m *MockProvider) LoadPreferred2FAMethod(username string) (string, error)

LoadPreferred2FAMethod mocks base method

func (*MockProvider) LoadTOTPSecret

func (m *MockProvider) LoadTOTPSecret(username string) (string, error)

LoadTOTPSecret mocks base method

func (*MockProvider) LoadU2FDeviceHandle

func (m *MockProvider) LoadU2FDeviceHandle(username string) ([]byte, []byte, error)

LoadU2FDeviceHandle mocks base method

func (*MockProvider) RemoveIdentityVerificationToken

func (m *MockProvider) RemoveIdentityVerificationToken(token string) error

RemoveIdentityVerificationToken mocks base method

func (*MockProvider) SaveIdentityVerificationToken

func (m *MockProvider) SaveIdentityVerificationToken(token string) error

SaveIdentityVerificationToken mocks base method

func (*MockProvider) SavePreferred2FAMethod

func (m *MockProvider) SavePreferred2FAMethod(username, method string) error

SavePreferred2FAMethod mocks base method

func (*MockProvider) SaveTOTPSecret

func (m *MockProvider) SaveTOTPSecret(username, secret string) error

SaveTOTPSecret mocks base method

func (*MockProvider) SaveU2FDeviceHandle

func (m *MockProvider) SaveU2FDeviceHandle(username string, keyHandle, publicKey []byte) error

SaveU2FDeviceHandle mocks base method

type MockProviderMockRecorder

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

MockProviderMockRecorder is the mock recorder for MockProvider

func (*MockProviderMockRecorder) AppendAuthenticationLog

func (mr *MockProviderMockRecorder) AppendAuthenticationLog(attempt interface{}) *gomock.Call

AppendAuthenticationLog indicates an expected call of AppendAuthenticationLog

func (*MockProviderMockRecorder) DeleteTOTPSecret

func (mr *MockProviderMockRecorder) DeleteTOTPSecret(username interface{}) *gomock.Call

DeleteTOTPSecret indicates an expected call of DeleteTOTPSecret

func (*MockProviderMockRecorder) FindIdentityVerificationToken

func (mr *MockProviderMockRecorder) FindIdentityVerificationToken(token interface{}) *gomock.Call

FindIdentityVerificationToken indicates an expected call of FindIdentityVerificationToken

func (*MockProviderMockRecorder) LoadLatestAuthenticationLogs

func (mr *MockProviderMockRecorder) LoadLatestAuthenticationLogs(username, fromDate interface{}) *gomock.Call

LoadLatestAuthenticationLogs indicates an expected call of LoadLatestAuthenticationLogs

func (*MockProviderMockRecorder) LoadPreferred2FAMethod

func (mr *MockProviderMockRecorder) LoadPreferred2FAMethod(username interface{}) *gomock.Call

LoadPreferred2FAMethod indicates an expected call of LoadPreferred2FAMethod

func (*MockProviderMockRecorder) LoadTOTPSecret

func (mr *MockProviderMockRecorder) LoadTOTPSecret(username interface{}) *gomock.Call

LoadTOTPSecret indicates an expected call of LoadTOTPSecret

func (*MockProviderMockRecorder) LoadU2FDeviceHandle

func (mr *MockProviderMockRecorder) LoadU2FDeviceHandle(username interface{}) *gomock.Call

LoadU2FDeviceHandle indicates an expected call of LoadU2FDeviceHandle

func (*MockProviderMockRecorder) RemoveIdentityVerificationToken

func (mr *MockProviderMockRecorder) RemoveIdentityVerificationToken(token interface{}) *gomock.Call

RemoveIdentityVerificationToken indicates an expected call of RemoveIdentityVerificationToken

func (*MockProviderMockRecorder) SaveIdentityVerificationToken

func (mr *MockProviderMockRecorder) SaveIdentityVerificationToken(token interface{}) *gomock.Call

SaveIdentityVerificationToken indicates an expected call of SaveIdentityVerificationToken

func (*MockProviderMockRecorder) SavePreferred2FAMethod

func (mr *MockProviderMockRecorder) SavePreferred2FAMethod(username, method interface{}) *gomock.Call

SavePreferred2FAMethod indicates an expected call of SavePreferred2FAMethod

func (*MockProviderMockRecorder) SaveTOTPSecret

func (mr *MockProviderMockRecorder) SaveTOTPSecret(username, secret interface{}) *gomock.Call

SaveTOTPSecret indicates an expected call of SaveTOTPSecret

func (*MockProviderMockRecorder) SaveU2FDeviceHandle

func (mr *MockProviderMockRecorder) SaveU2FDeviceHandle(username, keyHandle, publicKey interface{}) *gomock.Call

SaveU2FDeviceHandle indicates an expected call of SaveU2FDeviceHandle

type MySQLProvider

type MySQLProvider struct {
	SQLProvider
}

MySQLProvider is a MySQL provider.

func NewMySQLProvider

func NewMySQLProvider(configuration schema.MySQLStorageConfiguration) *MySQLProvider

NewMySQLProvider a MySQL provider.

type PostgreSQLProvider

type PostgreSQLProvider struct {
	SQLProvider
}

PostgreSQLProvider is a PostgreSQL provider.

func NewPostgreSQLProvider

func NewPostgreSQLProvider(configuration schema.PostgreSQLStorageConfiguration) *PostgreSQLProvider

NewPostgreSQLProvider a PostgreSQL provider.

type Provider

type Provider interface {
	LoadPreferred2FAMethod(username string) (string, error)
	SavePreferred2FAMethod(username string, method string) error

	FindIdentityVerificationToken(token string) (bool, error)
	SaveIdentityVerificationToken(token string) error
	RemoveIdentityVerificationToken(token string) error

	SaveTOTPSecret(username string, secret string) error
	LoadTOTPSecret(username string) (string, error)
	DeleteTOTPSecret(username string) error

	SaveU2FDeviceHandle(username string, keyHandle []byte, publicKey []byte) error
	LoadU2FDeviceHandle(username string) (keyHandle []byte, publicKey []byte, err error)

	AppendAuthenticationLog(attempt models.AuthenticationAttempt) error
	LoadLatestAuthenticationLogs(username string, fromDate time.Time) ([]models.AuthenticationAttempt, error)
}

Provider is an interface providing storage capabilities for persisting any kind of data related to Authelia.

type SQLMockProvider

type SQLMockProvider struct {
	SQLProvider
}

SQLMockProvider is a SQLMock provider.

func NewSQLMockProvider

func NewSQLMockProvider() (*SQLMockProvider, sqlmock.Sqlmock)

NewSQLMockProvider constructs a SQLMock provider.

type SQLProvider

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

SQLProvider is a storage provider persisting data in a SQL database.

func (*SQLProvider) AppendAuthenticationLog

func (p *SQLProvider) AppendAuthenticationLog(attempt models.AuthenticationAttempt) error

AppendAuthenticationLog append a mark to the authentication log.

func (*SQLProvider) DeleteTOTPSecret

func (p *SQLProvider) DeleteTOTPSecret(username string) error

DeleteTOTPSecret delete a TOTP secret from the database given a username.

func (*SQLProvider) FindIdentityVerificationToken

func (p *SQLProvider) FindIdentityVerificationToken(token string) (bool, error)

FindIdentityVerificationToken look for an identity verification token in the database.

func (*SQLProvider) LoadLatestAuthenticationLogs

func (p *SQLProvider) LoadLatestAuthenticationLogs(username string, fromDate time.Time) ([]models.AuthenticationAttempt, error)

LoadLatestAuthenticationLogs retrieve the latest marks from the authentication log.

func (*SQLProvider) LoadPreferred2FAMethod

func (p *SQLProvider) LoadPreferred2FAMethod(username string) (string, error)

LoadPreferred2FAMethod load the preferred method for 2FA from the database.

func (*SQLProvider) LoadTOTPSecret

func (p *SQLProvider) LoadTOTPSecret(username string) (string, error)

LoadTOTPSecret load a TOTP secret given a username from the database.

func (*SQLProvider) LoadU2FDeviceHandle

func (p *SQLProvider) LoadU2FDeviceHandle(username string) ([]byte, []byte, error)

LoadU2FDeviceHandle load a U2F device registration blob for a given username.

func (*SQLProvider) RemoveIdentityVerificationToken

func (p *SQLProvider) RemoveIdentityVerificationToken(token string) error

RemoveIdentityVerificationToken remove an identity verification token from the database.

func (*SQLProvider) SaveIdentityVerificationToken

func (p *SQLProvider) SaveIdentityVerificationToken(token string) error

SaveIdentityVerificationToken save an identity verification token in the database.

func (*SQLProvider) SavePreferred2FAMethod

func (p *SQLProvider) SavePreferred2FAMethod(username string, method string) error

SavePreferred2FAMethod save the preferred method for 2FA to the database.

func (*SQLProvider) SaveTOTPSecret

func (p *SQLProvider) SaveTOTPSecret(username string, secret string) error

SaveTOTPSecret save a TOTP secret of a given user in the database.

func (*SQLProvider) SaveU2FDeviceHandle

func (p *SQLProvider) SaveU2FDeviceHandle(username string, keyHandle []byte, publicKey []byte) error

SaveU2FDeviceHandle save a registered U2F device registration blob.

type SQLiteProvider

type SQLiteProvider struct {
	SQLProvider
}

SQLiteProvider is a SQLite3 provider.

func NewSQLiteProvider

func NewSQLiteProvider(path string) *SQLiteProvider

NewSQLiteProvider constructs a SQLite provider.

type SchemaVersion

type SchemaVersion int

SchemaVersion is a simple int representation of the schema version.

func (SchemaVersion) ToString

func (s SchemaVersion) ToString() string

ToString converts the schema version into a string and returns that converted value.

Jump to

Keyboard shortcuts

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