mocksecretmanager

package
v0.0.0-...-8078c5c Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockService

type MockService struct {
	*common.MockEnvironment
	// contains filtered or unexported fields
}

MockService represents a mocked secret manager service.

func New

func New(env *common.MockEnvironment, storage storage.Storage) *MockService

New creates a mockSecretManager

func (*MockService) ExpectedHost

func (s *MockService) ExpectedHost() string

func (*MockService) NewHTTPMux

func (s *MockService) NewHTTPMux(ctx context.Context, conn *grpc.ClientConn) (http.Handler, error)

func (*MockService) Register

func (s *MockService) Register(grpcServer *grpc.Server)

type SecretsV1

func (*SecretsV1) AccessSecretVersion

Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.

`projects/*/secrets/*/versions/latest` is an alias to the most recently created [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

func (*SecretsV1) AddSecretVersion

func (s *SecretsV1) AddSecretVersion(ctx context.Context, req *pb.AddSecretVersionRequest) (*pb.SecretVersion, error)

Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1.Secret].

func (*SecretsV1) CreateSecret

func (s *SecretsV1) CreateSecret(ctx context.Context, req *pb.CreateSecretRequest) (*pb.Secret, error)

Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

func (*SecretsV1) DeleteSecret

func (s *SecretsV1) DeleteSecret(ctx context.Context, req *pb.DeleteSecretRequest) (*emptypb.Empty, error)

Deletes a [Secret][google.cloud.secretmanager.v1.Secret].

func (*SecretsV1) DestroySecretVersion

func (s *SecretsV1) DestroySecretVersion(ctx context.Context, req *pb.DestroySecretVersionRequest) (*pb.SecretVersion, error)

Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.

func (*SecretsV1) DisableSecretVersion

func (s *SecretsV1) DisableSecretVersion(ctx context.Context, req *pb.DisableSecretVersionRequest) (*pb.SecretVersion, error)

func (*SecretsV1) EnableSecretVersion

func (s *SecretsV1) EnableSecretVersion(ctx context.Context, req *pb.EnableSecretVersionRequest) (*pb.SecretVersion, error)

Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].

func (*SecretsV1) GetSecret

func (s *SecretsV1) GetSecret(ctx context.Context, req *pb.GetSecretRequest) (*pb.Secret, error)

Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].

func (*SecretsV1) GetSecretVersion

func (s *SecretsV1) GetSecretVersion(ctx context.Context, req *pb.GetSecretVersionRequest) (*pb.SecretVersion, error)

Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

`projects/*/secrets/*/versions/latest` is an alias to the most recently created [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Jump to

Keyboard shortcuts

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