http: support auth

This commit is contained in:
Mitchell Hashimoto
2015-03-29 16:14:54 -07:00
parent a573f89048
commit 06e06cde9c
9 changed files with 79 additions and 18 deletions

View File

@@ -9,9 +9,10 @@ import (
)
func TestLogical(t *testing.T) {
core, _ := vault.TestCoreUnsealed(t)
core, _, token := vault.TestCoreUnsealed(t)
ln, addr := TestServer(t, core)
defer ln.Close()
TestServerAuth(t, addr, token)
resp := testHttpPut(t, addr+"/v1/secret/foo", map[string]interface{}{
"data": "bar",
@@ -40,9 +41,10 @@ func TestLogical(t *testing.T) {
}
func TestLogical_noExist(t *testing.T) {
core, _ := vault.TestCoreUnsealed(t)
core, _, token := vault.TestCoreUnsealed(t)
ln, addr := TestServer(t, core)
defer ln.Close()
TestServerAuth(t, addr, token)
resp, err := http.Get(addr + "/v1/secret/foo")
if err != nil {