spf13--viper/remote/vault_stub.go
2018-05-14 14:37:53 -07:00

29 lines
792 B
Go

package remote
// jna -- This stub will connect our vault provider with the
// crypt.ConfigManager interface. The main code is in vault/vault.go
//
// Until I can get the maintainers of the crypt package to support
// vault, we can make vault work this way.
import (
vault "github.com/spf13/viper/vault"
crypt "github.com/xordataexchange/crypt/config"
"io"
)
func NewStandardVaultConfigManager(machines []string) (crypt.ConfigManager, error) {
store, err := vault.New(machines)
if err != nil {
return nil, err
}
return crypt.NewStandardConfigManager(store)
}
func NewVaultConfigManager(machines []string, keystore io.Reader) (crypt.ConfigManager, error) {
store, err := vault.New(machines)
if err != nil {
return nil, err
}
return crypt.NewConfigManager(store, keystore)
}