From 7be6c8c1a21cd5a4e43a14b664f9bcc5b04ac101 Mon Sep 17 00:00:00 2001 From: Mike Newswanger Date: Thu, 27 Mar 2025 17:01:18 -0400 Subject: [PATCH 1/2] Redact s3 api creds --- src/content/docs/r2/buckets/cors.mdx | 7 +++---- .../docs/r2/buckets/object-lifecycles.mdx | 21 ++++++++----------- .../docs/r2/reference/data-location.mdx | 8 +++---- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/content/docs/r2/buckets/cors.mdx b/src/content/docs/r2/buckets/cors.mdx index ae6b910d48dc6c..8450029073f8ca 100644 --- a/src/content/docs/r2/buckets/cors.mdx +++ b/src/content/docs/r2/buckets/cors.mdx @@ -43,11 +43,10 @@ The example below shows how to generate a presigned `PutObject` URL using the [` import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3"; import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; const S3 = new S3Client({ - endpoint: "https://4893d737c0b9e484dfc37ec392b5fa8a.r2.cloudflarestorage.com", + endpoint: "https://.r2.cloudflarestorage.com", credentials: { - accessKeyId: "7dc27c125a22ad808cd01df8ec309d41", - secretAccessKey: - "1aa5c5b0c43defdb88f567487c071d17e234126133444770a706ae09336c57a4", + accessKeyId: "", + secretAccessKey: "", }, region: "auto", }); diff --git a/src/content/docs/r2/buckets/object-lifecycles.mdx b/src/content/docs/r2/buckets/object-lifecycles.mdx index d827a40eb9f72f..3049f1d02876a0 100644 --- a/src/content/docs/r2/buckets/object-lifecycles.mdx +++ b/src/content/docs/r2/buckets/object-lifecycles.mdx @@ -59,11 +59,10 @@ Below is an example of configuring a lifecycle configuration (a collection of li ```js title="Configure the S3 client to interact with R2" const client = new S3({ - endpoint: "https://4893d737c0b9e484dfc37ec392b5fa8a.r2.cloudflarestorage.com", + endpoint: "https://.r2.cloudflarestorage.com", credentials: { - accessKeyId: "7dc27c125a22ad808cd01df8ec309d41", - secretAccessKey: - "1aa5c5b0c43defdb88f567487c071d17e234126133444770a706ae09336c57a4", + accessKeyId: "", + secretAccessKey: "", }, region: "auto", }); @@ -155,11 +154,10 @@ import S3 from "aws-sdk/clients/s3.js"; // Configure the S3 client to talk to R2. const client = new S3({ - endpoint: "https://4893d737c0b9e484dfc37ec392b5fa8a.r2.cloudflarestorage.com", + endpoint: "https://.r2.cloudflarestorage.com", credentials: { - accessKeyId: "7dc27c125a22ad808cd01df8ec309d41", - secretAccessKey: - "1aa5c5b0c43defdb88f567487c071d17e234126133444770a706ae09336c57a4", + accessKeyId: "", + secretAccessKey: "", }, region: "auto", }); @@ -199,11 +197,10 @@ import S3 from "aws-sdk/clients/s3.js"; // Configure the S3 client to talk to R2. const client = new S3({ - endpoint: "https://4893d737c0b9e484dfc37ec392b5fa8a.r2.cloudflarestorage.com", + endpoint: "https://.r2.cloudflarestorage.com", credentials: { - accessKeyId: "7dc27c125a22ad808cd01df8ec309d41", - secretAccessKey: - "1aa5c5b0c43defdb88f567487c071d17e234126133444770a706ae09336c57a4", + accessKeyId: "", + secretAccessKey: "", }, region: "auto", }); diff --git a/src/content/docs/r2/reference/data-location.mdx b/src/content/docs/r2/reference/data-location.mdx index 237bd3785cd17e..ae9902f9cec9e6 100644 --- a/src/content/docs/r2/reference/data-location.mdx +++ b/src/content/docs/r2/reference/data-location.mdx @@ -107,12 +107,10 @@ The example below shows how to create an R2 bucket in the `eu` jurisdiction usin ```js import { S3Client, CreateBucketCommand } from "@aws-sdk/client-s3"; const S3 = new S3Client({ - endpoint: - "https://4893d737c0b9e484dfc37ec392b5fa8a.eu.r2.cloudflarestorage.com", + endpoint: "https://.eu.r2.cloudflarestorage.com", credentials: { - accessKeyId: "7dc27c125a22ad808cd01df8ec309d41", - secretAccessKey: - "1aa5c5b0c43defdb88f567487c071d17e234126133444770a706ae09336c57a4", + accessKeyId: "", }, region: "auto", }); From 867cce99d2c2bdd9a520533e9075b16fc12752bf Mon Sep 17 00:00:00 2001 From: Mike Newswanger Date: Thu, 27 Mar 2025 17:33:00 -0400 Subject: [PATCH 2/2] Fix bucket URLs --- src/content/docs/r2/buckets/cors.mdx | 2 +- src/content/docs/r2/buckets/object-lifecycles.mdx | 6 +++--- src/content/docs/r2/reference/data-location.mdx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/docs/r2/buckets/cors.mdx b/src/content/docs/r2/buckets/cors.mdx index 8450029073f8ca..721f078d35c1cf 100644 --- a/src/content/docs/r2/buckets/cors.mdx +++ b/src/content/docs/r2/buckets/cors.mdx @@ -43,7 +43,7 @@ The example below shows how to generate a presigned `PutObject` URL using the [` import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3"; import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; const S3 = new S3Client({ - endpoint: "https://.r2.cloudflarestorage.com", + endpoint: "https://.r2.cloudflarestorage.com", credentials: { accessKeyId: "", secretAccessKey: "", diff --git a/src/content/docs/r2/buckets/object-lifecycles.mdx b/src/content/docs/r2/buckets/object-lifecycles.mdx index 3049f1d02876a0..6f0975bae79fcc 100644 --- a/src/content/docs/r2/buckets/object-lifecycles.mdx +++ b/src/content/docs/r2/buckets/object-lifecycles.mdx @@ -59,7 +59,7 @@ Below is an example of configuring a lifecycle configuration (a collection of li ```js title="Configure the S3 client to interact with R2" const client = new S3({ - endpoint: "https://.r2.cloudflarestorage.com", + endpoint: "https://.r2.cloudflarestorage.com", credentials: { accessKeyId: "", secretAccessKey: "", @@ -154,7 +154,7 @@ import S3 from "aws-sdk/clients/s3.js"; // Configure the S3 client to talk to R2. const client = new S3({ - endpoint: "https://.r2.cloudflarestorage.com", + endpoint: "https://.r2.cloudflarestorage.com", credentials: { accessKeyId: "", secretAccessKey: "", @@ -197,7 +197,7 @@ import S3 from "aws-sdk/clients/s3.js"; // Configure the S3 client to talk to R2. const client = new S3({ - endpoint: "https://.r2.cloudflarestorage.com", + endpoint: "https://.r2.cloudflarestorage.com", credentials: { accessKeyId: "", secretAccessKey: "", diff --git a/src/content/docs/r2/reference/data-location.mdx b/src/content/docs/r2/reference/data-location.mdx index ae9902f9cec9e6..78b196c4906a8f 100644 --- a/src/content/docs/r2/reference/data-location.mdx +++ b/src/content/docs/r2/reference/data-location.mdx @@ -107,7 +107,7 @@ The example below shows how to create an R2 bucket in the `eu` jurisdiction usin ```js import { S3Client, CreateBucketCommand } from "@aws-sdk/client-s3"; const S3 = new S3Client({ - endpoint: "https://.eu.r2.cloudflarestorage.com", + endpoint: "https://.eu.r2.cloudflarestorage.com", credentials: { accessKeyId: "",