mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
SealInterface
This commit is contained in:
@@ -26,17 +26,26 @@ func handleSysGenerateRootAttempt(core *vault.Core) http.Handler {
|
||||
|
||||
func handleSysGenerateRootAttemptGet(core *vault.Core, w http.ResponseWriter, r *http.Request) {
|
||||
// Get the current seal configuration
|
||||
sealConfig, err := core.SealConfig()
|
||||
barrierConfig, err := core.SealAccess().BarrierConfig()
|
||||
if err != nil {
|
||||
respondError(w, http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
if sealConfig == nil {
|
||||
if barrierConfig == nil {
|
||||
respondError(w, http.StatusBadRequest, fmt.Errorf(
|
||||
"server is not yet initialized"))
|
||||
return
|
||||
}
|
||||
|
||||
sealConfig := barrierConfig
|
||||
if core.SealAccess().RecoveryKeySupported() {
|
||||
sealConfig, err = core.SealAccess().RecoveryConfig()
|
||||
if err != nil {
|
||||
respondError(w, http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Get the generation configuration
|
||||
generationConfig, err := core.GenerateRootConfiguration()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user