Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { Encrypt(ctx context.Context, plaintext []byte) ([]byte, error) Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error) }
API provides a mockable interface for the GCP api. Find the implementation of the GCP wrapped API in wrapped.go
type APIWrapper ¶
type APIWrapper struct { ProjectID string LocationID string KmsRing string KmsKey string KmsClient *kms.KeyManagementClient }
APIWrapper wraps the GCP api
type Client ¶
type Client struct { Option // contains filtered or unexported fields }
Client wrapper for KMS and GCS secret storage
func New ¶
New returns a new Client, wrapping kms and gcs for storing/reading encrypted secrets from GCP
type Option ¶
type Option struct { ProjectID string LocationID string KmsRing string KmsKey string ServiceAccount string // filename of the serviceaccount to use }
Option wrapper for relevant Options for the client
func (Option) WithKmsKey ¶
WithKmsKey modifies option to have a kms key
func (Option) WithKmsRing ¶
WithKmsRing modifies option to have a kms ring
func (Option) WithLocationID ¶
WithLocationID modifies option to have a zone id
func (Option) WithProjectID ¶
WithProjectID modifies option to have a project id
func (Option) WithServiceAccount ¶
WithServiceAccount modifies option to have a service account
Click to show internal directories.
Click to hide internal directories.