Vault | Golang SDK | Secrets Endpoints
Secrets Endpoints
Secret rotate
func (v *vault) SecretRotate(ctx context.Context, input *SecretRotateRequest) (*pangea.PangeaResponse[SecretRotateResult], error)Rotate a secret.
input := &vault.SecretRotateRequest{
Secret: pangea.StringValue("12sdfgs4543qv@#%$casd"),
CommonRotateRequest: vault.CommonRotateRequest{
ID: pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
RotationState vault.IVSdeactivated,
},
}
srr, err := vaultcli.SecretRotate(ctx, input)
Secret store
func (v *vault) SecretStore(ctx context.Context, input *SecretStoreRequest) (*pangea.PangeaResponse[SecretStoreResult], error)Import a secret
input := &vault.SecretStoreRequest{
Secret: pangea.StringValue("12sdfgs4543qv@#%$casd"),
Type: vault.ITsecret
CommonStoreRequest: vault.CommonStoreRequest{
Name: pangea.StringValue("my-very-secret-secret"),
Folder: pangea.StringValue("/personal"),
Metadata: vault.Metadata{
"created_by": pangea.StringValue("John Doe"),
"used_in": pangea.StringValue("Google products"),
},
Tags: vault.Tags{
pangea.StringValue("irs_2023"),
pangea.StringValue("personal"),
},
},
}
ssr, err := vaultcli.SecretStore(ctx, input)