Skip to content

Commit 1cd96ea

Browse files
committed
feat: keyring, unencrypted, and external vaults
1 parent 498b527 commit 1cd96ea

File tree

8 files changed

+198
-7
lines changed

8 files changed

+198
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ flow run hello
3838
flow complements existing CLI tools by adding multi-project organization, built-in security, and visual discovery to your automation toolkit.
3939

4040
- **Workspace organization** - Group and manage workflows across multiple projects
41-
- **Encrypted secret vaults** - Multiple backends (AES, Age, external tools)
41+
- **Encrypted secret vaults** - Multiple backends (AES, Age, keyring, external tools)
4242
- **Interactive discovery** - Browse, search, and filter workflows visually
4343
- **Flexible execution** - Serial, parallel, conditional, and interactive workflows
4444
- **Workflow generation** - Create projects and workflows from reusable templates

cmd/internal/flags/types.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ var VaultSetFlag = &Metadata{
203203
var VaultTypeFlag = &Metadata{
204204
Name: "type",
205205
Shorthand: "t",
206-
Usage: "Vault type. Either age or aes256",
206+
Usage: "Vault type. Either unencrypted, age, aes256, keyring, or external",
207207
Default: "aes256",
208208
Required: false,
209209
}
@@ -250,3 +250,11 @@ var VaultIdentityFileFlag = &Metadata{
250250
Default: "",
251251
Required: false,
252252
}
253+
254+
var VaultFromFileFlag = &Metadata{
255+
Name: "config",
256+
Shorthand: "c",
257+
Usage: "File path to read the external vault's configuration from. The file must be a valid vault configuration file.",
258+
Default: "",
259+
Required: false,
260+
}

cmd/internal/vault.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func registerCreateVaultCmd(ctx *context.Context, vaultCmd *cobra.Command) {
6464
RegisterFlag(ctx, createCmd, *flags.VaultTypeFlag)
6565
RegisterFlag(ctx, createCmd, *flags.VaultPathFlag)
6666
RegisterFlag(ctx, createCmd, *flags.VaultSetFlag)
67+
RegisterFlag(ctx, createCmd, *flags.VaultFromFileFlag)
6768
// AES flags
6869
RegisterFlag(ctx, createCmd, *flags.VaultKeyEnvFlag)
6970
RegisterFlag(ctx, createCmd, *flags.VaultKeyFileFlag)
@@ -82,6 +83,8 @@ func createVaultFunc(ctx *context.Context, cmd *cobra.Command, args []string) {
8283
setVault := flags.ValueFor[bool](cmd, *flags.VaultSetFlag, false)
8384

8485
switch strings.ToLower(vaultType) {
86+
case "unencrypted":
87+
vaultV2.NewUnencryptedVault(vaultName, vaultPath)
8588
case "aes256":
8689
keyEnv := flags.ValueFor[string](cmd, *flags.VaultKeyEnvFlag, false)
8790
keyFile := flags.ValueFor[string](cmd, *flags.VaultKeyFileFlag, false)
@@ -92,8 +95,19 @@ func createVaultFunc(ctx *context.Context, cmd *cobra.Command, args []string) {
9295
identityEnv := flags.ValueFor[string](cmd, *flags.VaultIdentityEnvFlag, false)
9396
identityFile := flags.ValueFor[string](cmd, *flags.VaultIdentityFileFlag, false)
9497
vaultV2.NewAgeVault(vaultName, vaultPath, recipients, identityEnv, identityFile)
98+
case "keyring":
99+
vaultV2.NewKeyringVault(vaultName)
100+
case "external":
101+
cfgFile := flags.ValueFor[string](cmd, *flags.VaultFromFileFlag, false)
102+
if cfgFile == "" {
103+
logger.Log().Fatalf("external vault requires a configuration file to be specified with --config")
104+
}
105+
vaultV2.NewExternalVault(vaultPath)
95106
default:
96-
logger.Log().Fatalf("unsupported vault type: %s - must be one of 'aes256' or 'age'", vaultType)
107+
logger.Log().Fatalf(
108+
"unsupported vault type: %s - must be one of 'aes256', 'age', 'unencrypted', 'keyring', or 'external'",
109+
vaultType,
110+
)
97111
}
98112

99113
if ctx.Config.Vaults == nil {

docs/cli/flow_vault_create.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ flow vault create NAME [flags]
99
### Options
1010

1111
```
12+
-c, --config string File path to read the external vault's configuration from. The file must be a valid vault configuration file.
1213
-h, --help help for create
1314
--identity-env string Environment variable name for the Age vault identity. Only used for Age vaults.
1415
--identity-file string File path for the Age vault identity. An absolute path is recommended. Only used for Age vaults.
@@ -17,7 +18,7 @@ flow vault create NAME [flags]
1718
-p, --path string Directory that the vault will use to store its data. If not set, the vault will be stored in the flow cache directory.
1819
--recipients string Comma-separated list of recipient keys for the vault. Only used for Age vaults.
1920
-s, --set Set the newly created vault as the current vault
20-
-t, --type string Vault type. Either age or aes256 (default "aes256")
21+
-t, --type string Vault type. Either unencrypted, age, aes256, keyring, or external (default "aes256")
2122
```
2223

2324
### Options inherited from parent commands

docs/guide/secrets.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,81 @@ flow vault create team --type age --recipients key1,key2,key3 --identity-file ~/
100100
flow vault create team --type age --recipients key1,key2,key3 --identity-env MY_IDENTITY
101101
```
102102

103+
#### **Unencrypted**
104+
A simple vault that stores secrets in plain text JSON files.
105+
This is not recommended for production use but can be useful for development or testing.
106+
107+
```shell
108+
# Create an unencrypted vault
109+
flow vault create dev --type unencrypted
110+
```
111+
112+
113+
#### **Keyring**
114+
115+
A vault that uses your operating system's keyring for managing secrets.
116+
This is a good option for personal use where you want seamless integration with your OS security.
117+
118+
```shell
119+
# Create a keyring vault
120+
flow vault create dev --type keyring
121+
```
122+
123+
#### **External (other CLI tools)**
124+
125+
An external vault that uses executes an external CLI tool via shell commands to manage secrets.
126+
This allows you to integrate with existing secret management systems.
127+
128+
First you have to define the external vault configuration in JSON format. Here is a sample one that uses the `pass` CLI tool:
129+
130+
```json
131+
{
132+
"id": "pass",
133+
"type": "external",
134+
"external": {
135+
"get": {
136+
"cmd": "pass show {{key}}",
137+
"output": "{{output}}"
138+
},
139+
"set": {
140+
"cmd": "pass insert -e {{key}}",
141+
"input": "{{value}}"
142+
},
143+
"delete": {
144+
"cmd": "pass rm -f {{key}}"
145+
},
146+
"list": {
147+
"cmd": "pass ls",
148+
"output": "{{output}}"
149+
},
150+
"environment": {
151+
"PASSWORD_STORE_DIR": "$PASSWORD_STORE_DIR"
152+
},
153+
"timeout": "30s"
154+
}
155+
}
156+
```
157+
158+
> [!INFO]
159+
> See the [flowexec/vault examples](https://github.com/flowexec/vault/tree/v0.2.1/examples) for sample configurations for popular CLI tools like Bitwarden, 1Password, AWS SSM, and more.
160+
161+
162+
```shell
163+
# Create an external vault
164+
flow vault create passwords --type external --config /path/to/config.json
165+
```
166+
167+
**Template Variables**
168+
169+
Available in `cmd` and `output` fields:
170+
171+
- `{{key}}` - The secret key/name
172+
- `{{value}}` - The secret value (for set operations)
173+
- `{{env["VariableName"]}}`- Environment variable value
174+
- `{{output}}` - Raw command output (for output templates)
175+
176+
All [Expr language](https://expr-lang.org/docs/language-definition) operators and functions can be used in the command templates, allowing for powerful dynamic secret management.
177+
103178
<!-- tabs:end -->
104179

105180
#### Authentication
@@ -109,6 +184,9 @@ If you did not provide a key or file, these default environment variables will b
109184

110185
- For AES256 vaults: `FLOW_VAULT_KEY` environment variable
111186
- For Age vaults: `FLOW_VAULT_IDENTITY` environment variable
187+
- For Unencrypted vaults: no key is needed, it stores secrets in plain text
188+
- For Keyring vaults: no key is needed, it uses the OS keyring directly
189+
- For External vaults: no key is needed, it uses the external CLI tool directly. Auth may be required by the tool itself
112190

113191
At least one of the key or file will be used. You can configure key storage during vault creation:
114192

go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/charmbracelet/lipgloss v1.1.0
1010
github.com/charmbracelet/x/exp/teatest v0.0.0-20250806222409-83e3a29d542f
1111
github.com/flowexec/tuikit v0.2.3
12-
github.com/flowexec/vault v0.1.2
12+
github.com/flowexec/vault v0.2.1
1313
github.com/gen2brain/beeep v0.11.1
1414
github.com/jahvon/expression v0.1.3
1515
github.com/jahvon/glamour v0.8.1-patch3
@@ -32,6 +32,7 @@ require (
3232
)
3333

3434
require (
35+
al.essio.dev/pkg/shellescape v1.5.1 // indirect
3536
filippo.io/age v1.2.1 // indirect
3637
git.sr.ht/~jackmordaunt/go-toast v1.1.2 // indirect
3738
github.com/alecthomas/chroma/v2 v2.20.0 // indirect
@@ -50,6 +51,7 @@ require (
5051
github.com/charmbracelet/x/exp/strings v0.0.0-20250806222409-83e3a29d542f // indirect
5152
github.com/charmbracelet/x/term v0.2.1 // indirect
5253
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
54+
github.com/danieljoos/wincred v1.2.2 // indirect
5355
github.com/dlclark/regexp2 v1.11.5 // indirect
5456
github.com/dustin/go-humanize v1.0.1 // indirect
5557
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
@@ -90,6 +92,7 @@ require (
9092
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
9193
github.com/yuin/goldmark v1.7.13 // indirect
9294
github.com/yuin/goldmark-emoji v1.0.6 // indirect
95+
github.com/zalando/go-keyring v0.2.6 // indirect
9396
go.uber.org/automaxprocs v1.6.0 // indirect
9497
golang.org/x/net v0.42.0 // indirect
9598
golang.org/x/sys v0.35.0 // indirect

go.sum

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
al.essio.dev/pkg/shellescape v1.5.1 h1:86HrALUujYS/h+GtqoB26SBEdkWfmMI6FubjXlsXyho=
2+
al.essio.dev/pkg/shellescape v1.5.1/go.mod h1:6sIqp7X2P6mThCQ7twERpZTuigpr6KbZWtls1U8I890=
13
c2sp.org/CCTV/age v0.0.0-20240306222714-3ec4d716e805 h1:u2qwJeEvnypw+OCPUHmoZE3IqwfuN5kgDfo5MLzpNM0=
24
c2sp.org/CCTV/age v0.0.0-20240306222714-3ec4d716e805/go.mod h1:FomMrUJ2Lxt5jCLmZkG3FHa72zUprnhd3v/Z18Snm4w=
35
filippo.io/age v1.2.1 h1:X0TZjehAZylOIj4DubWYU1vWQxv9bJpo+Uu2/LGhi1o=
@@ -63,6 +65,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3
6365
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
6466
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
6567
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
68+
github.com/danieljoos/wincred v1.2.2 h1:774zMFJrqaeYCK2W57BgAem/MLi6mtSE47MB6BOJ0i0=
69+
github.com/danieljoos/wincred v1.2.2/go.mod h1:w7w4Utbrz8lqeMbDAK0lkNJUv5sAOkFi7nd/ogr0Uh8=
6670
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6771
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6872
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -78,8 +82,8 @@ github.com/expr-lang/expr v1.17.5 h1:i1WrMvcdLF249nSNlpQZN1S6NXuW9WaOfF5tPi3aw3k
7882
github.com/expr-lang/expr v1.17.5/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4=
7983
github.com/flowexec/tuikit v0.2.3 h1:hGlBc8yXvj4AXaKFp+IUNQ9nO7xOYY4W99m1BfNT13Q=
8084
github.com/flowexec/tuikit v0.2.3/go.mod h1:fjMwEM7FkxbP7bIV4CfEjsixgjicgQqPrejoBZAHf5s=
81-
github.com/flowexec/vault v0.1.2 h1:INQ/w81piKRM+zqPBQpxFYl1iK8dI3APIHZ1F1Jm7CA=
82-
github.com/flowexec/vault v0.1.2/go.mod h1:nxoGHIVjwSgg1o6DoTmj5NCJtubu71SvS883LPUXuvg=
85+
github.com/flowexec/vault v0.2.1 h1:IYII6iXhhzUc4o0arJVH8281so67L9V8HY8ary/kTps=
86+
github.com/flowexec/vault v0.2.1/go.mod h1:6JHONK+fTf8Zn7bOwejzbKTWuIh1BYHxgAwBc/XPXeY=
8387
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
8488
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
8589
github.com/gen2brain/beeep v0.11.1 h1:EbSIhrQZFDj1K2fzlMpAYlFOzV8YuNe721A58XcCTYI=
@@ -100,6 +104,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
100104
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
101105
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 h1:xhMrHhTJ6zxu3gA4enFM9MLn9AY7613teCdFnlUVbSQ=
102106
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA=
107+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
108+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
103109
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
104110
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
105111
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
@@ -187,6 +193,8 @@ github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
187193
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
188194
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
189195
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
196+
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
197+
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
190198
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
191199
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
192200
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
@@ -204,6 +212,8 @@ github.com/yuin/goldmark v1.7.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA=
204212
github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
205213
github.com/yuin/goldmark-emoji v1.0.6 h1:QWfF2FYaXwL74tfGOW5izeiZepUDroDJfWubQI9HTHs=
206214
github.com/yuin/goldmark-emoji v1.0.6/go.mod h1:ukxJDKFpdFb5x0a5HqbdlcKtebh086iJpI31LTKmWuA=
215+
github.com/zalando/go-keyring v0.2.6 h1:r7Yc3+H+Ux0+M72zacZoItR3UDxeWfKTcabvkI8ua9s=
216+
github.com/zalando/go-keyring v0.2.6/go.mod h1:2TCrxYrbUNYfNS/Kgy/LSrkSQzZ5UPVH85RwfczwvcI=
207217
go.etcd.io/bbolt v1.4.2 h1:IrUHp260R8c+zYx/Tm8QZr04CX+qWS5PGfPdevhdm1I=
208218
go.etcd.io/bbolt v1.4.2/go.mod h1:Is8rSHO/b4f3XigBC0lL0+4FwAQv3HXEEIgFMuKHceM=
209219
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=

internal/vault/v2/vault.go

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const (
1919
LegacyVaultReservedName = "legacy"
2020

2121
v2CacheDataDir = "vaults"
22+
keyringService = "io.flowexec.flow"
2223
)
2324

2425
type Vault = vault.Provider
@@ -101,6 +102,27 @@ func generateAESKey(keyEnv, logLevel string) string {
101102
return key
102103
}
103104

105+
func NewUnencryptedVault(name, storagePath string) {
106+
storagePath = utils.ExpandPath(storagePath, CacheDirectory(""), nil)
107+
if storagePath == "" {
108+
logger.Log().Fatalf("unable to expand storage path: %s", storagePath)
109+
}
110+
111+
opts := []vault.Option{vault.WithUnencryptedPath(storagePath), vault.WithProvider(vault.ProviderTypeUnencrypted)}
112+
113+
v, cfg, err := vault.New(name, opts...)
114+
if err != nil {
115+
logger.Log().FatalErr(err)
116+
}
117+
118+
cfgPath := ConfigFilePath(v.ID())
119+
if err = vault.SaveConfigJSON(*cfg, cfgPath); err != nil {
120+
logger.Log().FatalErr(fmt.Errorf("unable to save vault config: %w", err))
121+
}
122+
123+
logger.Log().PlainTextSuccess(fmt.Sprintf("Vault '%s' without encryption created successfully", v.ID()))
124+
}
125+
104126
func NewAgeVault(name, storagePath, recipients, identityKey, identityFile string) {
105127
storagePath = utils.ExpandPath(storagePath, CacheDirectory(""), nil)
106128
if storagePath == "" {
@@ -137,6 +159,51 @@ func NewAgeVault(name, storagePath, recipients, identityKey, identityFile string
137159
logger.Log().PlainTextSuccess(fmt.Sprintf("Vault '%s' with Age encryption created successfully", v.ID()))
138160
}
139161

162+
func NewKeyringVault(name string) {
163+
opts := []vault.Option{
164+
vault.WithKeyringService(fmt.Sprintf("%s.%s", keyringService, name)),
165+
vault.WithProvider(vault.ProviderTypeKeyring)}
166+
v, cfg, err := vault.New(name, opts...)
167+
if err != nil {
168+
logger.Log().FatalErr(err)
169+
}
170+
171+
cfgPath := ConfigFilePath(v.ID())
172+
if err = vault.SaveConfigJSON(*cfg, cfgPath); err != nil {
173+
logger.Log().FatalErr(fmt.Errorf("unable to save vault config: %w", err))
174+
}
175+
176+
logger.Log().PlainTextSuccess(fmt.Sprintf("Vault '%s' with Keyring encryption created successfully", v.ID()))
177+
}
178+
179+
func NewExternalVault(providerConfigFile string) {
180+
if providerConfigFile == "" {
181+
logger.Log().Fatalf("provider config file path cannot be empty")
182+
}
183+
184+
providerConfigFile = utils.ExpandPath(providerConfigFile, CacheDirectory(""), nil)
185+
if providerConfigFile == "" {
186+
logger.Log().Fatalf("unable to expand provider config file path: %s", providerConfigFile)
187+
}
188+
189+
cfg, err := vault.LoadConfigJSON(providerConfigFile)
190+
if err != nil {
191+
logger.Log().FatalErr(fmt.Errorf("failed to load vault config: %w", err))
192+
}
193+
194+
v, _, err := vault.New(cfg.ID, vault.WithExternalConfig(cfg.External))
195+
if err != nil {
196+
logger.Log().FatalErr(err)
197+
}
198+
199+
cfgPath := ConfigFilePath(v.ID())
200+
if err = vault.SaveConfigJSON(cfg, cfgPath); err != nil {
201+
logger.Log().FatalErr(fmt.Errorf("unable to save vault config: %w", err))
202+
}
203+
204+
logger.Log().PlainTextSuccess(fmt.Sprintf("Vault '%s' with external provider registered successfully", v.ID()))
205+
}
206+
140207
func VaultFromName(name string) (*VaultConfig, Vault, error) {
141208
if name == "" {
142209
return nil, nil, fmt.Errorf("vault name cannot be empty")
@@ -157,6 +224,16 @@ func VaultFromName(name string) (*VaultConfig, Vault, error) {
157224
case vault.ProviderTypeAES256:
158225
provider, err := vault.NewAES256Vault(&cfg)
159226
return &cfg, provider, err
227+
case vault.ProviderTypeUnencrypted:
228+
provider, err := vault.NewUnencryptedVault(&cfg)
229+
return &cfg, provider, err
230+
case vault.ProviderTypeKeyring:
231+
provider, err := vault.NewKeyringVault(&cfg)
232+
return &cfg, provider, err
233+
case vault.ProviderTypeExternal:
234+
// todo: rename this func in the vault pkg
235+
provider, err := vault.NewExternalVaultProvider(&cfg)
236+
return &cfg, provider, err
160237
default:
161238
return nil, nil, fmt.Errorf("unsupported vault type: %s", cfg.Type)
162239
}

0 commit comments

Comments
 (0)