cloudflare-docs icon indicating copy to clipboard operation
cloudflare-docs copied to clipboard

r2: add examples for downloading files using API tokens

Open elithrar opened this issue 1 year ago • 5 comments

This PR adds examples on how to authenticate against the R2 API using auth tokens in JavaScript (Node.js), Go, and Python 3.

cc @harshil1712

elithrar avatar Aug 02 '24 13:08 elithrar

Deploying cloudflare-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2311008
Status: ✅  Deploy successful!
Preview URL: https://cc7815f7.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://silverlock-r2-auth-examples.cloudflare-docs-7ou.pages.dev

View logs

@elithrar, we already have examples for Pre-signed URL in our docs.

JS -> https://developers.cloudflare.com/r2/examples/aws/aws-sdk-js-v3/ Go -> https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/ Python -> https://developers.cloudflare.com/r2/examples/aws/boto3/

I thought you were asking about code examples on creating the tokens via the API.

harshil1712 avatar Aug 02 '24 14:08 harshil1712

These aren't for pre-signed URLs. They are for direct token access.

What parts have you believing otherwise?

elithrar avatar Aug 02 '24 14:08 elithrar

Ah, my bad. The first part of the pre-signed URL examples are the same as the one in this PR. The only difference I could figure out was the hashed Secret Access Key. I didn't know this was a possibility.

harshil1712 avatar Aug 02 '24 14:08 harshil1712

@dcpena @harshil1712 - can one of you update this for the new docs engine? This didn't get merged before the migration.

elithrar avatar Aug 16 '24 13:08 elithrar

Closing in favor of https://github.com/cloudflare/cloudflare-docs/pull/16488 which recreates this PR post docs migration.

dcpena avatar Aug 28 '24 14:08 dcpena