mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Remove cookie authentication.
This commit is contained in:
@@ -2,7 +2,6 @@ package http
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/vault/vault"
|
||||
@@ -15,18 +14,14 @@ func TestSysRenew(t *testing.T) {
|
||||
TestServerAuth(t, addr, token)
|
||||
|
||||
// write secret
|
||||
resp := testHttpPut(t, addr+"/v1/secret/foo", map[string]interface{}{
|
||||
resp := testHttpPut(t, token, addr+"/v1/secret/foo", map[string]interface{}{
|
||||
"data": "bar",
|
||||
"lease": "1h",
|
||||
})
|
||||
testResponseStatus(t, resp, 204)
|
||||
|
||||
// read secret
|
||||
resp, err := http.Get(addr + "/v1/secret/foo")
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
resp = testHttpGet(t, token, addr+"/v1/secret/foo")
|
||||
var result struct {
|
||||
LeaseId string `json:"lease_id"`
|
||||
}
|
||||
@@ -35,7 +30,7 @@ func TestSysRenew(t *testing.T) {
|
||||
t.Fatalf("bad: %s", err)
|
||||
}
|
||||
|
||||
resp = testHttpPut(t, addr+"/v1/sys/renew/"+result.LeaseId, nil)
|
||||
resp = testHttpPut(t, token, addr+"/v1/sys/renew/"+result.LeaseId, nil)
|
||||
testResponseStatus(t, resp, 200)
|
||||
}
|
||||
|
||||
@@ -45,7 +40,7 @@ func TestSysRevoke(t *testing.T) {
|
||||
defer ln.Close()
|
||||
TestServerAuth(t, addr, token)
|
||||
|
||||
resp := testHttpPut(t, addr+"/v1/sys/revoke/secret/foo/1234", nil)
|
||||
resp := testHttpPut(t, token, addr+"/v1/sys/revoke/secret/foo/1234", nil)
|
||||
testResponseStatus(t, resp, 204)
|
||||
}
|
||||
|
||||
@@ -55,6 +50,6 @@ func TestSysRevokePrefix(t *testing.T) {
|
||||
defer ln.Close()
|
||||
TestServerAuth(t, addr, token)
|
||||
|
||||
resp := testHttpPut(t, addr+"/v1/sys/revoke-prefix/secret/foo/1234", nil)
|
||||
resp := testHttpPut(t, token, addr+"/v1/sys/revoke-prefix/secret/foo/1234", nil)
|
||||
testResponseStatus(t, resp, 204)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user