diff --git a/builtin/logical/consul/backend.go b/builtin/logical/consul/backend.go index 7442eb660..113258ede 100644 --- a/builtin/logical/consul/backend.go +++ b/builtin/logical/consul/backend.go @@ -9,7 +9,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) { return Backend().Setup(conf) } -func Backend() *framework.Backend { +func Backend() *backend { var b backend b.Backend = &framework.Backend{ Paths: []*framework.Path{ @@ -23,7 +23,7 @@ func Backend() *framework.Backend { }, } - return b.Backend + return &b } type backend struct { diff --git a/builtin/logical/consul/backend_test.go b/builtin/logical/consul/backend_test.go index 1830e3c8b..9b11f8573 100644 --- a/builtin/logical/consul/backend_test.go +++ b/builtin/logical/consul/backend_test.go @@ -15,33 +15,10 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/vault/logical" - "github.com/hashicorp/vault/logical/framework" logicaltest "github.com/hashicorp/vault/logical/testing" "github.com/mitchellh/mapstructure" ) -func createBackend() *backend { - var b backend - b.Backend = &framework.Backend{ - PathsSpecial: &logical.Paths{ - Root: []string{ - "config/*", - }, - }, - - Paths: []*framework.Path{ - pathConfigAccess(), - pathRoles(), - pathToken(&b), - }, - - Secrets: []*framework.Secret{ - secretToken(&b), - }, - } - return &b -} - func TestBackend_config_access(t *testing.T) { if os.Getenv(logicaltest.TestEnvVar) == "" { t.Skip(fmt.Sprintf("Acceptance tests skipped unless env '%s' set", logicaltest.TestEnvVar)) @@ -55,8 +32,8 @@ func TestBackend_config_access(t *testing.T) { storage := &logical.InmemStorage{} config.StorageView = storage - b := createBackend() - _, err := b.Backend.Setup(config) + b := Backend() + _, err := b.Setup(config) if err != nil { t.Fatal(err) }