mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
Check if sys view is missing in GRPC sys view (#18210)
And return an error instead of panicking. This situation can occur if a plugin attempts to access the system view during setup when Vault is checking the plugin metadata. Fixes #17878.
This commit is contained in:
committed by
GitHub
parent
456ac93ce5
commit
eabc486b1a
@@ -6,7 +6,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
plugin "github.com/hashicorp/go-plugin"
|
||||
"github.com/hashicorp/go-plugin"
|
||||
"github.com/hashicorp/vault/sdk/helper/consts"
|
||||
"github.com/hashicorp/vault/sdk/logical"
|
||||
"github.com/hashicorp/vault/sdk/plugin/pb"
|
||||
@@ -14,6 +14,13 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func TestSystem_GRPC_ReturnsErrIfSystemViewNil(t *testing.T) {
|
||||
_, err := new(gRPCSystemViewServer).ReplicationState(context.Background(), nil)
|
||||
if err == nil {
|
||||
t.Error("Expected error when using server with no impl")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSystem_GRPC_GRPC_impl(t *testing.T) {
|
||||
var _ logical.SystemView = new(gRPCSystemViewClient)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user