mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-03 12:07:54 +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:
@@ -57,6 +57,10 @@ type SystemView interface {
|
||||
// MlockEnabled returns the configuration setting for enabling mlock on
|
||||
// plugins.
|
||||
MlockEnabled() bool
|
||||
|
||||
// EntityInfo returns a subset of information related to the identity entity
|
||||
// for the given entity id
|
||||
EntityInfo(entityID string) (*Entity, error)
|
||||
}
|
||||
|
||||
type StaticSystemView struct {
|
||||
@@ -69,6 +73,7 @@ type StaticSystemView struct {
|
||||
EnableMlock bool
|
||||
LocalMountVal bool
|
||||
ReplicationStateVal consts.ReplicationState
|
||||
EntityVal *Entity
|
||||
}
|
||||
|
||||
func (d StaticSystemView) DefaultLeaseTTL() time.Duration {
|
||||
@@ -110,3 +115,7 @@ func (d StaticSystemView) LookupPlugin(_ context.Context, name string) (*pluginu
|
||||
func (d StaticSystemView) MlockEnabled() bool {
|
||||
return d.EnableMlock
|
||||
}
|
||||
|
||||
func (d StaticSystemView) EntityInfo(entityID string) (*Entity, error) {
|
||||
return d.EntityVal, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user