Skip to content
Workspace guide6 min read

Cloudflare permissions

What sign-in and account connection request, and why.

View Markdown

Gitflare uses Cloudflare authorization twice, for different things. Signing in proves who you are. Connecting an account lets a workspace see and deploy to that account. Each asks only for what it needs, and you see the full list before Cloudflare's consent screen opens.

Signing in

Sign in with Cloudflare (hosted edition) requests one permission:

PermissionScopeWhy
User Details Readuser-details.readRead your Cloudflare user ID, name and email to sign you in.

Gitflare reads your identity once, then revokes the token at Cloudflare. It is never stored, it cannot read your accounts, Workers or databases, and signing in does not connect an account to your workspace.

Connecting an account

An Owner connects an account in Settings → Cloudflare, or for one repository in its Cloudflare tab. Before Gitflare sends you to Cloudflare, it lists each permission it will request and why. The list comes from the same configuration as the authorization request, so it always matches what Cloudflare shows. MCP clients get the same list from gitflare_cloudflare_connection status or gitflare_manage_cloudflare_connection connect.

Every connection requests these. An installation can replace all of them except offline_access by setting CLOUDFLARE_OAUTH_SCOPES:

PermissionScopeWhy
Offline accessoffline_accessRefresh the connection so resources and deploys keep working without re-authorizing every hour.
Account Settings Readaccount-settings.readList the accounts you granted so you can choose one for this workspace.
Workers Scripts Metadata Readworkers-scripts.metadata_readList your Workers and Durable Object namespaces to link them to repositories.
D1 Readd1.readList your D1 databases to link them to repositories.
D1 Writed1.writeApply D1 migrations an Owner reviewed and confirmed, and create databases a deploy declares.
Account Analytics Readaccount-analytics.readShow request, error and query counts for linked Workers and D1 databases.
Containers Readcontainers.readList your Container applications to link them to repositories.

Gitflare asks for the rest feature by feature. When an Owner turns a feature on, Gitflare asks Cloudflare again for the connection's current permissions plus that feature's own (features on POST /api/cloudflare/connect, or on gitflare_manage_cloudflare_connection connect). Permissions already granted are kept on every re-authorization. A connect request without features adds the Deploy permissions only when the installation sets CLOUDFLARE_DEPLOY_SCOPES, and the Access permissions only when it sets CLOUDFLARE_ACCESS_SCOPES; otherwise it asks for the permissions above and nothing else. GET /api/cloudflare returns features: which features the current grant covers and which permissions each one is missing.

Each feature's permissions come from its environment variable. When the variable is not set, Gitflare uses the default shown below. Setting a variable replaces the default; it does not add to it.

Deploy (CLOUDFLARE_DEPLOY_SCOPES, default workers-scripts.edit d1.write):

PermissionScopeWhy
Workers Scripts Editworkers-scripts.editUpload and deploy your Workers and their previews when you land or deploy a change.
D1 Writed1.writeApply D1 migrations an Owner reviewed and confirmed, and create databases a deploy declares.

The hosted installation sets CLOUDFLARE_DEPLOY_SCOPES to workers-scripts.edit workers-r2.write queues.write workers-routes.write ai.write. D1 Write is already part of every connection there, and Deploy adds:

PermissionScopeWhy
Workers R2 Storage Writeworkers-r2.writeCreate the R2 buckets a deployed Worker declares in its Wrangler configuration.
Queues Writequeues.writeCreate the queues a deployed Worker produces to or consumes from.
Workers Routes Writeworkers-routes.writeAttach the custom domains a deployed Worker declares.
Workers AI Writeai.writeBind Workers AI to a deployed Worker that declares it.

A self-hosted installation can request the same by setting CLOUDFLARE_DEPLOY_SCOPES to that list.

Previews (CLOUDFLARE_PREVIEWS_SCOPES, default workers-scripts.admin d1.write):

PermissionScopeWhy
Workers Adminworkers-scripts.adminCreate Cloudflare Worker Previews of your Workers for proposals, and deploy them.
D1 Writed1.writeApply D1 migrations an Owner reviewed and confirmed, and create databases a deploy declares.

Workers Admin also satisfies every check that asks for Workers Scripts Edit.

Secrets (CLOUDFLARE_SECRETS_SCOPES, default secrets-store.read secrets-store.write):

PermissionScopeWhy
Secrets Store Readsecrets-store.readList the Secrets Store secrets you can link to a repository, by name only.
Secrets Store Writesecrets-store.writeCreate or rotate a secret you enter and bind linked secrets to your deployed Workers. Gitflare never reads a secret's value back.

Cloudflare Access (CLOUDFLARE_ACCESS_SCOPES, default zone-access.write zone-access.read; set it to an empty string to turn Access off):

PermissionScopeWhy
Access: Apps and Policies Writezone-access.writePut Cloudflare Access in front of deploy environments when an Owner chooses it.
Access: Apps and Policies Readzone-access.readCheck the Access applications Gitflare created.

These permissions are zone-level. Gitflare protects a deploy environment's hostnames on one of your zones through that zone's Access applications. workers.dev hostnames, including Worker Preview URLs, are not on a zone, so these permissions cannot protect them.

Optional permissions

An installation's operator chooses whether to request these by adding them to CLOUDFLARE_OAUTH_SCOPES. If they are not requested, or the grant lacks them, the rest of the connection keeps working:

PermissionScopeIf it is missing
Zone Readzone.readGitflare cannot look up a custom domain's zone. Add zone_id to that route in the Wrangler configuration yourself.
Workers Scripts Readworkers-scripts.readLinked Worker details beyond names are unavailable.
Workflows Readworkflows.readWorkflows do not appear in the resource catalog.

Without the deploy permissions, Gitflare still links resources, shows usage and applies reviewed D1 migrations; deploy and Worker Preview actions explain which permission is missing.

What Gitflare never does

  • It never changes account settings, members, API tokens or billing.
  • It never edits DNS records directly. Attaching a custom domain that a Worker's Wrangler configuration declares lets Cloudflare create that hostname's record.
  • It never deploys, migrates or creates resources on its own. Each action follows an Owner's explicit request, a reviewed migration, or a landed change in a repository configured to deploy.
  • It never gives a connection token to coding agents, MCP clients or the browser.

Token storage

A connection's tokens are encrypted with AES-GCM under the installation's encryption key, bound to the workspace (or repository) they belong to, and stored only in Gitflare's security service. Each workspace has its own connection; a repository can have its own instead. Owners can see which account is connected and which permissions were granted, never the token.

Revoking access

  • In Gitflare, Settings → Cloudflare → Disconnect deletes the stored connection and revokes its tokens at Cloudflare. A repository's own connection has its own Disconnect.
  • In the Cloudflare dashboard, remove Gitflare from the applications your profile has authorized. Gitflare then shows the connection as failing until an Owner reconnects or disconnects it.

Signing in again never restores a disconnected account; only Connect Cloudflare does.

Gitflare workspace documentation