scw_secret_manager

package module
v0.0.0-...-cf17ebd Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: AGPL-3.0 Imports: 8 Imported by: 2

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: scaleway_wrapper.go

Generated by this command:

mockgen -source scaleway_wrapper.go -destination mock_scaleway_wrapper.go -package scw_secret_manager

Package scw_secret_manager is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUp

func CleanUp(t *testing.T, IDs []string)

/Removes all created secrets, used for testing

Types

type IScaleWayWrapper

type IScaleWayWrapper interface {
	ListSecrets(names ...string) (SecretHolder, error)
	ListSecretVersions(secretID string) (SecretVersionHolder, error)
	GetSecretData(secretName string, revision string) ([]byte, error)
	SetSecret(secretName string, secretValue []byte) (Secret, error)
	CreateNewSecretVersion(secret Secret, data []byte) error
	DeleteSecret(id string) error
	DeleteSecretVersion(id string, revision string) error
}

func NewScaleWayWrapper

func NewScaleWayWrapper(setupData ScaleWaySetupData) IScaleWayWrapper

Used godotenv to read you enviroment variables

func NewScaleWayWrapperForDev

func NewScaleWayWrapperForDev(initEmpty ...bool) IScaleWayWrapper

Loads the following environment variables:

- ENCRYPTION_KEY base64 encoded encryption key 32 bytes long

- API_KEY base64 encoded api key 32 bytes long

- PRIVATE_KEY ECDSA Private Key in PEM format encoded as base64 for easy parsing (in one line)

If initEmpty is set to true, the keyStore is initialized empty

func NewScaleWayWrapperFromEnv

func NewScaleWayWrapperFromEnv() IScaleWayWrapper

type LocalScaleWayWrapper

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

func (*LocalScaleWayWrapper) CreateNewSecretVersion

func (scalewayWrapper *LocalScaleWayWrapper) CreateNewSecretVersion(secret Secret, data []byte) error

func (*LocalScaleWayWrapper) DeleteSecret

func (scalewayWrapper *LocalScaleWayWrapper) DeleteSecret(id string) error

func (*LocalScaleWayWrapper) DeleteSecretVersion

func (scalewayWrapper *LocalScaleWayWrapper) DeleteSecretVersion(id string, revision string) error

func (*LocalScaleWayWrapper) GetSecretData

func (scalewayWrapper *LocalScaleWayWrapper) GetSecretData(secretName string, revision string) ([]byte, error)

func (*LocalScaleWayWrapper) ListSecretVersions

func (ScalewayWrapper *LocalScaleWayWrapper) ListSecretVersions(secretID string) (SecretVersionHolder, error)

func (*LocalScaleWayWrapper) ListSecrets

func (scalewayWrapper *LocalScaleWayWrapper) ListSecrets(names ...string) (SecretHolder, error)

func (*LocalScaleWayWrapper) SetSecret

func (scalewayWrapper *LocalScaleWayWrapper) SetSecret(secretName string, secretValue []byte) (Secret, error)

type MockIScaleWayWrapper

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

MockIScaleWayWrapper is a mock of IScaleWayWrapper interface.

func NewMockIScaleWayWrapper

func NewMockIScaleWayWrapper(ctrl *gomock.Controller) *MockIScaleWayWrapper

NewMockIScaleWayWrapper creates a new mock instance.

func (*MockIScaleWayWrapper) CreateNewSecretVersion

func (m *MockIScaleWayWrapper) CreateNewSecretVersion(secret Secret, data []byte) error

CreateNewSecretVersion mocks base method.

func (*MockIScaleWayWrapper) DeleteSecret

func (m *MockIScaleWayWrapper) DeleteSecret(id string) error

DeleteSecret mocks base method.

func (*MockIScaleWayWrapper) DeleteSecretVersion

func (m *MockIScaleWayWrapper) DeleteSecretVersion(id, revision string) error

DeleteSecretVersion mocks base method.

func (*MockIScaleWayWrapper) EXPECT

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

func (*MockIScaleWayWrapper) GetSecretData

func (m *MockIScaleWayWrapper) GetSecretData(secretName, revision string) ([]byte, error)

GetSecretData mocks base method.

func (*MockIScaleWayWrapper) ListSecretVersions

func (m *MockIScaleWayWrapper) ListSecretVersions(secretID string) (SecretVersionHolder, error)

ListSecretVersions mocks base method.

func (*MockIScaleWayWrapper) ListSecrets

func (m *MockIScaleWayWrapper) ListSecrets(names ...string) (SecretHolder, error)

ListSecrets mocks base method.

func (*MockIScaleWayWrapper) SetSecret

func (m *MockIScaleWayWrapper) SetSecret(secretName string, secretValue []byte) (Secret, error)

SetSecret mocks base method.

type MockIScaleWayWrapperMockRecorder

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

MockIScaleWayWrapperMockRecorder is the mock recorder for MockIScaleWayWrapper.

func (*MockIScaleWayWrapperMockRecorder) CreateNewSecretVersion

func (mr *MockIScaleWayWrapperMockRecorder) CreateNewSecretVersion(secret, data any) *gomock.Call

CreateNewSecretVersion indicates an expected call of CreateNewSecretVersion.

func (*MockIScaleWayWrapperMockRecorder) DeleteSecret

func (mr *MockIScaleWayWrapperMockRecorder) DeleteSecret(id any) *gomock.Call

DeleteSecret indicates an expected call of DeleteSecret.

func (*MockIScaleWayWrapperMockRecorder) DeleteSecretVersion

func (mr *MockIScaleWayWrapperMockRecorder) DeleteSecretVersion(id, revision any) *gomock.Call

DeleteSecretVersion indicates an expected call of DeleteSecretVersion.

func (*MockIScaleWayWrapperMockRecorder) GetSecretData

func (mr *MockIScaleWayWrapperMockRecorder) GetSecretData(secretName, revision any) *gomock.Call

GetSecretData indicates an expected call of GetSecretData.

func (*MockIScaleWayWrapperMockRecorder) ListSecretVersions

func (mr *MockIScaleWayWrapperMockRecorder) ListSecretVersions(secretID any) *gomock.Call

ListSecretVersions indicates an expected call of ListSecretVersions.

func (*MockIScaleWayWrapperMockRecorder) ListSecrets

func (mr *MockIScaleWayWrapperMockRecorder) ListSecrets(names ...any) *gomock.Call

ListSecrets indicates an expected call of ListSecrets.

func (*MockIScaleWayWrapperMockRecorder) SetSecret

func (mr *MockIScaleWayWrapperMockRecorder) SetSecret(secretName, secretValue any) *gomock.Call

SetSecret indicates an expected call of SetSecret.

type ScaleWaySetupData

type ScaleWaySetupData struct {
	AccessKey string
	SecretKey string
	ProjectID string
	Region    string
}

type ScalewayWrapper

type ScalewayWrapper struct {
	Client     scw.Client
	Api        *secret_manager.API
	PROJECT_ID string
}

func (*ScalewayWrapper) CreateNewSecretVersion

func (scalewayWrapper *ScalewayWrapper) CreateNewSecretVersion(secret Secret, data []byte) error

func (*ScalewayWrapper) DeleteSecret

func (scalewayWrapper *ScalewayWrapper) DeleteSecret(id string) error

func (*ScalewayWrapper) DeleteSecretVersion

func (scalewayWrapper *ScalewayWrapper) DeleteSecretVersion(id string, revision string) error

func (*ScalewayWrapper) GetSecretData

func (scalewayWrapper *ScalewayWrapper) GetSecretData(secretName string, revision string) ([]byte, error)

func (*ScalewayWrapper) ListSecretVersions

func (ScalewayWrapper *ScalewayWrapper) ListSecretVersions(secretID string) (SecretVersionHolder, error)

func (*ScalewayWrapper) ListSecrets

func (scalewayWrapper *ScalewayWrapper) ListSecrets(names ...string) (SecretHolder, error)

func (*ScalewayWrapper) SetSecret

func (scalewayWrapper *ScalewayWrapper) SetSecret(secretName string, secretValue []byte) (Secret, error)

type Secret

type Secret secret_manager.Secret

type SecretHolder

type SecretHolder struct {
	Secrets    []*Secret
	TotalCount uint32
}

type SecretVersion

type SecretVersion secret_manager.SecretVersion

type SecretVersionHolder

type SecretVersionHolder struct {
	SecretVersions []SecretVersion
	TotalCount     uint32
}

Jump to

Keyboard shortcuts

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