mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
unexport as much as possible in the audit package (#28039)
This commit is contained in:
@@ -42,7 +42,7 @@ type formatterConfig struct {
|
||||
// This should only ever be used in a testing context
|
||||
omitTime bool
|
||||
|
||||
// The required/target format for the event (supported: JSONFormat and JSONxFormat).
|
||||
// The required/target format for the event (supported: jsonFormat and jsonxFormat).
|
||||
requiredFormat format
|
||||
|
||||
// headerFormatter specifies the formatter used for headers that existing in any incoming audit request.
|
||||
@@ -58,14 +58,14 @@ func newFormatterConfig(headerFormatter HeaderFormatter, config map[string]strin
|
||||
return formatterConfig{}, fmt.Errorf("header formatter is required: %w", ErrInvalidParameter)
|
||||
}
|
||||
|
||||
var opt []Option
|
||||
var opt []option
|
||||
|
||||
if format, ok := config[optionFormat]; ok {
|
||||
if !IsValidFormat(format) {
|
||||
if !isValidFormat(format) {
|
||||
return formatterConfig{}, fmt.Errorf("unsupported %q: %w", optionFormat, ErrExternalOptions)
|
||||
}
|
||||
|
||||
opt = append(opt, WithFormat(format))
|
||||
opt = append(opt, withFormat(format))
|
||||
}
|
||||
|
||||
// Check if hashing of accessor is disabled
|
||||
@@ -74,7 +74,7 @@ func newFormatterConfig(headerFormatter HeaderFormatter, config map[string]strin
|
||||
if err != nil {
|
||||
return formatterConfig{}, fmt.Errorf("unable to parse %q: %w", optionHMACAccessor, ErrExternalOptions)
|
||||
}
|
||||
opt = append(opt, WithHMACAccessor(v))
|
||||
opt = append(opt, withHMACAccessor(v))
|
||||
}
|
||||
|
||||
// Check if raw logging is enabled
|
||||
@@ -83,7 +83,7 @@ func newFormatterConfig(headerFormatter HeaderFormatter, config map[string]strin
|
||||
if err != nil {
|
||||
return formatterConfig{}, fmt.Errorf("unable to parse %q: %w", optionLogRaw, ErrExternalOptions)
|
||||
}
|
||||
opt = append(opt, WithRaw(v))
|
||||
opt = append(opt, withRaw(v))
|
||||
}
|
||||
|
||||
if elideListResponsesRaw, ok := config[optionElideListResponses]; ok {
|
||||
@@ -91,11 +91,11 @@ func newFormatterConfig(headerFormatter HeaderFormatter, config map[string]strin
|
||||
if err != nil {
|
||||
return formatterConfig{}, fmt.Errorf("unable to parse %q: %w", optionElideListResponses, ErrExternalOptions)
|
||||
}
|
||||
opt = append(opt, WithElision(v))
|
||||
opt = append(opt, withElision(v))
|
||||
}
|
||||
|
||||
if prefix, ok := config[optionPrefix]; ok {
|
||||
opt = append(opt, WithPrefix(prefix))
|
||||
opt = append(opt, withPrefix(prefix))
|
||||
}
|
||||
|
||||
opts, err := getOpts(opt...)
|
||||
|
||||
Reference in New Issue
Block a user