mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 09:42:25 +00:00
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:
3
changelog/18625.txt
Normal file
3
changelog/18625.txt
Normal file
@@ -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{
|
Operations: map[logical.Operation]framework.OperationHandler{
|
||||||
logical.UpdateOperation: &framework.PathOperation{
|
logical.UpdateOperation: &framework.PathOperation{
|
||||||
Summary: "Seal the Vault.",
|
Summary: "Seal the Vault.",
|
||||||
|
Responses: map[int][]framework.Response{
|
||||||
|
http.StatusNoContent: {{
|
||||||
|
Description: "OK",
|
||||||
|
}},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HelpSynopsis: strings.TrimSpace(sysHelp["seal"][0]),
|
HelpSynopsis: strings.TrimSpace(sysHelp["seal"][0]),
|
||||||
@@ -980,6 +985,77 @@ func (b *SystemBackend) rekeyPaths() []*framework.Path {
|
|||||||
Operations: map[logical.Operation]framework.OperationHandler{
|
Operations: map[logical.Operation]framework.OperationHandler{
|
||||||
logical.UpdateOperation: &framework.PathOperation{
|
logical.UpdateOperation: &framework.PathOperation{
|
||||||
Summary: "Unseal the Vault.",
|
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{
|
logical.ReadOperation: &framework.PathOperation{
|
||||||
Callback: b.handleSealStatus,
|
Callback: b.handleSealStatus,
|
||||||
Summary: "Check the seal status of a Vault.",
|
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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user