Skip to content

Request declared network origins from widefleet.jsonc - #242

Merged
tnkuehne merged 1 commit into
feat/managed-oauth-providersfrom
feat/network-declarations
Nov 20, 2026
Merged

tnkuehne merged 1 commit into
feat/managed-oauth-providersfrom
feat/network-declarations

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What changes

Declaration. An app declares the origins it needs in widefleet.jsonc beside wrangler.jsonc:

{
  "network": {
    "backend": ["https://github.com", "https://api.github.com"],
  },
}

wrangler.jsonc stays Cloudflare's format: Wrangler already defines a top-level secrets key and warns about unknown keys.

  • widefleet deploy and the app builder read the file (JSONC, unknown keys rejected) and add network to the deployment's metadata. The JSONC parser moves from the builder to @platform/contracts/jsonc, which both the builder and the control plane use.
  • Code requests access, it never grants it. The network state now reports, against the latest deployment, requested origins that are not allowed yet and undeclared origins that are allowed but no longer declared. Allowed origins stay allowed after a version drops them, so rollbacks keep working. After a deploy, the CLI prints the widefleet network allow … command for the app's owner or an administrator; widefleet network lists both groups.
  • Template installs. The template page lists the hosts a template declares next to Install. That click grants exactly the shown hosts (the installer owns the new app); if the template changed meanwhile, the install asks again. API and CLI installs grant the declared origins only with the network:manage scope, as widefleet network allow requires; otherwise they stay requested, the response lists them in requestedNetwork, and widefleet catalog templates install prints the allow command. Grants happen only after publishing succeeded.
  • The Gmail, GitHub and OneDrive templates declare their origins; their guides point to the declaration.

Screenshots

The template page gains one line under the install form ("Installing allows the app to connect to …"). Before/after screenshots are still missing.

Tests

  • packages/app-builder: declared origins in metadata; invalid declarations fail the build.
  • crates/platform-cli: reading, defaults and unknown keys.
  • apps/control-plane/tests/network-cli.test.ts: requested and undeclared origins in widefleet network.
  • apps/control-plane/tests/template-installs.integration.test.ts: an API install requests the declared origins; a page install grants them.
  • Catalog, template, CLI (83) and builder suites pass.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new blocking issue was established.

Summary

Adds network requests from widefleet.jsonc to deployment metadata.

  • Apps can declare network origins in widefleet.jsonc.
  • Network status shows which declared origins still need approval.
  • Template installs can grant the network origins a person reviewed.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[widefleet.jsonc] --> B[CLI or app builder]
  B --> C[Stored deployment metadata]
  C --> D[Compare declaration with allowed origins]
  D --> E[Requested and undeclared origins]
  F[Owner or administrator approval] --> G[Allowed network policy]
  G --> H[Runtime enforcement]
Loading

Reviews (6) · Last reviewed commit: "Request declared network origins from wi..." · Reviewed by Greptile

@tnkuehne
tnkuehne added this pull request to stack #239 November 20, 2026 11:58
@tnkuehne
tnkuehne force-pushed the feat/network-declarations branch from 7d135b7 to 9586fc7 Compare November 20, 2026 12:00
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs 856fc91 Nov 20 2026, 02:32 PM

@tnkuehne
tnkuehne force-pushed the feat/network-declarations branch from 9586fc7 to e1c5657 Compare November 20, 2026 12:08
@tnkuehne
tnkuehne force-pushed the feat/network-declarations branch 2 times, most recently from 9314b5c to c23bf83 Compare November 20, 2026 12:26
@tnkuehne
tnkuehne force-pushed the feat/network-declarations branch from c23bf83 to 7a64dd7 Compare November 20, 2026 12:36
Comment thread crates/platform-cli/src/network.rs Resolved
Comment thread crates/platform-cli/src/deploy.rs Resolved
@tnkuehne
tnkuehne force-pushed the feat/network-declarations branch from 7a64dd7 to f03c452 Compare November 20, 2026 12:56
@tnkuehne
tnkuehne force-pushed the feat/network-declarations branch from f03c452 to c9f5272 Compare November 20, 2026 13:02
Comment thread packages/contracts/src/index.ts Resolved
@tnkuehne
tnkuehne force-pushed the feat/network-declarations branch from c9f5272 to 3b84533 Compare November 20, 2026 13:11
@tnkuehne
tnkuehne force-pushed the feat/network-declarations branch 2 times, most recently from f442f7e to 856fc91 Compare November 20, 2026 14:31
Apps declare the origins they need in widefleet.jsonc. widefleet deploy and
the app builder add them to the deployment, and the network state reports
origins the latest version requests but is not allowed to reach, and allowed
origins it no longer declares. Code requests access but never grants it: the
CLI prints the allow command for the owner or an administrator. Installing a
template from its page, which lists its origins, grants them.
@tnkuehne
tnkuehne merged commit 71c51ab into main Nov 20, 2026
16 checks passed
@tnkuehne
tnkuehne deleted the feat/network-declarations branch November 20, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant