summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2017-08-05 22:31:40 -0400
committerDave Henderson <dhenderson@gmail.com>2017-08-05 22:31:40 -0400
commitedff3dce66b227863f04dea45a8bf7f00988afad (patch)
treec1a5e7f6fdd2110f53620b6723be74ab9936b850
parenta45f86da5019d003a47fe41ae1749b8c5303be65 (diff)
Adding a couple extra integration tests for vault
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
-rw-r--r--test/integration/datasources_vault.bats18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/integration/datasources_vault.bats b/test/integration/datasources_vault.bats
index e4fa6b1e..aa6e27f3 100644
--- a/test/integration/datasources_vault.bats
+++ b/test/integration/datasources_vault.bats
@@ -140,6 +140,24 @@ function teardown () {
[[ "${output}" == "10.1.2.3" ]]
}
+@test "Testing vault auth with dynamic secret using prefix and options in URL" {
+ vault mount ssh
+ vault write ssh/roles/test key_type=otp default_user=user cidr_list=10.0.0.0/8
+ VAULT_TOKEN=$(vault token-create -format=json -policy=writepol -use-limit=2 -ttl=1m | jq -j .auth.client_token)
+ VAULT_TOKEN=$VAULT_TOKEN gomplate -d vault=vault:///ssh/creds/test?ip=10.1.2.3\&username=user -i '{{(datasource "vault").ip}}'
+ [ "$status" -eq 0 ]
+ [[ "${output}" == "10.1.2.3" ]]
+}
+
+@test "Testing vault auth with dynamic secret using options in URL and path in template" {
+ vault mount ssh
+ vault write ssh/roles/test key_type=otp default_user=user cidr_list=10.0.0.0/8
+ VAULT_TOKEN=$(vault token-create -format=json -policy=writepol -use-limit=2 -ttl=1m | jq -j .auth.client_token)
+ VAULT_TOKEN=$VAULT_TOKEN gomplate -d vault=vault:///?ip=10.1.2.3\&username=user -i '{{(datasource "vault" "ssh/creds/test").ip}}'
+ [ "$status" -eq 0 ]
+ [[ "${output}" == "10.1.2.3" ]]
+}
+
# TODO: test the github auth backend at some point... this needs a github token though, so...
# vault write auth/github/config organization=DockerOttawaMeetup
# vault write auth/github/map/teams/organizers value=pol