Documentation ¶
Index ¶
- func AccessSecretVersion(version string) ([]byte, error)
- func AddSecretVersion(path string, payload []byte) (string, error)
- func CreateSecret(parent string, secretID string, expiration int64) (string, error)
- func DeleteSecret(name string) error
- func Knock(parent string) error
- func ListSecrets(parent string) (secrets []string, errors []error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessSecretVersion ¶
AccessSecretVersion returns the payload for the given secret version if one exists. The `version` is the full path to the secret version, and can be a version number as a string (e.g. "5") or an alias (e.g. "latest"), i.e.
"projects/projectID/secrets/secretID/versions/latest" "projects/projectID/secrets/secretID/versions/5"
func AddSecretVersion ¶
AddSecretVersion adds a new secret version to the given secret path with the provided payload. The path should be the full path to the secret, e.g.
"projects/projectID/secrets/secretID"
Returns the path to the secret version, e.g.:
"projects/projectID/secrets/secretID/versions/1"
and an error if one occurs.
func CreateSecret ¶
CreateSecret creates a new secret in the Google Cloud Manager top- level directory, specified as `parent`, using the `secretID` provided as the name, to expire after `expiration` seconds. The parent should be a path, e.g.
"projects/project-name"
This function returns a string representation of the path where the new secret is stored, e.g.
"projects/projectID/secrets/secretID"
and an error if any occurs. Note: A secret is a logical wrapper around a collection of secret versions. Secret versions hold the actual secret material.
func DeleteSecret ¶
DeleteSecret deletes the secret with the given `name`, and all of its versions. `name` should be the root path to the secret, e.g.:
"projects/projectID/secrets/secretID"
This is an irreversible operation. Any service or workload that attempts to access a deleted secret receives a Not Found error.
func Knock ¶
Knock checks to make sure we can create a new client. This validates IAM permissions to some extent.
func ListSecrets ¶
ListSecrets retrieves the names of all secrets in the project, given the `parent`, e.g.:
"projects/my-project"
It returns a slice of strings representing the paths to the retrieved secrets, and a matching slice of errors for each failed retrieval.
Types ¶
This section is empty.