mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Plugins: Tighten requirements for multiplexing (#17403)
Change the multiplexing key to use all `PluginRunner` config (converted to a struct which is comparable), so that plugins with the same name but different env, args, types, versions etc are not incorrectly multiplexed together. Co-authored-by: Christopher Swenson <christopher.swenson@hashicorp.com>
This commit is contained in:
@@ -2,11 +2,14 @@ package mock
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
"github.com/hashicorp/vault/sdk/framework"
|
||||
"github.com/hashicorp/vault/sdk/logical"
|
||||
)
|
||||
|
||||
const MockPluginVersionEnv = "TESTING_MOCK_VAULT_PLUGIN_VERSION"
|
||||
|
||||
// New returns a new backend as an interface. This func
|
||||
// is only necessary for builtin backend plugins.
|
||||
func New() (interface{}, error) {
|
||||
@@ -60,6 +63,9 @@ func Backend() *backend {
|
||||
}
|
||||
b.internal = "bar"
|
||||
b.RunningVersion = "v0.0.0+mock"
|
||||
if version := os.Getenv(MockPluginVersionEnv); version != "" {
|
||||
b.RunningVersion = version
|
||||
}
|
||||
return &b
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user