feat(hmac) Implement request body validation #2613
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds additional request body validation along with existing
headers validation. The motivation behind request body validation
is to detect body tampering. But as the validation process requires
to read the whole body in memory, which can affect Kong's
performance, this feature is disabled by default. User can change
the default behavior using config
validate-request-body
.if config
validate-request-body
is set totrue
, validate requestbody along with headers validation. If it is
false
, perform onlyheaders validation.
Full changelog
validate-request-body
to schema.digest
header value.digest
validation logic.Note: This PR is based of #2419 with some code refactoring.