Skip to content

Commit

Permalink
Change impl
Browse files Browse the repository at this point in the history
  • Loading branch information
divyaac committed Jul 7, 2023
1 parent 0b8e06c commit 214e0ef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
5 changes: 0 additions & 5 deletions helper/builtinplugins/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,6 @@ func (r *registry) DeprecationStatus(name string, pluginType consts.PluginType)
return consts.Unknown, false
}

// IsBuiltinEntPlugin checks whether the plugin is an enterprise only builtin plugin
func (r *registry) IsBuiltinEntPlugin(name string, pluginType consts.PluginType) bool {
return false
}

func toFunc(ifc interface{}) func() (interface{}, error) {
return func() (interface{}, error) {
return ifc, nil
Expand Down
9 changes: 9 additions & 0 deletions helper/builtinplugins/registry_util.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// go: build !enterprise
package builtinplugins

import "github.com/hashicorp/vault/sdk/helper/consts"

// IsBuiltinEntPlugin checks whether the plugin is an enterprise only builtin plugin
func (r *registry) IsBuiltinEntPlugin(name string, pluginType consts.PluginType) bool {
return false
}
16 changes: 0 additions & 16 deletions helper/testhelpers/corehelpers/corehelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import (
"github.com/mitchellh/go-testing-interface"
)

var externalPlugins = []string{""}

// RetryUntil runs f until it returns a nil result or the timeout is reached.
// If a nil result hasn't been obtained by timeout, calls t.Fatal.
func RetryUntil(t testing.T, timeout time.Duration, f func() error) {
Expand Down Expand Up @@ -182,23 +180,9 @@ func (m *mockBuiltinRegistry) Keys(pluginType consts.PluginType) []string {
"pending-removal-test-plugin",
"approle",
}

case consts.PluginTypeSecrets:
return append(externalPlugins, "kv")
}

return []string{}
}

func (r *mockBuiltinRegistry) IsBuiltinEntPlugin(name string, pluginType consts.PluginType) bool {
for _, i := range externalPlugins {
if i == name {
return true
}
}
return false
}

func (m *mockBuiltinRegistry) Contains(name string, pluginType consts.PluginType) bool {
for _, key := range m.Keys(pluginType) {
if key == name {
Expand Down
1 change: 0 additions & 1 deletion vault/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -3181,7 +3181,6 @@ type BuiltinRegistry interface {
Get(name string, pluginType consts.PluginType) (func() (interface{}, error), bool)
Keys(pluginType consts.PluginType) []string
DeprecationStatus(name string, pluginType consts.PluginType) (consts.DeprecationStatus, bool)
IsBuiltinEntPlugin(name string, pluginType consts.PluginType) bool
}

func (c *Core) AuditLogger() AuditLogger {
Expand Down

0 comments on commit 214e0ef

Please sign in to comment.