Skip to content

Commit 75d5a75

Browse files
authored
Add breakingChanges for httpChecksum trait (#2398)
1 parent e334862 commit 75d5a75

13 files changed

+390
-1
lines changed

smithy-aws-traits/src/main/resources/META-INF/smithy/aws.protocols.smithy

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,45 @@ structure ec2Query {}
123123
string ec2QueryName
124124

125125
/// Indicates that an operation supports checksum validation.
126-
@trait(selector: "operation")
126+
@trait(
127+
selector: "operation",
128+
breakingChanges: [
129+
{
130+
change: "remove",
131+
severity: "DANGER",
132+
message: """
133+
Removing the trait removes the ability for clients to do request or response checksums. The service \
134+
MUST continue to support old clients by supporting the `httpChecksum` trait."""
135+
},
136+
{
137+
change: "remove",
138+
path: "/requestAlgorithmMember",
139+
severity: "DANGER",
140+
message: """
141+
`requestAlgorithmMember` was removed, so newly generated clients will no longer be able to pick the \
142+
request checksum algorithms The service MUST continue to support old clients by supporting \
143+
`requestAlgorithmMember`."""
144+
},
145+
{
146+
change: "remove",
147+
path: "/requestValidationModeMember",
148+
severity: "DANGER",
149+
message: """
150+
`requestValidationModeMember` was removed, so newly generated clients will no longer validate response \
151+
checksums. The service MUST continue to support old clients by supporting \
152+
`requestValidationModeMember`."""
153+
},
154+
{
155+
change: "remove",
156+
path: "/responseAlgorithms/member",
157+
severity: "DANGER",
158+
message: """
159+
Members of `responseAlgorithms` were removed, so newly generated clients will no longer validate \
160+
response checksums for the removed algorithms. The service MUST continue to support old clients by \
161+
supporting removed compression algorithms."""
162+
}
163+
]
164+
)
127165
@unstable
128166
structure httpChecksum {
129167
/// Defines a top-level operation input member that is used to configure
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
$version: "2.0"
2+
3+
namespace ns.foo
4+
5+
use aws.protocols#httpChecksum
6+
7+
service Service {
8+
operations: [
9+
PutSomething
10+
]
11+
}
12+
13+
@httpChecksum(
14+
requestChecksumRequired: true,
15+
requestAlgorithmMember: "checksumAlgorithm"
16+
)
17+
operation PutSomething {
18+
input: PutSomethingInput
19+
}
20+
21+
structure PutSomethingInput {
22+
@httpHeader("x-amz-request-algorithm")
23+
checksumAlgorithm: ChecksumAlgorithm
24+
25+
@httpHeader("x-amz-response-validation-mode")
26+
validationMode: ValidationMode
27+
28+
@httpPayload
29+
content: Blob
30+
}
31+
32+
enum ChecksumAlgorithm {
33+
CRC32C
34+
CRC32
35+
SHA1
36+
SHA256
37+
}
38+
39+
enum ValidationMode {
40+
ENABLED
41+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
$version: "2.0"
2+
3+
namespace ns.foo
4+
5+
use aws.protocols#httpChecksum
6+
7+
service Service {
8+
operations: [
9+
PutSomething
10+
]
11+
}
12+
13+
@httpChecksum(
14+
requestChecksumRequired: true
15+
)
16+
operation PutSomething {
17+
input: PutSomethingInput
18+
}
19+
20+
structure PutSomethingInput {
21+
@httpHeader("x-amz-request-algorithm")
22+
checksumAlgorithm: ChecksumAlgorithm
23+
24+
@httpHeader("x-amz-response-validation-mode")
25+
validationMode: ValidationMode
26+
27+
@httpPayload
28+
content: Blob
29+
}
30+
31+
enum ChecksumAlgorithm {
32+
CRC32C
33+
CRC32
34+
SHA1
35+
SHA256
36+
}
37+
38+
enum ValidationMode {
39+
ENABLED
40+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
$version: "2.0"
2+
3+
namespace ns.foo
4+
5+
use aws.protocols#httpChecksum
6+
7+
service Service {
8+
operations: [
9+
PutSomething
10+
]
11+
}
12+
13+
@httpChecksum(
14+
requestValidationModeMember: "validationMode",
15+
responseAlgorithms: ["CRC32C", "CRC32", "SHA1", "SHA256"]
16+
)
17+
operation PutSomething {
18+
input: PutSomethingInput
19+
}
20+
21+
structure PutSomethingInput {
22+
@httpHeader("x-amz-request-algorithm")
23+
checksumAlgorithm: ChecksumAlgorithm
24+
25+
@httpHeader("x-amz-response-validation-mode")
26+
validationMode: ValidationMode
27+
28+
@httpPayload
29+
content: Blob
30+
}
31+
32+
enum ChecksumAlgorithm {
33+
CRC32C
34+
CRC32
35+
SHA1
36+
SHA256
37+
}
38+
39+
enum ValidationMode {
40+
ENABLED
41+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
$version: "2.0"
2+
3+
namespace ns.foo
4+
5+
use aws.protocols#httpChecksum
6+
7+
service Service {
8+
operations: [
9+
PutSomething
10+
]
11+
}
12+
13+
@httpChecksum(
14+
requestValidationModeMember: "validationMode",
15+
responseAlgorithms: ["CRC32C", "CRC32", "SHA1"]
16+
)
17+
operation PutSomething {
18+
input: PutSomethingInput
19+
}
20+
21+
structure PutSomethingInput {
22+
@httpHeader("x-amz-request-algorithm")
23+
checksumAlgorithm: ChecksumAlgorithm
24+
25+
@httpHeader("x-amz-response-validation-mode")
26+
validationMode: ValidationMode
27+
28+
@httpPayload
29+
content: Blob
30+
}
31+
32+
enum ChecksumAlgorithm {
33+
CRC32C
34+
CRC32
35+
SHA1
36+
SHA256
37+
}
38+
39+
enum ValidationMode {
40+
ENABLED
41+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
$version: "2.0"
2+
3+
namespace ns.foo
4+
5+
use aws.protocols#httpChecksum
6+
7+
service Service {
8+
operations: [
9+
PutSomething
10+
]
11+
}
12+
13+
@httpChecksum(
14+
requestChecksumRequired: true,
15+
requestAlgorithmMember: "checksumAlgorithm",
16+
requestValidationModeMember: "validationMode",
17+
responseAlgorithms: ["CRC32C", "CRC32", "SHA1", "SHA256"]
18+
)
19+
operation PutSomething {
20+
input: PutSomethingInput
21+
}
22+
23+
structure PutSomethingInput {
24+
@httpHeader("x-amz-request-algorithm")
25+
checksumAlgorithm: ChecksumAlgorithm
26+
27+
@httpHeader("x-amz-response-validation-mode")
28+
validationMode: ValidationMode
29+
30+
@httpPayload
31+
content: Blob
32+
}
33+
34+
enum ChecksumAlgorithm {
35+
CRC32C
36+
CRC32
37+
SHA1
38+
SHA256
39+
}
40+
41+
enum ValidationMode {
42+
ENABLED
43+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
$version: "2.0"
2+
3+
namespace ns.foo
4+
5+
use aws.protocols#httpChecksum
6+
7+
service Service {
8+
operations: [
9+
PutSomething
10+
]
11+
}
12+
13+
@httpChecksum(
14+
requestChecksumRequired: true,
15+
requestAlgorithmMember: "checksumAlgorithm"
16+
)
17+
operation PutSomething {
18+
input: PutSomethingInput
19+
}
20+
21+
structure PutSomethingInput {
22+
@httpHeader("x-amz-request-algorithm")
23+
checksumAlgorithm: ChecksumAlgorithm
24+
25+
@httpHeader("x-amz-response-validation-mode")
26+
validationMode: ValidationMode
27+
28+
@httpPayload
29+
content: Blob
30+
}
31+
32+
enum ChecksumAlgorithm {
33+
CRC32C
34+
CRC32
35+
SHA1
36+
SHA256
37+
}
38+
39+
enum ValidationMode {
40+
ENABLED
41+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[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
2+
-----
3+
[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
4+
-----
5+
[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
6+
-----
7+
[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
8+
-----
9+
[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

0 commit comments

Comments
 (0)