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

More httpChecksum trait validation for responses #2371

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

gosar
Copy link
Contributor

@gosar gosar commented Aug 14, 2024

Background

This adds validation to httpChecksum trait for response checksumming behavior. When configuring the trait for response checksumming, the list of checksum algorithms to consider must be provided. Else, the client behavior would have no algorithms to validate.

The docs for response validation say

A client MUST use the list of supported algorithms modeled in the responseAlgorithms property to look up the checksum(s) for which validation MUST be performed.

So, this list should not be empty.

Testing

Added tests for this case.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@gosar gosar requested a review from a team as a code owner August 14, 2024 21:23
@gosar gosar requested review from hpmellema and kstich August 14, 2024 21:23
if (trait.getResponseAlgorithms().isEmpty()) {
events.add(error(operation, trait, "The `httpChecksum` trait must model the"
+ " `responseAlgorithms` property to support response checksum behavior."));
return events;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we return here will customers miss errors for the next check? I think we could just add the events here with no return.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm yeah, not sure why we are returning above for !trait.getRequestValidationModeMember().isPresent() case. also bit odd that the header conflicts for output shape and errors are split like this.

@gosar gosar force-pushed the response-checksum-validator branch from fd014c2 to 43c12ac Compare August 15, 2024 05:26
@gosar gosar force-pushed the response-checksum-validator branch from 43c12ac to 19c128d Compare August 15, 2024 05:27
@gosar gosar merged commit 84fcaf2 into smithy-lang:main Aug 16, 2024
13 checks passed
@gosar gosar deleted the response-checksum-validator branch August 16, 2024 17:12
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