VAULT-18157: Audit events: Log Test Message (#22263)

* manually crank the nodes to log a test message (if we have them configured)
* try to extract the duplicated manual processing of nodes
This commit is contained in:
Peter Wilson
2023-08-09 21:04:31 +01:00
committed by GitHub
parent 24a1941b35
commit 32b6a5c840
5 changed files with 303 additions and 0 deletions

View File

@@ -224,6 +224,12 @@ func (b *Backend) LogResponse(ctx context.Context, in *logical.LogInput) error {
}
func (b *Backend) LogTestMessage(ctx context.Context, in *logical.LogInput, config map[string]string) error {
// Event logger behavior - manually Process each node
if len(b.nodeIDList) > 0 {
return audit.ProcessManual(ctx, in, b.nodeIDList, b.nodeMap)
}
// Old behavior
var buf bytes.Buffer
temporaryFormatter, err := audit.NewTemporaryFormatter(config["format"], config["prefix"])