Skip to content

Commit 853d833

Browse files
committed
chore(middleware-flexible-checksums): add RequestChecksumCalculation and ResponseChecksumValidation
1 parent 23503c6 commit 853d833

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

packages/middleware-flexible-checksums/src/constants.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
/**
2+
* Determines when a checksum will be calculated for request payloads.
3+
*/
4+
export enum RequestChecksumCalculation {
5+
/**
6+
* When set, a checksum will be calculated for all request payloads of operations
7+
* modeled with the {@link httpChecksum} trait where `requestChecksumRequired` is `true`
8+
* AND/OR a `requestAlgorithmMember` is modeled.
9+
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
10+
*/
11+
WHEN_SUPPORTED = "WHEN_SUPPORTED",
12+
13+
/**
14+
* When set, a checksum will only be calculated for request payloads of operations
15+
* modeled with the {@link httpChecksum} trait where `requestChecksumRequired` is `true`
16+
* OR where a `requestAlgorithmMember` is modeled and the user sets it.
17+
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
18+
*/
19+
WHEN_REQUIRED = "WHEN_REQUIRED",
20+
}
21+
22+
/**
23+
* Determines when checksum validation will be performed on response payloads.
24+
*/
25+
export enum ResponseChecksumValidation {
26+
/**
27+
* When set, checksum validation MUST be performed on all response payloads of operations
28+
* modeled with the {@link httpChecksum} trait where `responseAlgorithms` is modeled,
29+
* except when no modeled checksum algorithms are supported by an SDK.
30+
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
31+
*/
32+
WHEN_SUPPORTED = "WHEN_SUPPORTED",
33+
34+
/**
35+
* When set, checksum validation MUST NOT be performed on response payloads of operations UNLESS
36+
* the SDK supports the modeled checksum algorithms AND the user has set the `requestValidationModeMember` to `ENABLED`.
37+
* It is currently impossible to model an operation as requiring a response checksum,
38+
* but this setting leaves the door open for future updates.
39+
*/
40+
WHEN_REQUIRED = "WHEN_REQUIRED",
41+
}
42+
143
/**
244
* Checksum Algorithms supported by the SDK.
345
*/

0 commit comments

Comments
 (0)