From d959ffc3010201d2d145d79e32a5e88f4205dc1c Mon Sep 17 00:00:00 2001 From: vishalnayak Date: Fri, 18 Mar 2016 10:37:49 -0400 Subject: [PATCH] Rename PrepareRequest to PrepareRequestFunc --- http/logical.go | 4 ++-- vault/logical_system_test.go | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/http/logical.go b/http/logical.go index 4200e38b1..2502ec1f9 100644 --- a/http/logical.go +++ b/http/logical.go @@ -11,9 +11,9 @@ import ( "github.com/hashicorp/vault/vault" ) -type PrepareRequest func(req *logical.Request) error +type PrepareRequestFunc func(req *logical.Request) error -func handleLogical(core *vault.Core, dataOnly bool, prepareRequestCallback PrepareRequest) http.Handler { +func handleLogical(core *vault.Core, dataOnly bool, prepareRequestCallback PrepareRequestFunc) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Determine the path... if !strings.HasPrefix(r.URL.Path, "/v1/") { diff --git a/vault/logical_system_test.go b/vault/logical_system_test.go index 375582bcd..a682689ed 100644 --- a/vault/logical_system_test.go +++ b/vault/logical_system_test.go @@ -2,6 +2,7 @@ package vault import ( "crypto/sha256" + "log" "reflect" "testing" "time" @@ -113,6 +114,18 @@ func TestSystemBackend_unmount(t *testing.T) { } } +func TestSystemBackend_CapabilitiesAccessor(t *testing.T) { + core, b, token := testCoreSystemBackend(t) + req := logical.TestRequest(t, logical.UpdateOperation, "capabilities-accessor") + lookupResp, err := core.tokenStore.Lookup(token) + if err != nil { + t.Fatalf(err) + } + log.Printf("b: %#v\n", b) + log.Printf("req: %#v\n", req) + log.Printf("lookupResp: %#v\n", lookupResp) +} + func TestSystemBackend_unmount_invalid(t *testing.T) { b := testSystemBackend(t)