test

package
v0.0.0-...-4f2e28b Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDBMock

func GetDBMock() (*gorm.DB, sqlmock.Sqlmock)

Types

type EnvObjMock

type EnvObjMock struct {
	mock.Mock
}

func (*EnvObjMock) AddBrokerPublication

func (env *EnvObjMock) AddBrokerPublication(topic string, e event.Event) error

func (*EnvObjMock) AddBrokerSubscription

func (env *EnvObjMock) AddBrokerSubscription(topic string, handler func(e event.Event))

func (*EnvObjMock) GetBroker

func (*EnvObjMock) GetCryptoProvider

func (env *EnvObjMock) GetCryptoProvider() types.CryptoProvider

func (*EnvObjMock) GetDB

func (env *EnvObjMock) GetDB() *gorm.DB

func (*EnvObjMock) GetHttpClient

func (env *EnvObjMock) GetHttpClient() common.HttpClient

func (*EnvObjMock) GetNamespace

func (env *EnvObjMock) GetNamespace() string

func (*EnvObjMock) GetRandomId

func (env *EnvObjMock) GetRandomId() string

func (*EnvObjMock) IsHealthy

func (env *EnvObjMock) IsHealthy() bool

func (*EnvObjMock) SetSwaggerBasePath

func (e *EnvObjMock) SetSwaggerBasePath(path string)

SetSwaggerBasePath sets the base path that will be used by swagger ui for requests url generation

func (*EnvObjMock) SwaggerOptions

func (e *EnvObjMock) SwaggerOptions() []func(config *ginSwagger.Config)

SwaggerOptions swagger config options. See https://github.com/swaggo/gin-swagger?tab=readme-ov-file#configuration

type HttpMock

type HttpMock struct {
	mock.Mock
}

func (*HttpMock) Do

func (m *HttpMock) Do(req *http.Request) (*http.Response, error)

type ProviderMock

type ProviderMock struct {
	mock.Mock
}

func (*ProviderMock) GetUserInfo

func (k *ProviderMock) GetUserInfo(ctx context.Context, token string, realm string) (*gocloak.UserInfo, error)

type TestProvider

type TestProvider struct {
}

func (*TestProvider) AddKey

func (l *TestProvider) AddKey(name string, key interface{})

func (*TestProvider) CreateCryptoContext

func (l *TestProvider) CreateCryptoContext(context types.CryptoContext) error

func (*TestProvider) Decrypt

func (l *TestProvider) Decrypt(parameter types.CryptoIdentifier, data []byte) ([]byte, error)

func (*TestProvider) DeleteKey

func (l *TestProvider) DeleteKey(parameter types.CryptoIdentifier) error

func (*TestProvider) DestroyCryptoContext

func (l *TestProvider) DestroyCryptoContext(context types.CryptoContext) error

func (*TestProvider) Encrypt

func (l *TestProvider) Encrypt(parameter types.CryptoIdentifier, data []byte) ([]byte, error)

func (*TestProvider) GenerateKey

func (l *TestProvider) GenerateKey(parameter types.CryptoKeyParameter) error

func (*TestProvider) GenerateRandom

func (l *TestProvider) GenerateRandom(context types.CryptoContext, number int) ([]byte, error)

func (*TestProvider) GetKey

func (l *TestProvider) GetKey(parameter types.CryptoIdentifier) (*types.CryptoKey, error)

func (*TestProvider) GetKeys

func (l *TestProvider) GetKeys(parameter types.CryptoFilter) (*types.CryptoKeySet, error)

func (*TestProvider) GetNamespaces

func (l *TestProvider) GetNamespaces(context types.CryptoContext) ([]string, error)

func (*TestProvider) GetPublicKeyPem

func (l *TestProvider) GetPublicKeyPem(context string, keyId string) (p *pem.Block, err error)

func (*TestProvider) GetSeed

func (l *TestProvider) GetSeed(context context.Context) string

func (*TestProvider) GetSupportedHashAlgs

func (l *TestProvider) GetSupportedHashAlgs() []types.HashAlgorithm

func (*TestProvider) GetSupportedKeysAlgs

func (l *TestProvider) GetSupportedKeysAlgs() []types.KeyType

func (*TestProvider) Hash

func (l *TestProvider) Hash(parameter types.CryptoHashParameter, msg []byte) (b []byte, err error)

func (*TestProvider) IsCryptoContextExisting

func (l *TestProvider) IsCryptoContextExisting(context types.CryptoContext) (bool, error)

func (*TestProvider) IsKeyExisting

func (l *TestProvider) IsKeyExisting(identifer types.CryptoIdentifier) (bool, error)

func (*TestProvider) RotateKey

func (l *TestProvider) RotateKey(parameter types.CryptoIdentifier) error

func (*TestProvider) Sign

func (l *TestProvider) Sign(parameter types.CryptoIdentifier, data []byte) (b []byte, err error)

func (*TestProvider) Verify

func (l *TestProvider) Verify(parameter types.CryptoIdentifier, data []byte, signature []byte) (b bool, err error)

Jump to

Keyboard shortcuts

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