mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 02:57:59 +00:00
Delay salt initialization for audit backends
This commit is contained in:
@@ -4,12 +4,15 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/hashicorp/vault/helper/salt"
|
||||
)
|
||||
|
||||
// JSONFormatWriter is an AuditFormatWriter implementation that structures data into
|
||||
// a JSON format.
|
||||
type JSONFormatWriter struct {
|
||||
Prefix string
|
||||
Prefix string
|
||||
SaltFunc func() (*salt.Salt, error)
|
||||
}
|
||||
|
||||
func (f *JSONFormatWriter) WriteRequest(w io.Writer, req *AuditRequestEntry) error {
|
||||
@@ -43,3 +46,7 @@ func (f *JSONFormatWriter) WriteResponse(w io.Writer, resp *AuditResponseEntry)
|
||||
enc := json.NewEncoder(w)
|
||||
return enc.Encode(resp)
|
||||
}
|
||||
|
||||
func (f *JSONFormatWriter) Salt() (*salt.Salt, error) {
|
||||
return f.SaltFunc()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user