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:
@@ -1,7 +1,6 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
@@ -14,10 +13,7 @@ func TestSysMounts(t *testing.T) {
|
||||
defer ln.Close()
|
||||
TestServerAuth(t, addr, token)
|
||||
|
||||
resp, err := http.Get(addr + "/v1/sys/mounts")
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
resp := testHttpGet(t, token, addr+"/v1/sys/mounts")
|
||||
|
||||
var actual map[string]interface{}
|
||||
expected := map[string]interface{}{
|
||||
@@ -43,16 +39,13 @@ func TestSysMount(t *testing.T) {
|
||||
defer ln.Close()
|
||||
TestServerAuth(t, addr, token)
|
||||
|
||||
resp := testHttpPost(t, addr+"/v1/sys/mounts/foo", map[string]interface{}{
|
||||
resp := testHttpPost(t, token, addr+"/v1/sys/mounts/foo", map[string]interface{}{
|
||||
"type": "generic",
|
||||
"description": "foo",
|
||||
})
|
||||
testResponseStatus(t, resp, 204)
|
||||
|
||||
resp, err := http.Get(addr + "/v1/sys/mounts")
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
resp = testHttpGet(t, token, addr+"/v1/sys/mounts")
|
||||
|
||||
var actual map[string]interface{}
|
||||
expected := map[string]interface{}{
|
||||
@@ -82,7 +75,7 @@ func TestSysMount_put(t *testing.T) {
|
||||
defer ln.Close()
|
||||
TestServerAuth(t, addr, token)
|
||||
|
||||
resp := testHttpPut(t, addr+"/v1/sys/mounts/foo", map[string]interface{}{
|
||||
resp := testHttpPut(t, token, addr+"/v1/sys/mounts/foo", map[string]interface{}{
|
||||
"type": "generic",
|
||||
"description": "foo",
|
||||
})
|
||||
@@ -98,22 +91,19 @@ func TestSysRemount(t *testing.T) {
|
||||
defer ln.Close()
|
||||
TestServerAuth(t, addr, token)
|
||||
|
||||
resp := testHttpPost(t, addr+"/v1/sys/mounts/foo", map[string]interface{}{
|
||||
resp := testHttpPost(t, token, addr+"/v1/sys/mounts/foo", map[string]interface{}{
|
||||
"type": "generic",
|
||||
"description": "foo",
|
||||
})
|
||||
testResponseStatus(t, resp, 204)
|
||||
|
||||
resp = testHttpPost(t, addr+"/v1/sys/remount", map[string]interface{}{
|
||||
resp = testHttpPost(t, token, addr+"/v1/sys/remount", map[string]interface{}{
|
||||
"from": "foo",
|
||||
"to": "bar",
|
||||
})
|
||||
testResponseStatus(t, resp, 204)
|
||||
|
||||
resp, err := http.Get(addr + "/v1/sys/mounts")
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
resp = testHttpGet(t, token, addr+"/v1/sys/mounts")
|
||||
|
||||
var actual map[string]interface{}
|
||||
expected := map[string]interface{}{
|
||||
@@ -143,19 +133,16 @@ func TestSysUnmount(t *testing.T) {
|
||||
defer ln.Close()
|
||||
TestServerAuth(t, addr, token)
|
||||
|
||||
resp := testHttpPost(t, addr+"/v1/sys/mounts/foo", map[string]interface{}{
|
||||
resp := testHttpPost(t, token, addr+"/v1/sys/mounts/foo", map[string]interface{}{
|
||||
"type": "generic",
|
||||
"description": "foo",
|
||||
})
|
||||
testResponseStatus(t, resp, 204)
|
||||
|
||||
resp = testHttpDelete(t, addr+"/v1/sys/mounts/foo")
|
||||
resp = testHttpDelete(t, token, addr+"/v1/sys/mounts/foo")
|
||||
testResponseStatus(t, resp, 204)
|
||||
|
||||
resp, err := http.Get(addr + "/v1/sys/mounts")
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
resp = testHttpGet(t, token, addr+"/v1/sys/mounts")
|
||||
|
||||
var actual map[string]interface{}
|
||||
expected := map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user