Skip to content

Use account-based API tokens for Cloudflare #398

@flakey5

Description

@flakey5

Account API tokens are now available and I think we should switch to them.

Iirc we're currently using User API tokens. These are tied to the user that created them. If the user leaves the account, they are automatically revoked. The user that created them is also the only user that can manage the token (i.e. to roll it or delete it).

Account API tokens are tied to the account itself, regardless of who created it.

To quote the Cloudflare dash:

Account API Tokens
Create API tokens for service authentication and bucket access that are tied to the entire account. These remain active even when you leave the organization, making them ideal for production systems. (recommended)

User API Tokens
Create API tokens for service authentication and bucket access specific to your user account. These become inactive if you leave the organization, making them ideal for personal access or development work.

Permissions the token will need:

Resource Type Name Permission
Account Workers Scripts Edit
Account Workers R2 Storage Read

(also, it'd be nice to have Edit for Workers KV Storage re #159, but not necessary atm).

Ideally this is done not on a Node.js release day and is tested after swapping the secret on GitHub by manually triggering a release via dispatching the deploy workflow.

cc @nodejs/build since someone with access will need to generate the new token

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions