mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
backport of commit e6427b2b30 (#19620)
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
4285eb5c54
commit
435824c26c
4
changelog/19593.txt
Normal file
4
changelog/19593.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
```release-note:improvement
|
||||||
|
events: Suppress log warnings triggered when events are sent but the events system is not enabled.
|
||||||
|
```
|
||||||
|
|
||||||
@@ -34,6 +34,10 @@ type GRPCEventsServer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *GRPCEventsServer) SendEvent(ctx context.Context, req *pb.SendEventRequest) (*pb.Empty, error) {
|
func (s *GRPCEventsServer) SendEvent(ctx context.Context, req *pb.SendEventRequest) (*pb.Empty, error) {
|
||||||
|
if s.impl == nil {
|
||||||
|
return &pb.Empty{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
err := s.impl.Send(ctx, logical.EventType(req.EventType), req.Event)
|
err := s.impl.Send(ctx, logical.EventType(req.EventType), req.Event)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/hashicorp/go-secure-stdlib/strutil"
|
"github.com/hashicorp/go-secure-stdlib/strutil"
|
||||||
"github.com/hashicorp/go-uuid"
|
"github.com/hashicorp/go-uuid"
|
||||||
"github.com/hashicorp/vault/builtin/plugin"
|
"github.com/hashicorp/vault/builtin/plugin"
|
||||||
|
"github.com/hashicorp/vault/helper/experiments"
|
||||||
"github.com/hashicorp/vault/helper/namespace"
|
"github.com/hashicorp/vault/helper/namespace"
|
||||||
"github.com/hashicorp/vault/helper/versions"
|
"github.com/hashicorp/vault/helper/versions"
|
||||||
"github.com/hashicorp/vault/sdk/helper/consts"
|
"github.com/hashicorp/vault/sdk/helper/consts"
|
||||||
@@ -1001,12 +1002,14 @@ func (c *Core) newCredentialBackend(ctx context.Context, entry *MountEntry, sysV
|
|||||||
}
|
}
|
||||||
|
|
||||||
config := &logical.BackendConfig{
|
config := &logical.BackendConfig{
|
||||||
StorageView: view,
|
StorageView: view,
|
||||||
Logger: authLogger,
|
Logger: authLogger,
|
||||||
Config: conf,
|
Config: conf,
|
||||||
System: sysView,
|
System: sysView,
|
||||||
BackendUUID: entry.BackendAwareUUID,
|
BackendUUID: entry.BackendAwareUUID,
|
||||||
EventsSender: pluginEventSender,
|
}
|
||||||
|
if c.IsExperimentEnabled(experiments.VaultExperimentEventsAlpha1) {
|
||||||
|
config.EventsSender = pluginEventSender
|
||||||
}
|
}
|
||||||
|
|
||||||
b, err := f(ctx, config)
|
b, err := f(ctx, config)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
"github.com/hashicorp/go-secure-stdlib/strutil"
|
"github.com/hashicorp/go-secure-stdlib/strutil"
|
||||||
"github.com/hashicorp/go-uuid"
|
"github.com/hashicorp/go-uuid"
|
||||||
"github.com/hashicorp/vault/builtin/plugin"
|
"github.com/hashicorp/vault/builtin/plugin"
|
||||||
|
"github.com/hashicorp/vault/helper/experiments"
|
||||||
"github.com/hashicorp/vault/helper/metricsutil"
|
"github.com/hashicorp/vault/helper/metricsutil"
|
||||||
"github.com/hashicorp/vault/helper/namespace"
|
"github.com/hashicorp/vault/helper/namespace"
|
||||||
"github.com/hashicorp/vault/helper/versions"
|
"github.com/hashicorp/vault/helper/versions"
|
||||||
@@ -1660,12 +1661,14 @@ func (c *Core) newLogicalBackend(ctx context.Context, entry *MountEntry, sysView
|
|||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
config := &logical.BackendConfig{
|
config := &logical.BackendConfig{
|
||||||
StorageView: view,
|
StorageView: view,
|
||||||
Logger: backendLogger,
|
Logger: backendLogger,
|
||||||
Config: conf,
|
Config: conf,
|
||||||
System: sysView,
|
System: sysView,
|
||||||
BackendUUID: entry.BackendAwareUUID,
|
BackendUUID: entry.BackendAwareUUID,
|
||||||
EventsSender: pluginEventSender,
|
}
|
||||||
|
if c.IsExperimentEnabled(experiments.VaultExperimentEventsAlpha1) {
|
||||||
|
config.EventsSender = pluginEventSender
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = context.WithValue(ctx, "core_number", c.coreNumber)
|
ctx = context.WithValue(ctx, "core_number", c.coreNumber)
|
||||||
|
|||||||
Reference in New Issue
Block a user