Documentation ¶
Index ¶
- func ProtoClone[T proto.Message](t T) T
- type MockService
- type SecretsV1
- func (s *SecretsV1) AccessSecretVersion(ctx context.Context, req *pb.AccessSecretVersionRequest) (*pb.AccessSecretVersionResponse, error)
- func (s *SecretsV1) AddSecretVersion(ctx context.Context, req *pb.AddSecretVersionRequest) (*pb.SecretVersion, error)
- func (s *SecretsV1) CreateSecret(ctx context.Context, req *pb.CreateSecretRequest) (*pb.Secret, error)
- func (s *SecretsV1) DeleteSecret(ctx context.Context, req *pb.DeleteSecretRequest) (*emptypb.Empty, error)
- func (s *SecretsV1) DestroySecretVersion(ctx context.Context, req *pb.DestroySecretVersionRequest) (*pb.SecretVersion, error)
- func (s *SecretsV1) DisableSecretVersion(ctx context.Context, req *pb.DisableSecretVersionRequest) (*pb.SecretVersion, error)
- func (s *SecretsV1) EnableSecretVersion(ctx context.Context, req *pb.EnableSecretVersionRequest) (*pb.SecretVersion, error)
- func (s *SecretsV1) GetSecret(ctx context.Context, req *pb.GetSecretRequest) (*pb.Secret, error)
- func (s *SecretsV1) GetSecretVersion(ctx context.Context, req *pb.GetSecretVersionRequest) (*pb.SecretVersion, error)
- func (s *SecretsV1) UpdateSecret(ctx context.Context, req *pb.UpdateSecretRequest) (*pb.Secret, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProtoClone ¶
ProtoClone is a type-safe wrapper around proto.Clone
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) ExpectedHosts ¶
func (s *MockService) ExpectedHosts() []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 ¶
type SecretsV1 struct { *MockService pb.UnimplementedSecretManagerServiceServer }
func (*SecretsV1) AccessSecretVersion ¶
func (s *SecretsV1) AccessSecretVersion(ctx context.Context, req *pb.AccessSecretVersionRequest) (*pb.AccessSecretVersionResponse, error)
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 ¶
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].
func (*SecretsV1) UpdateSecret ¶
func (s *SecretsV1) UpdateSecret(ctx context.Context, req *pb.UpdateSecretRequest) (*pb.Secret, error)
Update metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].