mirror of
https://github.com/Infisical/infisical.git
synced 2026-05-02 03:02:03 -04:00
23 lines
447 B
Go
23 lines
447 B
Go
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
|
|
}
|