Send initialized information via sys/seal-status (#5424)

This commit is contained in:
Jeff Mitchell
2018-09-27 16:03:37 -05:00
committed by Brian Kassouf
parent e559a1f20a
commit 382f28ee24
4 changed files with 14 additions and 1 deletions

View File

@@ -177,7 +177,12 @@ func handleSysSealStatusRaw(core *vault.Core, w http.ResponseWriter, r *http.Req
}
if sealConfig == nil {
respondError(w, http.StatusBadRequest, fmt.Errorf("server is not yet initialized"))
respondOk(w, &SealStatusResponse{
Type: core.SealAccess().BarrierType(),
Initialized: false,
Sealed: true,
RecoverySeal: core.SealAccess().RecoveryKeySupported(),
})
return
}
@@ -201,6 +206,7 @@ func handleSysSealStatusRaw(core *vault.Core, w http.ResponseWriter, r *http.Req
respondOk(w, &SealStatusResponse{
Type: sealConfig.Type,
Initialized: true,
Sealed: sealed,
T: sealConfig.SecretThreshold,
N: sealConfig.SecretShares,
@@ -215,6 +221,7 @@ func handleSysSealStatusRaw(core *vault.Core, w http.ResponseWriter, r *http.Req
type SealStatusResponse struct {
Type string `json:"type"`
Initialized bool `json:"initialized"`
Sealed bool `json:"sealed"`
T int `json:"t"`
N int `json:"n"`