mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Add support for "pgp-tokens" parameters to init.
There are thorough unit tests that read the returned encrypted tokens, seal the vault, and unseal it again to ensure all works as expected.
This commit is contained in:
@@ -19,6 +19,10 @@ func (c *Sys) Init(opts *InitRequest) (*InitResponse, error) {
|
||||
"secret_threshold": opts.SecretThreshold,
|
||||
}
|
||||
|
||||
if len(opts.SecretPGPKeys) != 0 {
|
||||
body["secret_pgp_keys"] = opts.SecretPGPKeys
|
||||
}
|
||||
|
||||
r := c.c.NewRequest("PUT", "/v1/sys/init")
|
||||
if err := r.SetJSONBody(body); err != nil {
|
||||
return nil, err
|
||||
@@ -38,6 +42,7 @@ func (c *Sys) Init(opts *InitRequest) (*InitResponse, error) {
|
||||
type InitRequest struct {
|
||||
SecretShares int
|
||||
SecretThreshold int
|
||||
SecretPGPKeys []string
|
||||
}
|
||||
|
||||
type InitStatusResponse struct {
|
||||
|
||||
Reference in New Issue
Block a user