Rename PrepareRequest to PrepareRequestFunc

This commit is contained in:
vishalnayak 2016-03-18 10:37:49 -04:00
parent fbfe72f286
commit d959ffc301
2 changed files with 15 additions and 2 deletions

View file

@ -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/") {

View file

@ -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)