-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VAULT-24798: audit - improve error messages #26312
VAULT-24798: audit - improve error messages #26312
Conversation
CI Results: |
Build Results: |
sdk/go.sum
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go mod tidy
not sure why this got fiddled with though.
@@ -36,34 +35,92 @@ type timeProvider interface { | |||
formattedTime() string | |||
} | |||
|
|||
// FormatterConfig is used to provide basic configuration to a formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FormatterConfig
is moved from audit/types.go
type EntryFormatter struct { | ||
config FormatterConfig | ||
salter Salter | ||
logger hclog.Logger | ||
name string | ||
} | ||
|
||
// NewFormatterConfig should be used to create a FormatterConfig. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewFormatterConfig
is moved up from lower down in the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, definitely a bit easier to consume these error messages!
This PR removes the
op
which was formerly part of all error messages in the audit sub-system.The idea is to make the errors we show to the user expose less of the guts of Vault (no mention of
file.Factory
etc.).It defines some typed errors which are used with wrapping to try and give us an idea of what was happening (
audit/errors.go
), including if we want to return a more generic error to the caller (for the case of internal errors).Some receipts for the changes:
ENT PR: https://github.com/hashicorp/vault-enterprise/pull/5688