-
Notifications
You must be signed in to change notification settings - Fork 42
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
Bdog 1512 truncate update #142
Conversation
…eserve backward compatibile auditing behaviour
This will help if we support an 'omitRequest/ResponseBodyInAudit' functionality. Also send ResponseData rather than reuse HttpResponse, which ensures we only provide a String (truncated) body rather than a Source.
…o respect auditing enabled)
35f318b
to
9132c8d
Compare
responseF = auditedResponseF | ||
) | ||
) | ||
|
||
hookDataF.onComplete { | ||
case Success(hookData) => executeHooksWithHookData(hookData) | ||
case Failure(e) => // this is unlikely, but we want best attempt at auditing | ||
executeHooksWithHookData(None) | ||
executeHooksWithHookData(Body.Omitted) |
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 is the only place we use Omitted
currently. The intention of Omitted
is if clients decide there's no reason to include the payload in audits. Should we add an Unavailable
state to distinguish? Or is Body.Partial(None)
sufficient?
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.
👍 I'm generally in favour of enumerating as many of these states as we can think of. Consumers are free to map them to a smaller set of states if they're not valuable to them.
a0e29cf
to
4429996
Compare
Introduces
Body
to wrap the request/response payloads for auditing. This allows us to identify when the payload has been truncated. It also introduces anOmitted
state in case in the future we want to support excluding request or response payloads in audits.With a change to the Hook data, we require a major version bump - and the changes are reflected in
play-auditing
andbootstrap-play
. Taken the opportunity to tidy up the rest of the hook data (align request and response)