VAULT-12144: add openapi responses for /sys/seal endpoints (#18625)
* added responses to seal/unseal endpoints Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com> * add response for /seal-status Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com> * added change log --------- Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com>
This commit is contained in:
parent
e33b87a2c3
commit
4b52cea28c
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
openapi: add openapi response definitions to /sys/seal endpoints
|
||||
```
|
|
@ -958,6 +958,11 @@ func (b *SystemBackend) rekeyPaths() []*framework.Path {
|
|||
Operations: map[logical.Operation]framework.OperationHandler{
|
||||
logical.UpdateOperation: &framework.PathOperation{
|
||||
Summary: "Seal the Vault.",
|
||||
Responses: map[int][]framework.Response{
|
||||
http.StatusNoContent: {{
|
||||
Description: "OK",
|
||||
}},
|
||||
},
|
||||
},
|
||||
},
|
||||
HelpSynopsis: strings.TrimSpace(sysHelp["seal"][0]),
|
||||
|
@ -980,6 +985,77 @@ func (b *SystemBackend) rekeyPaths() []*framework.Path {
|
|||
Operations: map[logical.Operation]framework.OperationHandler{
|
||||
logical.UpdateOperation: &framework.PathOperation{
|
||||
Summary: "Unseal the Vault.",
|
||||
Responses: map[int][]framework.Response{
|
||||
http.StatusOK: {{
|
||||
// unseal returns `vault.SealStatusResponse` struct
|
||||
Fields: map[string]*framework.FieldSchema{
|
||||
"type": {
|
||||
Type: framework.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"initialized": {
|
||||
Type: framework.TypeBool,
|
||||
Required: true,
|
||||
},
|
||||
"sealed": {
|
||||
Type: framework.TypeBool,
|
||||
Required: true,
|
||||
},
|
||||
"t": {
|
||||
Type: framework.TypeInt,
|
||||
Required: true,
|
||||
},
|
||||
"n": {
|
||||
Type: framework.TypeInt,
|
||||
Required: true,
|
||||
},
|
||||
"progress": {
|
||||
Type: framework.TypeInt,
|
||||
Required: true,
|
||||
},
|
||||
"nonce": {
|
||||
Type: framework.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"version": {
|
||||
Type: framework.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"build_date": {
|
||||
Type: framework.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"migration": {
|
||||
Type: framework.TypeBool,
|
||||
Required: true,
|
||||
},
|
||||
"cluster_name": {
|
||||
Type: framework.TypeString,
|
||||
Required: false,
|
||||
},
|
||||
"cluster_id": {
|
||||
Type: framework.TypeString,
|
||||
Required: false,
|
||||
},
|
||||
"recovery_seal": {
|
||||
Type: framework.TypeBool,
|
||||
Required: true,
|
||||
},
|
||||
"storage_type": {
|
||||
Type: framework.TypeString,
|
||||
Required: false,
|
||||
},
|
||||
"hcp_link_status": {
|
||||
Type: framework.TypeString,
|
||||
Required: false,
|
||||
},
|
||||
"hcp_link_resource_ID": {
|
||||
Type: framework.TypeString,
|
||||
Required: false,
|
||||
},
|
||||
},
|
||||
}},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -1058,6 +1134,77 @@ func (b *SystemBackend) statusPaths() []*framework.Path {
|
|||
logical.ReadOperation: &framework.PathOperation{
|
||||
Callback: b.handleSealStatus,
|
||||
Summary: "Check the seal status of a Vault.",
|
||||
Responses: map[int][]framework.Response{
|
||||
http.StatusOK: {{
|
||||
// unseal returns `vault.SealStatusResponse` struct
|
||||
Fields: map[string]*framework.FieldSchema{
|
||||
"type": {
|
||||
Type: framework.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"initialized": {
|
||||
Type: framework.TypeBool,
|
||||
Required: true,
|
||||
},
|
||||
"sealed": {
|
||||
Type: framework.TypeBool,
|
||||
Required: true,
|
||||
},
|
||||
"t": {
|
||||
Type: framework.TypeInt,
|
||||
Required: true,
|
||||
},
|
||||
"n": {
|
||||
Type: framework.TypeInt,
|
||||
Required: true,
|
||||
},
|
||||
"progress": {
|
||||
Type: framework.TypeInt,
|
||||
Required: true,
|
||||
},
|
||||
"nonce": {
|
||||
Type: framework.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"version": {
|
||||
Type: framework.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"build_date": {
|
||||
Type: framework.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"migration": {
|
||||
Type: framework.TypeBool,
|
||||
Required: true,
|
||||
},
|
||||
"cluster_name": {
|
||||
Type: framework.TypeString,
|
||||
Required: false,
|
||||
},
|
||||
"cluster_id": {
|
||||
Type: framework.TypeString,
|
||||
Required: false,
|
||||
},
|
||||
"recovery_seal": {
|
||||
Type: framework.TypeBool,
|
||||
Required: true,
|
||||
},
|
||||
"storage_type": {
|
||||
Type: framework.TypeString,
|
||||
Required: false,
|
||||
},
|
||||
"hcp_link_status": {
|
||||
Type: framework.TypeString,
|
||||
Required: false,
|
||||
},
|
||||
"hcp_link_resource_ID": {
|
||||
Type: framework.TypeString,
|
||||
Required: false,
|
||||
},
|
||||
},
|
||||
}},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue