From e4001f9f0181ca1b51e43d067c7f0b30c6fa2444 Mon Sep 17 00:00:00 2001 From: Jaykumar Gosar Date: Tue, 17 Sep 2024 11:44:57 -0700 Subject: [PATCH] Add breakingChanges for httpChecksum trait --- .../META-INF/smithy/aws.protocols.smithy | 40 ++++++++++++++++- .../diffs/httpChecksum-request.a.smithy | 41 ++++++++++++++++++ .../diffs/httpChecksum-request.b.smithy | 40 +++++++++++++++++ .../traits/diffs/httpChecksum-request.events | 1 + .../httpChecksum-response-algorithm.a.smithy | 41 ++++++++++++++++++ .../httpChecksum-response-algorithm.b.smithy | 41 ++++++++++++++++++ .../httpChecksum-response-algorithm.events | 1 + .../diffs/httpChecksum-response.a.smithy | 43 +++++++++++++++++++ .../diffs/httpChecksum-response.b.smithy | 41 ++++++++++++++++++ .../traits/diffs/httpChecksum-response.events | 9 ++++ .../aws/traits/diffs/httpChecksum.a.smithy | 43 +++++++++++++++++++ .../aws/traits/diffs/httpChecksum.b.smithy | 35 +++++++++++++++ .../aws/traits/diffs/httpChecksum.events | 15 +++++++ 13 files changed, 390 insertions(+), 1 deletion(-) create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.a.smithy create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.b.smithy create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.events create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.a.smithy create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.b.smithy create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.events create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.a.smithy create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.b.smithy create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.events create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.a.smithy create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.b.smithy create mode 100644 smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.events diff --git a/smithy-aws-traits/src/main/resources/META-INF/smithy/aws.protocols.smithy b/smithy-aws-traits/src/main/resources/META-INF/smithy/aws.protocols.smithy index ceb88995c34..d4a7be98f3b 100644 --- a/smithy-aws-traits/src/main/resources/META-INF/smithy/aws.protocols.smithy +++ b/smithy-aws-traits/src/main/resources/META-INF/smithy/aws.protocols.smithy @@ -123,7 +123,45 @@ structure ec2Query {} string ec2QueryName /// Indicates that an operation supports checksum validation. -@trait(selector: "operation") +@trait( + selector: "operation", + breakingChanges: [ + { + change: "remove", + severity: "DANGER", + message: """ + Removing the trait removes the ability for clients to do request or response checksums. The service \ + MUST continue to support old clients by supporting the `httpChecksum` trait.""" + }, + { + change: "remove", + path: "/requestAlgorithmMember", + severity: "DANGER", + message: """ + `requestAlgorithmMember` was removed, so newly generated clients will no longer be able to pick the \ + request checksum algorithms The service MUST continue to support old clients by supporting \ + `requestAlgorithmMember`.""" + }, + { + change: "remove", + path: "/requestValidationModeMember", + severity: "DANGER", + message: """ + `requestValidationModeMember` was removed, so newly generated clients will no longer validate response \ + checksums. The service MUST continue to support old clients by supporting \ + `requestValidationModeMember`.""" + }, + { + change: "remove", + path: "/responseAlgorithms/member", + severity: "DANGER", + message: """ + Members of `responseAlgorithms` were removed, so newly generated clients will no longer validate \ + response checksums for the removed algorithms. The service MUST continue to support old clients by \ + supporting removed compression algorithms.""" + } + ] +) @unstable structure httpChecksum { /// Defines a top-level operation input member that is used to configure diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.a.smithy b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.a.smithy new file mode 100644 index 00000000000..82e24a3e86f --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.a.smithy @@ -0,0 +1,41 @@ +$version: "2.0" + +namespace ns.foo + +use aws.protocols#httpChecksum + +service Service { + operations: [ + PutSomething + ] +} + +@httpChecksum( + requestChecksumRequired: true, + requestAlgorithmMember: "checksumAlgorithm" +) +operation PutSomething { + input: PutSomethingInput +} + +structure PutSomethingInput { + @httpHeader("x-amz-request-algorithm") + checksumAlgorithm: ChecksumAlgorithm + + @httpHeader("x-amz-response-validation-mode") + validationMode: ValidationMode + + @httpPayload + content: Blob +} + +enum ChecksumAlgorithm { + CRC32C + CRC32 + SHA1 + SHA256 +} + +enum ValidationMode { + ENABLED +} diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.b.smithy b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.b.smithy new file mode 100644 index 00000000000..b667c23d2ed --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.b.smithy @@ -0,0 +1,40 @@ +$version: "2.0" + +namespace ns.foo + +use aws.protocols#httpChecksum + +service Service { + operations: [ + PutSomething + ] +} + +@httpChecksum( + requestChecksumRequired: true +) +operation PutSomething { + input: PutSomethingInput +} + +structure PutSomethingInput { + @httpHeader("x-amz-request-algorithm") + checksumAlgorithm: ChecksumAlgorithm + + @httpHeader("x-amz-response-validation-mode") + validationMode: ValidationMode + + @httpPayload + content: Blob +} + +enum ChecksumAlgorithm { + CRC32C + CRC32 + SHA1 + SHA256 +} + +enum ValidationMode { + ENABLED +} diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.events b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.events new file mode 100644 index 00000000000..1f969c44567 --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-request.events @@ -0,0 +1 @@ +[DANGER] ns.foo#PutSomething: Removed trait contents from `aws.protocols#httpChecksum` at path `/requestAlgorithmMember`. Removed value: `checksumAlgorithm`; `requestAlgorithmMember` was removed, so newly generated clients will no longer be able to pick the request checksum algorithms The service MUST continue to support old clients by supporting `requestAlgorithmMember`. | TraitBreakingChange.Remove diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.a.smithy b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.a.smithy new file mode 100644 index 00000000000..eefd68dbfb6 --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.a.smithy @@ -0,0 +1,41 @@ +$version: "2.0" + +namespace ns.foo + +use aws.protocols#httpChecksum + +service Service { + operations: [ + PutSomething + ] +} + +@httpChecksum( + requestValidationModeMember: "validationMode", + responseAlgorithms: ["CRC32C", "CRC32", "SHA1", "SHA256"] +) +operation PutSomething { + input: PutSomethingInput +} + +structure PutSomethingInput { + @httpHeader("x-amz-request-algorithm") + checksumAlgorithm: ChecksumAlgorithm + + @httpHeader("x-amz-response-validation-mode") + validationMode: ValidationMode + + @httpPayload + content: Blob +} + +enum ChecksumAlgorithm { + CRC32C + CRC32 + SHA1 + SHA256 +} + +enum ValidationMode { + ENABLED +} diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.b.smithy b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.b.smithy new file mode 100644 index 00000000000..f23a3f150dc --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.b.smithy @@ -0,0 +1,41 @@ +$version: "2.0" + +namespace ns.foo + +use aws.protocols#httpChecksum + +service Service { + operations: [ + PutSomething + ] +} + +@httpChecksum( + requestValidationModeMember: "validationMode", + responseAlgorithms: ["CRC32C", "CRC32", "SHA1"] +) +operation PutSomething { + input: PutSomethingInput +} + +structure PutSomethingInput { + @httpHeader("x-amz-request-algorithm") + checksumAlgorithm: ChecksumAlgorithm + + @httpHeader("x-amz-response-validation-mode") + validationMode: ValidationMode + + @httpPayload + content: Blob +} + +enum ChecksumAlgorithm { + CRC32C + CRC32 + SHA1 + SHA256 +} + +enum ValidationMode { + ENABLED +} diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.events b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.events new file mode 100644 index 00000000000..8b58aad88c7 --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response-algorithm.events @@ -0,0 +1 @@ +[DANGER] ns.foo#PutSomething: Removed trait contents from `aws.protocols#httpChecksum` at path `/responseAlgorithms/3`. Removed value: `SHA256`; Members of `responseAlgorithms` were removed, so newly generated clients will no longer validate response checksums for the removed algorithms. The service MUST continue to support old clients by supporting removed compression algorithms. | TraitBreakingChange.Remove diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.a.smithy b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.a.smithy new file mode 100644 index 00000000000..04e1ef80e87 --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.a.smithy @@ -0,0 +1,43 @@ +$version: "2.0" + +namespace ns.foo + +use aws.protocols#httpChecksum + +service Service { + operations: [ + PutSomething + ] +} + +@httpChecksum( + requestChecksumRequired: true, + requestAlgorithmMember: "checksumAlgorithm", + requestValidationModeMember: "validationMode", + responseAlgorithms: ["CRC32C", "CRC32", "SHA1", "SHA256"] +) +operation PutSomething { + input: PutSomethingInput +} + +structure PutSomethingInput { + @httpHeader("x-amz-request-algorithm") + checksumAlgorithm: ChecksumAlgorithm + + @httpHeader("x-amz-response-validation-mode") + validationMode: ValidationMode + + @httpPayload + content: Blob +} + +enum ChecksumAlgorithm { + CRC32C + CRC32 + SHA1 + SHA256 +} + +enum ValidationMode { + ENABLED +} diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.b.smithy b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.b.smithy new file mode 100644 index 00000000000..82e24a3e86f --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.b.smithy @@ -0,0 +1,41 @@ +$version: "2.0" + +namespace ns.foo + +use aws.protocols#httpChecksum + +service Service { + operations: [ + PutSomething + ] +} + +@httpChecksum( + requestChecksumRequired: true, + requestAlgorithmMember: "checksumAlgorithm" +) +operation PutSomething { + input: PutSomethingInput +} + +structure PutSomethingInput { + @httpHeader("x-amz-request-algorithm") + checksumAlgorithm: ChecksumAlgorithm + + @httpHeader("x-amz-response-validation-mode") + validationMode: ValidationMode + + @httpPayload + content: Blob +} + +enum ChecksumAlgorithm { + CRC32C + CRC32 + SHA1 + SHA256 +} + +enum ValidationMode { + ENABLED +} diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.events b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.events new file mode 100644 index 00000000000..e514aeb4fd0 --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum-response.events @@ -0,0 +1,9 @@ +[DANGER] ns.foo#PutSomething: Removed trait contents from `aws.protocols#httpChecksum` at path `/requestValidationModeMember`. Removed value: `validationMode`; `requestValidationModeMember` was removed, so newly generated clients will no longer validate response checksums. The service MUST continue to support old clients by supporting `requestValidationModeMember`. | TraitBreakingChange.Remove +----- +[DANGER] ns.foo#PutSomething: Removed trait contents from `aws.protocols#httpChecksum` at path `/responseAlgorithms/0`. Removed value: `CRC32C`; Members of `responseAlgorithms` were removed, so newly generated clients will no longer validate response checksums for the removed algorithms. The service MUST continue to support old clients by supporting removed compression algorithms. | TraitBreakingChange.Remove +----- +[DANGER] ns.foo#PutSomething: Removed trait contents from `aws.protocols#httpChecksum` at path `/responseAlgorithms/1`. Removed value: `CRC32`; Members of `responseAlgorithms` were removed, so newly generated clients will no longer validate response checksums for the removed algorithms. The service MUST continue to support old clients by supporting removed compression algorithms. | TraitBreakingChange.Remove +----- +[DANGER] ns.foo#PutSomething: Removed trait contents from `aws.protocols#httpChecksum` at path `/responseAlgorithms/2`. Removed value: `SHA1`; Members of `responseAlgorithms` were removed, so newly generated clients will no longer validate response checksums for the removed algorithms. The service MUST continue to support old clients by supporting removed compression algorithms. | TraitBreakingChange.Remove +----- +[DANGER] ns.foo#PutSomething: Removed trait contents from `aws.protocols#httpChecksum` at path `/responseAlgorithms/3`. Removed value: `SHA256`; Members of `responseAlgorithms` were removed, so newly generated clients will no longer validate response checksums for the removed algorithms. The service MUST continue to support old clients by supporting removed compression algorithms. | TraitBreakingChange.Remove diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.a.smithy b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.a.smithy new file mode 100644 index 00000000000..04e1ef80e87 --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.a.smithy @@ -0,0 +1,43 @@ +$version: "2.0" + +namespace ns.foo + +use aws.protocols#httpChecksum + +service Service { + operations: [ + PutSomething + ] +} + +@httpChecksum( + requestChecksumRequired: true, + requestAlgorithmMember: "checksumAlgorithm", + requestValidationModeMember: "validationMode", + responseAlgorithms: ["CRC32C", "CRC32", "SHA1", "SHA256"] +) +operation PutSomething { + input: PutSomethingInput +} + +structure PutSomethingInput { + @httpHeader("x-amz-request-algorithm") + checksumAlgorithm: ChecksumAlgorithm + + @httpHeader("x-amz-response-validation-mode") + validationMode: ValidationMode + + @httpPayload + content: Blob +} + +enum ChecksumAlgorithm { + CRC32C + CRC32 + SHA1 + SHA256 +} + +enum ValidationMode { + ENABLED +} diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.b.smithy b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.b.smithy new file mode 100644 index 00000000000..122adcdb1c4 --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.b.smithy @@ -0,0 +1,35 @@ +$version: "2.0" + +namespace ns.foo + +service Service { + operations: [ + PutSomething + ] +} + +operation PutSomething { + input: PutSomethingInput +} + +structure PutSomethingInput { + @httpHeader("x-amz-request-algorithm") + checksumAlgorithm: ChecksumAlgorithm + + @httpHeader("x-amz-response-validation-mode") + validationMode: ValidationMode + + @httpPayload + content: Blob +} + +enum ChecksumAlgorithm { + CRC32C + CRC32 + SHA1 + SHA256 +} + +enum ValidationMode { + ENABLED +} diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.events b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.events new file mode 100644 index 00000000000..ef02675fe4c --- /dev/null +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/diffs/httpChecksum.events @@ -0,0 +1,15 @@ +[DANGER] ns.foo#PutSomething: Removed trait `aws.protocols#httpChecksum`. Previous trait value: +``` +{ + "requestChecksumRequired": true, + "requestAlgorithmMember": "checksumAlgorithm", + "requestValidationModeMember": "validationMode", + "responseAlgorithms": [ + "CRC32C", + "CRC32", + "SHA1", + "SHA256" + ] +} +``` +; Removing the trait removes the ability for clients to do request or response checksums. The service MUST continue to support old clients by supporting the `httpChecksum` trait. | TraitBreakingChange.Remove