link to forked keyring and bring back vault command

This commit is contained in:
Maidul Islam
2023-08-17 15:07:12 -04:00
parent 49bcd8839f
commit ddc7be18eb
11 changed files with 214 additions and 111 deletions

View File

@@ -0,0 +1,22 @@
package util
import (
"fmt"
)
func GetCurrentVaultBackend() (string, error) {
configFile, err := GetConfigFile()
if err != nil {
return "", fmt.Errorf("getCurrentVaultBackend: unable to get config file [err=%s]", err)
}
if configFile.VaultBackendType == "" {
return "auto", nil
}
if configFile.VaultBackendType != "auto" && configFile.VaultBackendType != "file" {
return "auto", nil
}
return configFile.VaultBackendType, nil
}