Add seal type to seal-status output. (#3516)

This commit is contained in:
Jeff Mitchell 2017-11-01 21:00:41 -05:00 committed by GitHub
parent 972834a610
commit 962ef74cb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -49,6 +49,7 @@ func sealStatusRequest(c *Sys, r *Request) (*SealStatusResponse, error) {
}
type SealStatusResponse struct {
Type string `json:"type"`
Sealed bool `json:"sealed"`
T int `json:"t"`
N int `json:"n"`

View file

@ -36,12 +36,14 @@ func (c *StatusCommand) Run(args []string) int {
}
outStr := fmt.Sprintf(
"Sealed: %v\n"+
"Type: %s\n"+
"Sealed: %v\n"+
"Key Shares: %d\n"+
"Key Threshold: %d\n"+
"Unseal Progress: %d\n"+
"Unseal Nonce: %v\n"+
"Version: %s",
sealStatus.Type,
sealStatus.Sealed,
sealStatus.N,
sealStatus.T,

View file

@ -190,6 +190,7 @@ func handleSysSealStatusRaw(core *vault.Core, w http.ResponseWriter, r *http.Req
progress, nonce := core.SecretProgress()
respondOk(w, &SealStatusResponse{
Type: sealConfig.Type,
Sealed: sealed,
T: sealConfig.SecretThreshold,
N: sealConfig.SecretShares,
@ -202,6 +203,7 @@ func handleSysSealStatusRaw(core *vault.Core, w http.ResponseWriter, r *http.Req
}
type SealStatusResponse struct {
Type string `json:"type"`
Sealed bool `json:"sealed"`
T int `json:"t"`
N int `json:"n"`