Skip to content

Commit 9f0f785

Browse files
committed
Add compatibility flags for go js net aws sdks
1 parent a65f74e commit 9f0f785

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

src/content/docs/r2/examples/aws/aws-sdk-go.mdx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
---
22
title: aws-sdk-go
33
pcx_content_type: example
4-
54
---
65

7-
import { Render } from "~/components"
6+
import { Render } from "~/components";
87

9-
<Render file="keys" /><br/>
8+
<Render file="keys" />
9+
<br />
1010

1111
This example uses version 2 of the [aws-sdk-go](https://github.com/aws/aws-sdk-go-v2) package. You must pass in the R2 configuration credentials when instantiating your `S3` service client:
1212

13+
:::note[Compatibility]
14+
Client version `1.73.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
15+
16+
To mitigate, users can use `1.72.3` or add the following to their config:
17+
18+
```go
19+
config.WithRequestChecksumCalculation(0)
20+
config.WithResponseChecksumValidation(0)
21+
```
22+
23+
:::
24+
1325
```go
1426
package main
1527

src/content/docs/r2/examples/aws/aws-sdk-js-v3.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ import { Render } from "~/components";
1010

1111
JavaScript or TypeScript users may continue to use the [`@aws-sdk/client-s3`](https://www.npmjs.com/package/@aws-sdk/client-s3) npm package as per normal. You must pass in the R2 configuration credentials when instantiating your `S3` service client:
1212

13+
:::note[Compatibility]
14+
Client version `3.729.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
15+
16+
To mitigate, users can use `3.726.1` or add the following to their S3Client config:
17+
18+
```ts
19+
requestChecksumCalculation: "WHEN_REQUIRED",
20+
responseChecksumValidation: "WHEN_REQUIRED",
21+
```
22+
23+
:::
24+
1325
```ts
1426
import {
1527
S3Client,

src/content/docs/r2/examples/aws/aws-sdk-net.mdx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
---
22
title: aws-sdk-net
33
pcx_content_type: example
4-
54
---
65

7-
import { Render } from "~/components"
6+
import { Render } from "~/components";
87

9-
<Render file="keys" /><br/>
8+
<Render file="keys" />
9+
<br />
1010

1111
This example uses version 3 of the [aws-sdk-net](https://www.nuget.org/packages/AWSSDK.S3) package. You must pass in the R2 configuration credentials when instantiating your `S3` service client:
1212

1313
## Client setup
1414

1515
In this example, you will pass credentials explicitly to the `IAmazonS3` initialization. If you wish, use a shared AWS credentials file or the SDK store in-line with other AWS SDKs. Refer to [Configure AWS credentials](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html) for more details.
1616

17+
:::note[Compatibility]
18+
Client version `3.7.963.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
19+
20+
To mitigate, users can use `3.7.962.0` or add the following to their AmazonS3Config:
21+
22+
```csharp
23+
RequestChecksumCalculation = "WHEN_REQUIRED",
24+
ResponseChecksumValidation = "WHEN_REQUIRED"
25+
```
26+
27+
:::
28+
1729
```csharp
1830
private static IAmazonS3 s3Client;
1931

@@ -72,10 +84,8 @@ The [PutObjectAsync](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/S3/M
7284

7385
:::caution
7486

75-
7687
`DisablePayloadSigning = true` must be passed as Cloudflare R2 does not currently support the Streaming SigV4 implementation used by AWSSDK.S3.
7788

78-
7989
:::
8090

8191
```csharp

0 commit comments

Comments
 (0)