VAULT-24013: Audit regression attempting to recover from panic (#25605)

* Add Logger to BackendConfig

* EntryFormatter use logger and recover panics

* Added TODO to consider

* Add 'name' to entry formatter

* Add test for the panic

* Fix NoopAudit with update params

* emit counter metric even when 0

* Fix vault package tests

* changelog

* Remove old comment during test writing
This commit is contained in:
Peter Wilson
2024-02-26 10:33:30 +00:00
committed by GitHub
parent 273ba49195
commit 67c16342d8
14 changed files with 255 additions and 64 deletions

View File

@@ -6,6 +6,7 @@ package audit
import (
"context"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/internal/observability/event"
"github.com/hashicorp/vault/sdk/helper/salt"
"github.com/hashicorp/vault/sdk/logical"
@@ -231,6 +232,9 @@ type BackendConfig struct {
// MountPath is the path where this Backend is mounted
MountPath string
// Logger is used to emit log messages usually captured in the server logs.
Logger hclog.Logger
}
// Factory is the factory function to create an audit backend.