ad28263b69
Move audit.LogInput to sdk/logical. Allow the Data values in audited logical.Request and Response to implement OptMarshaler, in which case we delegate hashing/serializing responsibility to them. Add new ClientCertificateSerialNumber audit request field. SystemView can now be cast to ExtendedSystemView to expose the Auditor interface, which allows submitting requests and responses to the audit broker.
27 lines
662 B
Go
27 lines
662 B
Go
package audit
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
|
|
"github.com/hashicorp/vault/sdk/logical"
|
|
)
|
|
|
|
// Formatter is an interface that is responsible for formating a
|
|
// request/response into some format. Formatters write their output
|
|
// to an io.Writer.
|
|
//
|
|
// It is recommended that you pass data through Hash prior to formatting it.
|
|
type Formatter interface {
|
|
FormatRequest(context.Context, io.Writer, FormatterConfig, *logical.LogInput) error
|
|
FormatResponse(context.Context, io.Writer, FormatterConfig, *logical.LogInput) error
|
|
}
|
|
|
|
type FormatterConfig struct {
|
|
Raw bool
|
|
HMACAccessor bool
|
|
|
|
// This should only ever be used in a testing context
|
|
OmitTime bool
|
|
}
|