Skip to content

Commit

Permalink
Make tests work with vault 0.7.x (#313)
Browse files Browse the repository at this point in the history
Starting with Vault 0.7 list operations always use paths with a trailing
slash, so the policy used in testing has to allow that path in addition
to the one without a trailing slash.
  • Loading branch information
pschultz authored and magiconair committed Jun 28, 2017
1 parent e5f6a43 commit 205753e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ before_script:
- mkdir -p $GOPATH/bin
- wget --version
- wget https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip
- wget https://releases.hashicorp.com/vault/0.6.5/vault_0.6.5_linux_amd64.zip
- wget https://releases.hashicorp.com/vault/0.7.3/vault_0.7.3_linux_amd64.zip
- unzip -d $GOPATH/bin consul_0.8.3_linux_amd64.zip
- unzip -d $GOPATH/bin vault_0.6.5_linux_amd64.zip
- unzip -d $GOPATH/bin vault_0.7.3_linux_amd64.zip
- vault --version
- consul --version
5 changes: 5 additions & 0 deletions cert/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,14 @@ func vaultServer(t *testing.T, addr, rootToken string) (*exec.Cmd, *vaultapi.Cli
}

policy := `
# Vault < 0.7
path "secret/fabio/cert" {
capabilities = ["list"]
}
# Vault >= 0.7. Note the trailing slash.
path "secret/fabio/cert/" {
capabilities = ["list"]
}
path "secret/fabio/cert/*" {
capabilities = ["read"]
Expand Down

0 comments on commit 205753e

Please sign in to comment.