testscommon

package
v1.0.12-tmp Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewShardedStorageWithIndexMock

func NewShardedStorageWithIndexMock() *shardedStorageWithIndexMock

NewShardedStorageWithIndexMock -

Types

type BucketIDProviderStub

type BucketIDProviderStub struct {
	GetBucketForAddressCalled func(address []byte) uint32
}

func (*BucketIDProviderStub) GetBucketForAddress

func (stub *BucketIDProviderStub) GetBucketForAddress(address []byte) uint32

GetBucketForAddress -

func (*BucketIDProviderStub) IsInterfaceNil

func (stub *BucketIDProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

type BucketIndexHandlerStub

type BucketIndexHandlerStub struct {
	PutCalled                 func(key, data []byte) error
	GetCalled                 func(key []byte) ([]byte, error)
	HasCalled                 func(key []byte) error
	CloseCalled               func() error
	AllocateBucketIndexCalled func() (uint32, error)
	GetLastIndexCalled        func() (uint32, error)
}

BucketIndexHandlerStub -

func (*BucketIndexHandlerStub) AllocateBucketIndex

func (stub *BucketIndexHandlerStub) AllocateBucketIndex() (uint32, error)

AllocateBucketIndex -

func (*BucketIndexHandlerStub) Close

func (stub *BucketIndexHandlerStub) Close() error

Close -

func (*BucketIndexHandlerStub) Get

func (stub *BucketIndexHandlerStub) Get(key []byte) ([]byte, error)

Get -

func (*BucketIndexHandlerStub) GetLastIndex

func (stub *BucketIndexHandlerStub) GetLastIndex() (uint32, error)

GetLastIndex -

func (*BucketIndexHandlerStub) Has

func (stub *BucketIndexHandlerStub) Has(key []byte) error

Has -

func (*BucketIndexHandlerStub) IsInterfaceNil

func (stub *BucketIndexHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*BucketIndexHandlerStub) Put

func (stub *BucketIndexHandlerStub) Put(key, data []byte) error

Put -

type CryptoComponentsHolderFactoryStub

type CryptoComponentsHolderFactoryStub struct {
	CreateCalled func(privateKeyBytes []byte) (core.CryptoComponentsHolder, error)
}

CryptoComponentsHolderFactoryStub -

func (*CryptoComponentsHolderFactoryStub) Create

func (stub *CryptoComponentsHolderFactoryStub) Create(privateKeyBytes []byte) (core.CryptoComponentsHolder, error)

Create -

func (*CryptoComponentsHolderFactoryStub) IsInterfaceNil

func (stub *CryptoComponentsHolderFactoryStub) IsInterfaceNil() bool

IsInterfaceNil -

type EncryptorStub

type EncryptorStub struct {
	EncryptDataCalled func(data []byte) ([]byte, error)
	DecryptDataCalled func(data []byte) ([]byte, error)
}

EncryptorStub is a stub implementation of Encryptor

func (*EncryptorStub) DecryptData

func (es *EncryptorStub) DecryptData(data []byte) ([]byte, error)

DecryptData decrypts the provided data

func (*EncryptorStub) EncryptData

func (es *EncryptorStub) EncryptData(data []byte) ([]byte, error)

EncryptData encrypts the provided data

func (*EncryptorStub) IsInterfaceNil

func (es *EncryptorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type FrozenOtpHandlerStub

type FrozenOtpHandlerStub struct {
	IsVerificationAllowedAndIncreaseTrialsCalled func(account string, ip string) (*requests.OTPCodeVerifyData, error)
	ResetCalled                                  func(account string, ip string)
	BackoffTimeCalled                            func() uint64
	MaxFailuresCalled                            func() uint64
}

FrozenOtpHandlerStub is a stub implementation of the FrozenOtpHandler interface

func (*FrozenOtpHandlerStub) BackOffTime

func (stub *FrozenOtpHandlerStub) BackOffTime() uint64

BackOffTime returns the configured back off time

func (*FrozenOtpHandlerStub) IsInterfaceNil

func (stub *FrozenOtpHandlerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*FrozenOtpHandlerStub) IsVerificationAllowedAndIncreaseTrials

func (stub *FrozenOtpHandlerStub) IsVerificationAllowedAndIncreaseTrials(account string, ip string) (*requests.OTPCodeVerifyData, error)

IsVerificationAllowedAndIncreaseTrials returns true if the verification is allowed for the given account and ip

func (*FrozenOtpHandlerStub) MaxFailures

func (stub *FrozenOtpHandlerStub) MaxFailures() uint64

MaxFailures -

func (*FrozenOtpHandlerStub) Reset

func (stub *FrozenOtpHandlerStub) Reset(account string, ip string)

Reset removes the account and ip from local cache

type GuardedTxBuilderStub

type GuardedTxBuilderStub struct {
	ApplyGuardianSignatureCalled func(cryptoHolderGuardian core.CryptoComponentsHolder, tx *transaction.FrontendTransaction) error
}

GuardedTxBuilderStub -

func (*GuardedTxBuilderStub) ApplyGuardianSignature

func (stub *GuardedTxBuilderStub) ApplyGuardianSignature(cryptoHolderGuardian core.CryptoComponentsHolder, tx *transaction.FrontendTransaction) error

ApplyGuardianSignature -

func (*GuardedTxBuilderStub) IsInterfaceNil

func (stub *GuardedTxBuilderStub) IsInterfaceNil() bool

IsInterfaceNil -

type HttpClientWrapperStub

type HttpClientWrapperStub struct {
	GetAccountCalled      func(ctx context.Context, address string) (*data.Account, error)
	GetGuardianDataCalled func(ctx context.Context, address string) (*api.GuardianData, error)
}

HttpClientWrapperStub -

func (*HttpClientWrapperStub) GetAccount

func (stub *HttpClientWrapperStub) GetAccount(ctx context.Context, address string) (*data.Account, error)

GetAccount -

func (*HttpClientWrapperStub) GetGuardianData

func (stub *HttpClientWrapperStub) GetGuardianData(ctx context.Context, address string) (*api.GuardianData, error)

GetGuardianData -

func (*HttpClientWrapperStub) IsInterfaceNil

func (stub *HttpClientWrapperStub) IsInterfaceNil() bool

IsInterfaceNil -

type KeysGeneratorStub

type KeysGeneratorStub struct {
	GenerateManagedKeyCalled func() (crypto.PrivateKey, error)
	GenerateKeysCalled       func(index uint32) ([]crypto.PrivateKey, error)
}

KeysGeneratorStub -

func (*KeysGeneratorStub) GenerateKeys

func (stub *KeysGeneratorStub) GenerateKeys(index uint32) ([]crypto.PrivateKey, error)

GenerateKeys -

func (*KeysGeneratorStub) GenerateManagedKey

func (stub *KeysGeneratorStub) GenerateManagedKey() (crypto.PrivateKey, error)

GenerateManagedKey -

func (*KeysGeneratorStub) IsInterfaceNil

func (stub *KeysGeneratorStub) IsInterfaceNil() bool

IsInterfaceNil -

type MarshallerStub

type MarshallerStub struct {
	MarshalCalled   func(obj interface{}) ([]byte, error)
	UnmarshalCalled func(obj interface{}, buff []byte) error
}

MarshallerStub -

func (*MarshallerStub) IsInterfaceNil

func (stub *MarshallerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*MarshallerStub) Marshal

func (stub *MarshallerStub) Marshal(obj interface{}) ([]byte, error)

Marshal -

func (*MarshallerStub) Unmarshal

func (stub *MarshallerStub) Unmarshal(obj interface{}, buff []byte) error

Unmarshal -

type MiddlewareStub

type MiddlewareStub struct {
	UserAddress string
}

func (*MiddlewareStub) IsInterfaceNil

func (stub *MiddlewareStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*MiddlewareStub) MiddlewareHandlerFunc

func (stub *MiddlewareStub) MiddlewareHandlerFunc() gin.HandlerFunc

MiddlewareHandlerFunc -

type MongoDBClientStub

type MongoDBClientStub struct {
	PutCalled                  func(coll mongodb.CollectionID, key []byte, data []byte) error
	GetCalled                  func(coll mongodb.CollectionID, key []byte) ([]byte, error)
	HasCalled                  func(coll mongodb.CollectionID, key []byte) error
	RemoveCalled               func(coll mongodb.CollectionID, key []byte) error
	GetIndexCalled             func(collID mongodb.CollectionID, key []byte) (uint32, error)
	IncrementIndexCalled       func(collID mongodb.CollectionID, key []byte) (uint32, error)
	PutIndexIfNotExistsCalled  func(collID mongodb.CollectionID, key []byte, index uint32) error
	GetAllCollectionsIDsCalled func() []mongodb.CollectionID
	CloseCalled                func() error
}

MongoDBClientStub implemented mongodb client wraper interface

func (*MongoDBClientStub) Close

func (m *MongoDBClientStub) Close() error

Close -

func (*MongoDBClientStub) Get

func (m *MongoDBClientStub) Get(coll mongodb.CollectionID, key []byte) ([]byte, error)

Get -

func (*MongoDBClientStub) GetAllCollectionsIDs

func (m *MongoDBClientStub) GetAllCollectionsIDs() []mongodb.CollectionID

GetAllCollectionsIDs -

func (*MongoDBClientStub) GetIndex

func (m *MongoDBClientStub) GetIndex(coll mongodb.CollectionID, key []byte) (uint32, error)

GetIndex -

func (*MongoDBClientStub) Has

func (m *MongoDBClientStub) Has(coll mongodb.CollectionID, key []byte) error

Has -

func (*MongoDBClientStub) IncrementIndex

func (m *MongoDBClientStub) IncrementIndex(coll mongodb.CollectionID, key []byte) (uint32, error)

IncrementIndex -

func (*MongoDBClientStub) IsInterfaceNil

func (m *MongoDBClientStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*MongoDBClientStub) Put

func (m *MongoDBClientStub) Put(coll mongodb.CollectionID, key []byte, data []byte) error

Put -

func (*MongoDBClientStub) PutIndexIfNotExists

func (m *MongoDBClientStub) PutIndexIfNotExists(collID mongodb.CollectionID, key []byte, index uint32) error

PutIndexIfNotExists -

func (*MongoDBClientStub) Remove

func (m *MongoDBClientStub) Remove(coll mongodb.CollectionID, key []byte) error

Remove -

type OTPProviderStub

type OTPProviderStub struct {
	GenerateTOTPCalled  func(account string, hash crypto.Hash) (handlers.OTP, error)
	TOTPFromBytesCalled func(encryptedMessage []byte) (handlers.OTP, error)
}

OTPProviderStub -

func (*OTPProviderStub) GenerateTOTP

func (stub *OTPProviderStub) GenerateTOTP(account string, hash crypto.Hash) (handlers.OTP, error)

GenerateTOTP -

func (*OTPProviderStub) IsInterfaceNil

func (stub *OTPProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*OTPProviderStub) TOTPFromBytes

func (stub *OTPProviderStub) TOTPFromBytes(encryptedMessage []byte) (handlers.OTP, error)

TOTPFromBytes -

type RateLimiterMock

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

RateLimiterMock -

func NewRateLimiterMock

func NewRateLimiterMock(maxFailures int, periodLimit int) *RateLimiterMock

NewRateLimiterMock -

func (*RateLimiterMock) CheckAllowedAndIncreaseTrials

func (r *RateLimiterMock) CheckAllowedAndIncreaseTrials(key string) (*redis.RateLimiterResult, error)

CheckAllowedAndIncreaseTrials -

func (*RateLimiterMock) IsInterfaceNil

func (r *RateLimiterMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*RateLimiterMock) Period

func (r *RateLimiterMock) Period() time.Duration

Period -

func (*RateLimiterMock) Rate

func (r *RateLimiterMock) Rate() int

Rate -

func (*RateLimiterMock) Reset

func (r *RateLimiterMock) Reset(key string) error

Reset -

type RateLimiterStub

type RateLimiterStub struct {
	CheckAllowedAndIncreaseTrialsCalled func(key string) (*redis.RateLimiterResult, error)
	ResetCalled                         func(key string) error
	PeriodCalled                        func() time.Duration
	RateCalled                          func() int
}

RateLimiterStub -

func (*RateLimiterStub) CheckAllowedAndIncreaseTrials

func (r *RateLimiterStub) CheckAllowedAndIncreaseTrials(key string) (*redis.RateLimiterResult, error)

CheckAllowedAndIncreaseTrials -

func (*RateLimiterStub) IsInterfaceNil

func (r *RateLimiterStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RateLimiterStub) Period

func (r *RateLimiterStub) Period() time.Duration

Period -

func (*RateLimiterStub) Rate

func (r *RateLimiterStub) Rate() int

Rate -

func (*RateLimiterStub) Reset

func (r *RateLimiterStub) Reset(key string) error

Reset -

type RedisClientStub

type RedisClientStub struct {
	IncrementCalled              func(ctx context.Context, key string) (int64, error)
	SetExpireCalled              func(ctx context.Context, key string, ttl time.Duration) (bool, error)
	SetExpireIfNotExistsCalled   func(ctx context.Context, key string, ttl time.Duration) (bool, error)
	ResetCounterAndKeepTTLCalled func(ctx context.Context, key string) error
	ExpireTimeCalled             func(ctx context.Context, key string) (time.Duration, error)
	IsConnectedCalled            func(ctx context.Context) bool
}

RedisClientStub -

func (*RedisClientStub) ExpireTime

func (r *RedisClientStub) ExpireTime(ctx context.Context, key string) (time.Duration, error)

ExpireTime -

func (*RedisClientStub) Increment

func (r *RedisClientStub) Increment(ctx context.Context, key string) (int64, error)

Increment -

func (*RedisClientStub) IsConnected

func (r *RedisClientStub) IsConnected(ctx context.Context) bool

IsConnected -

func (*RedisClientStub) IsInterfaceNil

func (r *RedisClientStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RedisClientStub) ResetCounterAndKeepTTL

func (r *RedisClientStub) ResetCounterAndKeepTTL(ctx context.Context, key string) error

ResetCounterAndKeepTTL -

func (*RedisClientStub) SetExpire

func (r *RedisClientStub) SetExpire(ctx context.Context, key string, ttl time.Duration) (bool, error)

SetExpire -

func (*RedisClientStub) SetExpireIfNotExists

func (r *RedisClientStub) SetExpireIfNotExists(ctx context.Context, key string, ttl time.Duration) (bool, error)

SetExpireIfNotExists -

type ServiceResolverStub

type ServiceResolverStub struct {
	GetGuardianAddressCalled       func(userAddress core.AddressHandler) (string, error)
	RegisterUserCalled             func(userAddress core.AddressHandler, request requests.RegistrationPayload) (*requests.OTP, string, error)
	VerifyCodeCalled               func(userAddress core.AddressHandler, userIp string, request requests.VerificationPayload) (*requests.OTPCodeVerifyData, error)
	SignTransactionCalled          func(userIp string, request requests.SignTransaction) ([]byte, *requests.OTPCodeVerifyData, error)
	SignMultipleTransactionsCalled func(userIp string, request requests.SignMultipleTransactions) ([][]byte, *requests.OTPCodeVerifyData, error)
	RegisteredUsersCalled          func() (uint32, error)
	TcsConfigCalled                func() *tcsCore.TcsConfig
}

ServiceResolverStub -

func (*ServiceResolverStub) IsInterfaceNil

func (stub *ServiceResolverStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ServiceResolverStub) RegisterUser

func (stub *ServiceResolverStub) RegisterUser(userAddress core.AddressHandler, request requests.RegistrationPayload) (*requests.OTP, string, error)

RegisterUser -

func (*ServiceResolverStub) RegisteredUsers

func (stub *ServiceResolverStub) RegisteredUsers() (uint32, error)

RegisteredUsers -

func (*ServiceResolverStub) SignMultipleTransactions

func (stub *ServiceResolverStub) SignMultipleTransactions(userIp string, request requests.SignMultipleTransactions) ([][]byte, *requests.OTPCodeVerifyData, error)

SignMultipleTransactions -

func (*ServiceResolverStub) SignTransaction

func (stub *ServiceResolverStub) SignTransaction(userIp string, request requests.SignTransaction) ([]byte, *requests.OTPCodeVerifyData, error)

SignTransaction -

func (*ServiceResolverStub) TcsConfig

func (stub *ServiceResolverStub) TcsConfig() *tcsCore.TcsConfig

TcsConfig returns the current configuration of the TCS

func (*ServiceResolverStub) VerifyCode

func (stub *ServiceResolverStub) VerifyCode(userAddress core.AddressHandler, userIp string, request requests.VerificationPayload) (*requests.OTPCodeVerifyData, error)

VerifyCode -

type ShardedStorageWithIndexStub

type ShardedStorageWithIndexStub struct {
	AllocateIndexCalled       func(address []byte) (uint32, error)
	PutCalled                 func(key, data []byte) error
	GetCalled                 func(key []byte) ([]byte, error)
	HasCalled                 func(key []byte) error
	CloseCalled               func() error
	AllocateBucketIndexCalled func(address []byte) (uint32, error)
	CountCalled               func() (uint32, error)
}

ShardedStorageWithIndexStub -

func (*ShardedStorageWithIndexStub) AllocateBucketIndex

func (stub *ShardedStorageWithIndexStub) AllocateBucketIndex(address []byte) (uint32, error)

AllocateBucketIndex -

func (*ShardedStorageWithIndexStub) AllocateIndex

func (stub *ShardedStorageWithIndexStub) AllocateIndex(address []byte) (uint32, error)

AllocateIndex -

func (*ShardedStorageWithIndexStub) Close

func (stub *ShardedStorageWithIndexStub) Close() error

Close -

func (*ShardedStorageWithIndexStub) Count

func (stub *ShardedStorageWithIndexStub) Count() (uint32, error)

Count -

func (*ShardedStorageWithIndexStub) Get

func (stub *ShardedStorageWithIndexStub) Get(key []byte) ([]byte, error)

Get -

func (*ShardedStorageWithIndexStub) Has

func (stub *ShardedStorageWithIndexStub) Has(key []byte) error

Has -

func (*ShardedStorageWithIndexStub) IsInterfaceNil

func (stub *ShardedStorageWithIndexStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ShardedStorageWithIndexStub) Put

func (stub *ShardedStorageWithIndexStub) Put(key, data []byte) error

Put -

type StatusMetricsStub

type StatusMetricsStub struct {
	AddRequestDataCalled          func(path string, duration time.Duration, status int)
	GetAllCalled                  func() map[string]*requests.EndpointMetricsResponse
	GetMetricsForPrometheusCalled func() string
}

StatusMetricsStub -

func (*StatusMetricsStub) AddRequestData

func (s *StatusMetricsStub) AddRequestData(path string, duration time.Duration, status int)

AddRequestData -

func (*StatusMetricsStub) GetAll

GetAll -

func (*StatusMetricsStub) GetMetricsForPrometheus

func (s *StatusMetricsStub) GetMetricsForPrometheus() string

GetMetricsForPrometheus -

func (*StatusMetricsStub) IsInterfaceNil

func (s *StatusMetricsStub) IsInterfaceNil() bool

IsInterfaceNil -

type StorerMock

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

StorerMock -

func NewStorerMock

func NewStorerMock() *StorerMock

NewStorerMock -

func (*StorerMock) ClearCache

func (sm *StorerMock) ClearCache()

ClearCache -

func (*StorerMock) Close

func (sm *StorerMock) Close() error

Close -

func (*StorerMock) DestroyUnit

func (sm *StorerMock) DestroyUnit() error

DestroyUnit -

func (*StorerMock) Get

func (sm *StorerMock) Get(key []byte) ([]byte, error)

Get -

func (*StorerMock) GetBulkFromEpoch

func (sm *StorerMock) GetBulkFromEpoch(_ [][]byte, _ uint32) ([]storage.KeyValuePair, error)

GetBulkFromEpoch -

func (*StorerMock) GetFromEpoch

func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)

GetFromEpoch -

func (*StorerMock) GetOldestEpoch

func (sm *StorerMock) GetOldestEpoch() (uint32, error)

GetOldestEpoch -

func (*StorerMock) Has

func (sm *StorerMock) Has(key []byte) error

Has -

func (*StorerMock) IsInterfaceNil

func (sm *StorerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*StorerMock) Put

func (sm *StorerMock) Put(key, data []byte) error

Put -

func (*StorerMock) PutInEpoch

func (sm *StorerMock) PutInEpoch(key, data []byte, _ uint32) error

PutInEpoch -

func (*StorerMock) Remove

func (sm *StorerMock) Remove(key []byte) error

Remove -

func (*StorerMock) RemoveFromCurrentEpoch

func (sm *StorerMock) RemoveFromCurrentEpoch(key []byte) error

RemoveFromCurrentEpoch -

func (*StorerMock) SearchFirst

func (sm *StorerMock) SearchFirst(_ []byte) ([]byte, error)

SearchFirst -

type StorerStub

type StorerStub struct {
	PutCalled                    func(key, data []byte) error
	PutInEpochCalled             func(key, data []byte, epoch uint32) error
	GetCalled                    func(key []byte) ([]byte, error)
	HasCalled                    func(key []byte) error
	SearchFirstCalled            func(key []byte) ([]byte, error)
	RemoveFromCurrentEpochCalled func(key []byte) error
	RemoveCalled                 func(key []byte) error
	ClearCacheCalled             func()
	DestroyUnitCalled            func() error
	GetFromEpochCalled           func(key []byte, epoch uint32) ([]byte, error)
	GetBulkFromEpochCalled       func(keys [][]byte, epoch uint32) ([]storage.KeyValuePair, error)
	GetOldestEpochCalled         func() (uint32, error)
	RangeKeysCalled              func(handler func(key []byte, val []byte) bool)
	CloseCalled                  func() error
}

StorerStub -

func (*StorerStub) ClearCache

func (ss *StorerStub) ClearCache()

ClearCache -

func (*StorerStub) Close

func (ss *StorerStub) Close() error

Close -

func (*StorerStub) DestroyUnit

func (ss *StorerStub) DestroyUnit() error

DestroyUnit -

func (*StorerStub) Get

func (ss *StorerStub) Get(key []byte) ([]byte, error)

Get -

func (*StorerStub) GetBulkFromEpoch

func (ss *StorerStub) GetBulkFromEpoch(keys [][]byte, epoch uint32) ([]storage.KeyValuePair, error)

GetBulkFromEpoch -

func (*StorerStub) GetFromEpoch

func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)

GetFromEpoch -

func (*StorerStub) GetOldestEpoch

func (ss *StorerStub) GetOldestEpoch() (uint32, error)

GetOldestEpoch -

func (*StorerStub) Has

func (ss *StorerStub) Has(key []byte) error

Has -

func (*StorerStub) IsInterfaceNil

func (ss *StorerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*StorerStub) Put

func (ss *StorerStub) Put(key, data []byte) error

Put -

func (*StorerStub) PutInEpoch

func (ss *StorerStub) PutInEpoch(key, data []byte, epoch uint32) error

PutInEpoch -

func (*StorerStub) Remove

func (ss *StorerStub) Remove(key []byte) error

Remove -

func (*StorerStub) RemoveFromCurrentEpoch

func (ss *StorerStub) RemoveFromCurrentEpoch(key []byte) error

RemoveFromCurrentEpoch -

func (*StorerStub) SearchFirst

func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)

SearchFirst -

type TOTPHandlerStub

type TOTPHandlerStub struct {
	CreateTOTPCalled    func(account string) (handlers.OTP, error)
	TOTPFromBytesCalled func(encryptedMessage []byte) (handlers.OTP, error)
}

TOTPHandlerStub -

func (*TOTPHandlerStub) CreateTOTP

func (stub *TOTPHandlerStub) CreateTOTP(account string) (handlers.OTP, error)

CreateTOTP -

func (*TOTPHandlerStub) IsInterfaceNil

func (stub *TOTPHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*TOTPHandlerStub) TOTPFromBytes

func (stub *TOTPHandlerStub) TOTPFromBytes(encryptedMessage []byte) (handlers.OTP, error)

TOTPFromBytes -

type TotpStub

type TotpStub struct {
	ValidateCalled func(userCode string) error
	OTPCalled      func() (string, error)
	QRCalled       func() ([]byte, error)
	ToBytesCalled  func() ([]byte, error)
	UrlCalled      func() (string, error)
}

TotpStub -

func (*TotpStub) OTP

func (stub *TotpStub) OTP() (string, error)

OTP -

func (*TotpStub) QR

func (stub *TotpStub) QR() ([]byte, error)

QR -

func (*TotpStub) ToBytes

func (stub *TotpStub) ToBytes() ([]byte, error)

ToBytes -

func (*TotpStub) Url

func (stub *TotpStub) Url() (string, error)

Url -

func (*TotpStub) Validate

func (stub *TotpStub) Validate(userCode string) error

Validate -

type UserEncryptorStub

type UserEncryptorStub struct {
	EncryptUserInfoCalled func(userInfo *core.UserInfo) (*core.UserInfo, error)
	DecryptUserInfoCalled func(userInfo *core.UserInfo) (*core.UserInfo, error)
}

UserEncryptorStub is a stub implementation of UserEncryptor

func (*UserEncryptorStub) DecryptUserInfo

func (ues *UserEncryptorStub) DecryptUserInfo(userInfo *core.UserInfo) (*core.UserInfo, error)

DecryptUserInfo decrypts the provided user info

func (*UserEncryptorStub) EncryptUserInfo

func (ues *UserEncryptorStub) EncryptUserInfo(userInfo *core.UserInfo) (*core.UserInfo, error)

EncryptUserInfo encrypts the provided user info

func (*UserEncryptorStub) IsInterfaceNil

func (ues *UserEncryptorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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