-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adds rudimentary support for KV version 2 secret fetching.
- Update some upstream packages via go mod tidy; go mod vendor
- Loading branch information
Showing
1,460 changed files
with
289,717 additions
and
2,360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package secrets | ||
|
||
import ( | ||
"io/ioutil" | ||
"os" | ||
"testing" | ||
|
||
kv "github.com/hashicorp/vault-plugin-secrets-kv" | ||
"github.com/hashicorp/vault/api" | ||
vaulthttp "github.com/hashicorp/vault/http" | ||
"github.com/hashicorp/vault/sdk/logical" | ||
"github.com/hashicorp/vault/vault" | ||
) | ||
|
||
func startVaultTestCluster(t *testing.T) (*vault.TestCluster, *api.Client) { | ||
coreConfig := &vault.CoreConfig{ | ||
LogicalBackends: map[string]logical.Factory{ | ||
"kv": kv.Factory, | ||
}, | ||
} | ||
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{ | ||
HandlerFunc: vaulthttp.Handler, | ||
NumCores: 1, | ||
}) | ||
|
||
cluster.Start() | ||
|
||
core := cluster.Cores[0] | ||
vault.TestWaitActive(t, core.Core) | ||
client := core.Client | ||
|
||
err := client.Sys().Mount("kv", &api.MountInput{ | ||
Type: "kv-v2", | ||
}) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
return cluster, client | ||
} | ||
|
||
func generateTestFile(prefix string) (*os.File, error) { | ||
file, err := ioutil.TempFile(os.TempDir(), prefix) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return file, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.