2019-11-17 01:05:46 +00:00
|
|
|
// Code generated by MockGen. DO NOT EDIT.
|
2019-12-07 17:51:47 +00:00
|
|
|
// Source: internal/storage/provider.go
|
2019-11-17 01:05:46 +00:00
|
|
|
|
|
|
|
// Package storage is a generated GoMock package.
|
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
|
|
|
reflect "reflect"
|
|
|
|
time "time"
|
2020-04-05 12:37:21 +00:00
|
|
|
|
|
|
|
gomock "github.com/golang/mock/gomock"
|
|
|
|
|
2021-08-11 01:04:35 +00:00
|
|
|
models "github.com/authelia/authelia/v4/internal/models"
|
2019-11-17 01:05:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// MockProvider is a mock of Provider interface
|
|
|
|
type MockProvider struct {
|
|
|
|
ctrl *gomock.Controller
|
|
|
|
recorder *MockProviderMockRecorder
|
|
|
|
}
|
|
|
|
|
|
|
|
// MockProviderMockRecorder is the mock recorder for MockProvider
|
|
|
|
type MockProviderMockRecorder struct {
|
|
|
|
mock *MockProvider
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewMockProvider creates a new mock instance
|
|
|
|
func NewMockProvider(ctrl *gomock.Controller) *MockProvider {
|
|
|
|
mock := &MockProvider{ctrl: ctrl}
|
|
|
|
mock.recorder = &MockProviderMockRecorder{mock}
|
|
|
|
return mock
|
|
|
|
}
|
|
|
|
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use
|
|
|
|
func (m *MockProvider) EXPECT() *MockProviderMockRecorder {
|
|
|
|
return m.recorder
|
|
|
|
}
|
|
|
|
|
2020-01-05 23:03:16 +00:00
|
|
|
// LoadPreferred2FAMethod mocks base method
|
|
|
|
func (m *MockProvider) LoadPreferred2FAMethod(username string) (string, error) {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2020-01-05 23:03:16 +00:00
|
|
|
ret := m.ctrl.Call(m, "LoadPreferred2FAMethod", username)
|
2019-12-07 17:51:47 +00:00
|
|
|
ret0, _ := ret[0].(string)
|
|
|
|
ret1, _ := ret[1].(error)
|
|
|
|
return ret0, ret1
|
|
|
|
}
|
|
|
|
|
2020-01-05 23:03:16 +00:00
|
|
|
// LoadPreferred2FAMethod indicates an expected call of LoadPreferred2FAMethod
|
|
|
|
func (mr *MockProviderMockRecorder) LoadPreferred2FAMethod(username interface{}) *gomock.Call {
|
2019-12-07 17:51:47 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2020-01-05 23:03:16 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadPreferred2FAMethod", reflect.TypeOf((*MockProvider)(nil).LoadPreferred2FAMethod), username)
|
2019-12-07 17:51:47 +00:00
|
|
|
}
|
|
|
|
|
2020-01-05 23:03:16 +00:00
|
|
|
// SavePreferred2FAMethod mocks base method
|
|
|
|
func (m *MockProvider) SavePreferred2FAMethod(username, method string) error {
|
2019-12-07 17:51:47 +00:00
|
|
|
m.ctrl.T.Helper()
|
2020-01-05 23:03:16 +00:00
|
|
|
ret := m.ctrl.Call(m, "SavePreferred2FAMethod", username, method)
|
2019-11-17 01:05:46 +00:00
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2020-01-05 23:03:16 +00:00
|
|
|
// SavePreferred2FAMethod indicates an expected call of SavePreferred2FAMethod
|
|
|
|
func (mr *MockProviderMockRecorder) SavePreferred2FAMethod(username, method interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2020-01-05 23:03:16 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SavePreferred2FAMethod", reflect.TypeOf((*MockProvider)(nil).SavePreferred2FAMethod), username, method)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// FindIdentityVerificationToken mocks base method
|
2019-12-07 17:51:47 +00:00
|
|
|
func (m *MockProvider) FindIdentityVerificationToken(token string) (bool, error) {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
ret := m.ctrl.Call(m, "FindIdentityVerificationToken", token)
|
2019-11-17 01:05:46 +00:00
|
|
|
ret0, _ := ret[0].(bool)
|
|
|
|
ret1, _ := ret[1].(error)
|
|
|
|
return ret0, ret1
|
|
|
|
}
|
|
|
|
|
|
|
|
// FindIdentityVerificationToken indicates an expected call of FindIdentityVerificationToken
|
2019-12-07 17:51:47 +00:00
|
|
|
func (mr *MockProviderMockRecorder) FindIdentityVerificationToken(token interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindIdentityVerificationToken", reflect.TypeOf((*MockProvider)(nil).FindIdentityVerificationToken), token)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// SaveIdentityVerificationToken mocks base method
|
|
|
|
func (m *MockProvider) SaveIdentityVerificationToken(token string) error {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
ret := m.ctrl.Call(m, "SaveIdentityVerificationToken", token)
|
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// SaveIdentityVerificationToken indicates an expected call of SaveIdentityVerificationToken
|
|
|
|
func (mr *MockProviderMockRecorder) SaveIdentityVerificationToken(token interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveIdentityVerificationToken", reflect.TypeOf((*MockProvider)(nil).SaveIdentityVerificationToken), token)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// RemoveIdentityVerificationToken mocks base method
|
|
|
|
func (m *MockProvider) RemoveIdentityVerificationToken(token string) error {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
ret := m.ctrl.Call(m, "RemoveIdentityVerificationToken", token)
|
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// RemoveIdentityVerificationToken indicates an expected call of RemoveIdentityVerificationToken
|
|
|
|
func (mr *MockProviderMockRecorder) RemoveIdentityVerificationToken(token interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveIdentityVerificationToken", reflect.TypeOf((*MockProvider)(nil).RemoveIdentityVerificationToken), token)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// SaveTOTPSecret mocks base method
|
|
|
|
func (m *MockProvider) SaveTOTPSecret(username, secret string) error {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
ret := m.ctrl.Call(m, "SaveTOTPSecret", username, secret)
|
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// SaveTOTPSecret indicates an expected call of SaveTOTPSecret
|
|
|
|
func (mr *MockProviderMockRecorder) SaveTOTPSecret(username, secret interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveTOTPSecret", reflect.TypeOf((*MockProvider)(nil).SaveTOTPSecret), username, secret)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// LoadTOTPSecret mocks base method
|
|
|
|
func (m *MockProvider) LoadTOTPSecret(username string) (string, error) {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
ret := m.ctrl.Call(m, "LoadTOTPSecret", username)
|
|
|
|
ret0, _ := ret[0].(string)
|
|
|
|
ret1, _ := ret[1].(error)
|
|
|
|
return ret0, ret1
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// LoadTOTPSecret indicates an expected call of LoadTOTPSecret
|
|
|
|
func (mr *MockProviderMockRecorder) LoadTOTPSecret(username interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadTOTPSecret", reflect.TypeOf((*MockProvider)(nil).LoadTOTPSecret), username)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// DeleteTOTPSecret mocks base method
|
|
|
|
func (m *MockProvider) DeleteTOTPSecret(username string) error {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
ret := m.ctrl.Call(m, "DeleteTOTPSecret", username)
|
2019-11-17 01:05:46 +00:00
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// DeleteTOTPSecret indicates an expected call of DeleteTOTPSecret
|
|
|
|
func (mr *MockProviderMockRecorder) DeleteTOTPSecret(username interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTOTPSecret", reflect.TypeOf((*MockProvider)(nil).DeleteTOTPSecret), username)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// SaveU2FDeviceHandle mocks base method
|
|
|
|
func (m *MockProvider) SaveU2FDeviceHandle(username string, keyHandle, publicKey []byte) error {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
ret := m.ctrl.Call(m, "SaveU2FDeviceHandle", username, keyHandle, publicKey)
|
2019-11-17 01:05:46 +00:00
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// SaveU2FDeviceHandle indicates an expected call of SaveU2FDeviceHandle
|
|
|
|
func (mr *MockProviderMockRecorder) SaveU2FDeviceHandle(username, keyHandle, publicKey interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveU2FDeviceHandle", reflect.TypeOf((*MockProvider)(nil).SaveU2FDeviceHandle), username, keyHandle, publicKey)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// LoadU2FDeviceHandle mocks base method
|
|
|
|
func (m *MockProvider) LoadU2FDeviceHandle(username string) ([]byte, []byte, error) {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
ret := m.ctrl.Call(m, "LoadU2FDeviceHandle", username)
|
|
|
|
ret0, _ := ret[0].([]byte)
|
|
|
|
ret1, _ := ret[1].([]byte)
|
|
|
|
ret2, _ := ret[2].(error)
|
|
|
|
return ret0, ret1, ret2
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// LoadU2FDeviceHandle indicates an expected call of LoadU2FDeviceHandle
|
|
|
|
func (mr *MockProviderMockRecorder) LoadU2FDeviceHandle(username interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadU2FDeviceHandle", reflect.TypeOf((*MockProvider)(nil).LoadU2FDeviceHandle), username)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// AppendAuthenticationLog mocks base method
|
|
|
|
func (m *MockProvider) AppendAuthenticationLog(attempt models.AuthenticationAttempt) error {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
ret := m.ctrl.Call(m, "AppendAuthenticationLog", attempt)
|
2019-11-17 01:05:46 +00:00
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// AppendAuthenticationLog indicates an expected call of AppendAuthenticationLog
|
|
|
|
func (mr *MockProviderMockRecorder) AppendAuthenticationLog(attempt interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendAuthenticationLog", reflect.TypeOf((*MockProvider)(nil).AppendAuthenticationLog), attempt)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// LoadLatestAuthenticationLogs mocks base method
|
|
|
|
func (m *MockProvider) LoadLatestAuthenticationLogs(username string, fromDate time.Time) ([]models.AuthenticationAttempt, error) {
|
2019-11-17 01:05:46 +00:00
|
|
|
m.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
ret := m.ctrl.Call(m, "LoadLatestAuthenticationLogs", username, fromDate)
|
|
|
|
ret0, _ := ret[0].([]models.AuthenticationAttempt)
|
|
|
|
ret1, _ := ret[1].(error)
|
|
|
|
return ret0, ret1
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-07 17:51:47 +00:00
|
|
|
// LoadLatestAuthenticationLogs indicates an expected call of LoadLatestAuthenticationLogs
|
|
|
|
func (mr *MockProviderMockRecorder) LoadLatestAuthenticationLogs(username, fromDate interface{}) *gomock.Call {
|
2019-11-17 01:05:46 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2019-12-07 17:51:47 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadLatestAuthenticationLogs", reflect.TypeOf((*MockProvider)(nil).LoadLatestAuthenticationLogs), username, fromDate)
|
2019-11-17 01:05:46 +00:00
|
|
|
}
|