Documentation ¶
Index ¶
- func CreateServiceAccountKey(ctx context.Context, iamService *iam.Service, serviceAccountEmail string, ...) (*iam.ServiceAccountKey, error)
- func Handler(w http.ResponseWriter, r *http.Request)
- func VaultKey(ctx context.Context, sm *secretmanager.Client, key []byte, secretName string, ...) error
- type Directive
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateServiceAccountKey ¶
func CreateServiceAccountKey(ctx context.Context, iamService *iam.Service, serviceAccountEmail string, disableAction bool) (*iam.ServiceAccountKey, error)
CreateServiceAccountKey creates a service account key, and if DisableServiceAccountKeys is set to 'true' in the directive, it will disable all other service account keys for that service account. It will return one of []byte or error. The []byte (the KeyFile) contains the key material of the service account. This should be treated as a secret and should only ever be placed in secret manager.
func VaultKey ¶
func VaultKey(ctx context.Context, sm *secretmanager.Client, key []byte, secretName string, disableSecretAction bool) error
Create a new secret version and vaults the given value in that version. If DisableSecretVersions is set to 'true' in the Directive, all other version of the secret will be disabled.
Types ¶
type Directive ¶
type Directive struct { // In a future version, this field will be used to allow // for specifying whether a GCP service account key or // API Key is the target. Support may be extended for all // secrets/keys on GCP that developers need/want to rotate. RotationType string `json:"rotationType,omitempty"` // The service account email whose keys will be rotated ServiceAccountEmail string `json:"serviceAccountEmail"` // The application service account that needs access to the secret ApplicationServiceAccount string `json:"applicationServiceAccount"` // Option to disable the secret version. If true, all previous versions // of the secret will be disabled. DisableSecretVersions bool `json:"disableSecretVersions,omitempty"` // Option to disable the key. If true all previous serviceAccount // keys will be disabled. DisableServiceAccountKeys bool `json:"disableServiceAccountKeys,omitempty"` // The name of the secret. ex: my-prod-secret // If omitted, a new secret will be created, unless an // existing secret can be found that is tied to the same service account. SecretName string `json:"secretName,omitempty"` }
Directive is used to tell the 'locksmith' what operations to perform.
Click to show internal directories.
Click to hide internal directories.