FlexibleChecksumsRequestInterceptor
Handles request checksums for operations with the HttpChecksumTrait applied.
If a user supplies a checksum via an HTTP header no calculation will be done. The exception is MD5, if a user supplies an MD5 checksum header it will be ignored.
If the request configuration and model requires checksum calculation:
Check if the user configured a checksum algorithm for the request and attempt to use that.
If no checksum is configured for the request then use the default checksum algorithm to calculate a checksum.
If the request will be streamed:
The checksum calculation is done during transmission using a hashing & completing body.
The checksum will be sent in a trailing header, once the request is consumed.
If the request will not be streamed:
The checksum calculation is done before transmission
The checksum will be sent in a header
Business metrics MUST be emitted for the checksum algorithm used.
Parameters
Model sourced flag indicating if checksum calculation is mandatory.
Configuration option that determines when checksum calculation should be done.
The checksum algorithm that the user selected for the request, may be null.