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

adds http-checksum trait support #741

Closed
wants to merge 13 commits into from

Conversation

skotambkar
Copy link
Contributor

Status: Needs review

Description of changes:
[x] Adds httpChecksum trait to smithy.
[x] Adds test cases and docs

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

@skotambkar skotambkar changed the title adds httpChecksum trait support adds http-checksum trait support Mar 16, 2021
@skotambkar skotambkar marked this pull request as ready for review March 16, 2021 21:24
@skotambkar skotambkar requested review from srchase and kstich March 25, 2021 18:00
@skotambkar skotambkar requested a review from kstich April 21, 2021 20:16
docs/source/1.0/spec/core/behavior-traits.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/behavior-traits.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/behavior-traits.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/behavior-traits.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/behavior-traits.rst Outdated Show resolved Hide resolved
@skotambkar skotambkar requested a review from kstich May 13, 2021 08:30
Adds loadsTrait test to verify round-trip behavior for trait.
Adds validation to error when empty list of checksum algorithm is provided.
Updates documentation.
for aws specific location support requirement. Updates to
documentation and address feedback around java code.
…null properties for httpchecksum properties builder
…] is now set in build() function for HttpChecksumTraitProperty Builder. Also updates doc, and remove extra code for validator test
@skotambkar skotambkar requested a review from kstich June 1, 2021 06:56
docs/source/1.0/spec/core/behavior-traits.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/behavior-traits.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/behavior-traits.rst Show resolved Hide resolved
docs/source/1.0/spec/core/behavior-traits.rst Outdated Show resolved Hide resolved

.. code-tab:: smithy

@httpChecksum(
Copy link
Member

Choose a reason for hiding this comment

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

Did we consider making these a little more explicit, customizable, and future proof by using a map similar to:

@httpChecksum(
    request: {
        sha256: {
            header: "x-checksum-sha256"
        },
        crc32: {
            header: "x-checksum-crc32"
        }
    }
)

Here, request and response are maps where each key is the algorithm, and each value is a union of possible locations (i.e., it can be set to header or trailer, and we could expand to query in the future for requests if needed). The value of the union is the binding location name (i.e., header name or trailing header name).

This provides more flexibility than the current proposal because each algorithm can use whatever header or query string parameter is necessary. The header/query binding is explicit and does not need prefixes. The names can now support anything, including Content-MD5 if we ever wanted to support it (we probably don't but just an example).

Implementations don't need to perform any prefix logic to determine the header name either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the idea, have few concerns. Let's sync offline on this.

@skotambkar
Copy link
Contributor Author

Replaced by #843

@skotambkar skotambkar closed this Jun 23, 2021
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.

5 participants