mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-25 06:15:01 +00:00
Add entity information request to system view (#4681)
* Add entity information request to system view * fixing a few comments * sharing types between plugin and logical * sharing types between plugin and logical * fixing output directory for proto * removing extra replacement * adding mount type lookup * empty entities return nil instead of error * adding some comments
This commit is contained in:
@@ -164,3 +164,26 @@ func TestSystem_GRPC_mlockEnabled(t *testing.T) {
|
||||
t.Fatalf("expected: %v, got: %v", expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSystem_GRPC_entityInfo(t *testing.T) {
|
||||
sys := logical.TestSystemView()
|
||||
sys.EntityVal = &logical.Entity{
|
||||
ID: "id",
|
||||
Name: "name",
|
||||
}
|
||||
client, _ := plugin.TestGRPCConn(t, func(s *grpc.Server) {
|
||||
pb.RegisterSystemViewServer(s, &gRPCSystemViewServer{
|
||||
impl: sys,
|
||||
})
|
||||
})
|
||||
defer client.Close()
|
||||
testSystemView := newGRPCSystemView(client)
|
||||
|
||||
actual, err := testSystemView.EntityInfo("")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if sys.EntityVal.ID != actual.ID || sys.EntityVal.Name != actual.Name {
|
||||
t.Fatalf("expected: %v, got: %v", sys.EntityVal, actual)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user