Uh oh!
There was an error while loading. Please reload this page.
Add R2 basic support - #85
Conversation
microstudi
commented
Feb 6, 2025
I you kindly approve the workflow, I'll add more tests |
ioquatix
commented
Feb 7, 2025
Let me know when you'd like me to review the code. Testing is a bit tricky but you have access to a "test" sandbox account. |
| ### Using a Bearer Token | ||
| You can read more about [bearer tokens here](https://blog.cloudflare.com/api-tokens-general-availability/). This allows you to limit priviledges. | ||
| You can read more about [bearer tokens here](https://blog.cloudflare.com/api-tokens-general-availability/). This allows you to limit privileges. |
microstudi
commented
Feb 7, 2025
@ioquatix what do you mean with "you have access to a "test" sandbox account"? I guess i have to put my credentials as secrets in my fork for the tests to work? BTW, do you want me to add those examples in the readme too? |
I have put my credentials into GitHub secrets so that the tests run in a sandbox account. You don't need to do anything, but what I intended to communicate was that the CI will run against Cloudflare's APIs.
Sure, if you think it's a good idea then feel free to do it. |
microstudi
commented
Feb 10, 2025
I see what you mean, unfortunately PR from external forks do not have access to secrets in your repository (that's understandable for security reason). If you give me write permission to your repo, I'll upload the branch in your repo and will make the PR from there. Thanks |
ioquatix
commented
Feb 10, 2025
I think the tests are running correctly but something is wrong with the code. The CI runs with my test credentials. Do we need something else on my account for the tests to pass? How are you testing this locally? |
microstudi
commented
Feb 10, 2025
I do exactly as the examples in the description. As I needed to automate the bucket/CORS creation I was testing in my real Cloudflare account. But not with the test suite, on my script. I was trying to avoid having to create a dummy cloudflare account. Here is the info about the secrets not shared with PR from forks: |
microstudi
commented
Feb 11, 2025
I've ended adding my own secrets in my repository. It's passing in my fork. I've added some tests. It's a little bit difficult due the lack of documentation of the test suite and the sometimes poor documentation of error from Cloudflare. In any case, the features added work. Maybe some of the services would benefit from mocking the requests (using the OpenAPI defintion) instead of directly making connections. BTW; for the bucket related tests, the test account needs to have the R2 service enabled. Thanks for the project, if you want to review this go ahead. |
ioquatix
commented
Feb 11, 2025
Okay, that may be why it's not paying here, let me check the test account. |
ioquatix
commented
Feb 11, 2025
ioquatix
commented
Feb 11, 2025
@jacobbednarz I am pulling you into this discussion, here is a brief summary:
Are you able to help us with enabling these tests? Thanks. |
jacobbednarz
commented
Feb 11, 2025
what is your cloudflare email address? (email me if you don't want to paste it here). i can add you to our acceptance test account and you can run these tests there. |
ioquatix
commented
Feb 11, 2025
@jacobbednarz I set up a test account using the email address |
jacobbednarz
commented
Feb 11, 2025
i've shot you an invite to an account that you can use. |
ioquatix
commented
Feb 11, 2025
I've updated my test account to use the invite sent out, so in theory we have access to R2 now? I'll try kicking off the tests again. |
ioquatix
commented
Feb 12, 2025
Okay, I also totally missed this: https://github.com/orgs/community/discussions/26242 lol so yes, you are correct, I'll have to rebase this into a local branch to test it. |
microstudi
commented
Jun 12, 2025
just a ping! |

This PR adds support for some actions regarding the R2 api in Cloudflare.
Allows to:
Examples:
Listing available buckets:
Obtaining a specific bucket
Creating a bucket:
Attaching a domain to a bucket:
Creating a cors policy:
Obtaining the current CORS (the API throws an exception if there's none yet):
Types of Changes
Contribution