Skip to content
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

Merged
merged 19 commits into from
Apr 20, 2022
Merged

Bdog 1512 truncate update #142

merged 19 commits into from
Apr 20, 2022

Conversation

colin-lamed
Copy link
Contributor

@colin-lamed colin-lamed commented Mar 30, 2022

Introduces Body to wrap the request/response payloads for auditing. This allows us to identify when the payload has been truncated. It also introduces an Omitted 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 and bootstrap-play. Taken the opportunity to tidy up the rest of the hook data (align request and response)

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)
Copy link
Contributor Author

@colin-lamed colin-lamed Mar 31, 2022

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?

Copy link
Contributor

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.

tomwadeson
tomwadeson previously approved these changes Apr 1, 2022
tomwadeson
tomwadeson previously approved these changes Apr 19, 2022
@colin-lamed colin-lamed merged commit 9e55668 into main Apr 20, 2022
@colin-lamed colin-lamed deleted the BDOG-1512-truncate_update branch April 20, 2022 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants