mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 18:17:55 +00:00
Delay salt initialization for audit backends
This commit is contained in:
@@ -5,13 +5,15 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/hashicorp/vault/helper/salt"
|
||||
"github.com/jefferai/jsonx"
|
||||
)
|
||||
|
||||
// JSONxFormatWriter is an AuditFormatWriter implementation that structures data into
|
||||
// a XML format.
|
||||
type JSONxFormatWriter struct {
|
||||
Prefix string
|
||||
Prefix string
|
||||
SaltFunc func() (*salt.Salt, error)
|
||||
}
|
||||
|
||||
func (f *JSONxFormatWriter) WriteRequest(w io.Writer, req *AuditRequestEntry) error {
|
||||
@@ -65,3 +67,7 @@ func (f *JSONxFormatWriter) WriteResponse(w io.Writer, resp *AuditResponseEntry)
|
||||
_, err = w.Write(xmlBytes)
|
||||
return err
|
||||
}
|
||||
|
||||
func (f *JSONxFormatWriter) Salt() (*salt.Salt, error) {
|
||||
return f.SaltFunc()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user