Documentation ¶
Index ¶
- type Config
- type Conn
- func (c *Conn) Create(ctx context.Context, name string, value []byte) error
- func (c *Conn) Delete(ctx context.Context, name string) error
- func (c *Conn) Get(ctx context.Context, name string) ([]byte, error)
- func (c *Conn) List(ctx context.Context) (kms.Iter, error)
- func (c *Conn) Status(ctx context.Context) (kms.State, error)
- type Credentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.17.3
type Config struct { // Endpoint is the GCP SecretManager endpoint. Endpoint string // ProjectID is the ID of the GCP project. ProjectID string // Credentials are the GCP credentials to // access the SecretManager. Credentials Credentials // Scopes are GCP OAuth2 scopes for accessing GCP APIs. // If not set, defaults to the GCP default scopes. // // Ref: https://developers.google.com/identity/protocols/oauth2/scopes Scopes []string // ErrorLog is an optional logger for errors // that may occur when interacting with GCP // SecretManager. ErrorLog *log.Logger // contains filtered or unexported fields }
Config is a structure containing configuration options for connecting to a KeySecure server.
type Conn ¶ added in v0.22.0
type Conn struct {
// contains filtered or unexported fields
}
Conn is a connection to a GCP SecretManager.
func (*Conn) Create ¶ added in v0.22.0
Create stores the given key-value pair at GCP secret manager if and only if it doesn't exists. If such an entry already exists it returns kes.ErrKeyExists.
Creating a secret at the GCP SecretManager requires first creating secret itself and then adding a secret version with some payload data. The payload data contains the actual value.
func (*Conn) Delete ¶ added in v0.22.0
Delete remove the key-value pair from GCP SecretManager.
Delete will remove all versions of the GCP secret. Even though CreateKey will create only one version and fails if the secret already exists a user may create more secrets versions through e.g. the GCP CLI. However, KES does not support multiple secret versions and expects a different mechanism for "key-rotation".
type Credentials ¶
type Credentials struct { // ClientID is the client ID of the GCP service account. ClientID string // Client is the client email of the GCP service account. Client string // Key is the private key ID of the GCP service account. KeyID string // Key is the encoded private key of the GCP service account. Key string // contains filtered or unexported fields }
Credentials represent GCP service account credentials.
func (Credentials) MarshalJSON ¶
func (c Credentials) MarshalJSON() ([]byte, error)
MarshalJSON returns a JSON representation of the GCP credentials.
The returned JSON contains extra fields to match the JSON credentials returned by GCP. Those additional fields are set to default values.