Rename PrepareRequest to PrepareRequestFunc
This commit is contained in:
parent
fbfe72f286
commit
d959ffc301
|
@ -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/") {
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue