This document explains how to setup your system for authenticating to R2 using the credential helper.
R2 has an S3-compatible API that requires the creation of special tokens. These are different from normal user tokens and are only used for R2.
- Create an API token by following the documentation
- Set the
R2_ACCESS_KEY_ID
andR2_SECRET_ACCESS_KEY
environment variables when running Bazel or other tools
Add to your .bazelrc
:
common --credential_helper=*.r2.cloudflarestorage.com=%workspace%/tools/credential-helper