Skip to content

Let anyone who manages an app connect it to any API in the organization - #369

Merged
tnkuehne merged 2 commits into
mainfrom
open-connections
Nov 24, 2026
Merged

tnkuehne merged 2 commits into
mainfrom
open-connections

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Connections to app APIs no longer need administrator approval. Anyone who manages the calling app, as owner or collaborator, connects it to any API in the organization. Administrators no longer choose per API whether approval is required.

Removed

  • UI: availability page, connection request pages, the Requests view and the approval grouping in App APIs, the Access row on API pages, and the request variant of the connection form
  • API: PUT /api/v1/app-services/{appId}/access and /api/v1/connection-requests (list, create, approve, reject); accessMode leaves the app service schemas
  • CLI: widefleet services access|requests|approve|reject and widefleet connect --request
  • Database: nothing yet. The code stops reading connection_request and app.service_access_mode; Remove the connection request table and API availability column #372 drops them in a later deployment, because Hosted migrates before the new control plane replaces the old one.

Binding permission checks stay the same: the caller must be an app the person manages, and the provider must be a deployed app in the same organization with the selected entrypoint. Cycle, binding-name and resource-collision checks are unchanged.

Documentation: #370

Screenshots

Member view, before and after.

Before After
App APIs, 1280 light
App APIs, 390 dark
API page, 1280 light
API page, 390 dark
Connection form, 1280 light
Connection form, 390 dark
Connections empty state, hint text, light
Connections empty state, hint text, dark

Not shown: administrator views. They only lose the same elements.

Testing

  • pnpm exec vitest run (full default suite)
  • RUN_CLI_TESTS=1 pnpm exec vitest run apps/control-plane/tests/app-services-cli.test.ts
  • Playwright: lets members connect any API in their organization, shows versioned service documentation through authenticated API and accessible pages
  • cargo clippy -p platform-cli --all-targets -- -D warnings, cargo test -p platform-cli
  • pnpm typecheck, oxfmt --check, oxlint --type-aware

@greptile-apps

This comment has been minimized.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 24, 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 9ef69a5 Nov 24 2026, 01:43 PM

@tnkuehne

Copy link
Copy Markdown
Contributor Author

On Old approvals overwrite newer bindings: an approval was always made by an organization administrator, who can set any binding before and after this change. A command that Cloudflare accepted before the upgrade and that runs again afterwards therefore applies an authorized change, the same as any other delayed binding command. Ordering against a later edit is the same as for every direct binding change, which never carried a request ID. Keeping connectionRequestId readable would bring back the approval check that this PR removes, so I am leaving it out.

Connections to app APIs no longer need administrator approval. Owners and
collaborators of the calling app connect it directly, and administrators no
longer decide per API whether approval is required.

This removes the availability setting, connection requests and their pages,
API routes and CLI commands, and drops the connection_request table and the
app.service_access_mode column.
Hosted deployments migrate the database before the new control plane
replaces the old one, which still reads app.service_access_mode. The cleanup
moves to a follow-up migration. Also cover collaborators connecting an API.
<input {...action.fields.appId.as("hidden", data.app.id)} />
<input {...action.fields.targetApp.as("hidden", data.service.appId)} />
{#if !data.approval}<input {...connectApp.fields.guided.as("hidden", "true")} />{/if}
<form {...connectApp} class="space-y-6">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Connect silently replaces bindings

If a member enters a binding name already used for a different API or entrypoint, clicking Connect API redirects the app’s calls without warning. The old request form rejected reused names for APIs that required approval. Check the name when saving and require explicit confirmation before replacing a binding.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how direct connections already behave on main, for administrators and for APIs available to the organization; the CLI and PUT /apps/{appId}/bindings/{binding} set a binding the same way. Only people who manage the caller can change its bindings, and they can change any of them. The unused-name rule existed because an approval must not change a binding the requester had not asked to replace. The form now follows the direct path for everyone, so I am keeping it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it — that makes sense. Since only app managers can modify bindings and this aligns with how the direct connection path already works, keeping the existing behavior is the right call. The unused-name constraint was specific to the approval workflow and doesn't apply here.

Comment on lines 81 to 82
await resolveAppService(transaction, app.organizationId, grant);

if (!principal.application.admin && !authorization && !isDeepStrictEqual(grants[name], grant)) {
const [service] = await transaction
.select({ accessMode: apps.serviceAccessMode })
.from(apps)
.where(eq(apps.id, grant.app));

if (service?.accessMode !== "organization")
throw new InvalidOperation({
code: "FORBIDDEN",
message: "This API requires administrator approval. Request a connection first.",
});
}

await checkServiceCycle(transaction, app.organizationId, app.id, grant.app);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Saved connections block retirement

Another app’s manager can now connect to a previously restricted API without approval. That saved connection blocks the provider owner from deleting the app or removing the entrypoint, even if the calling app has never deployed. The owner can’t disconnect it unless they also manage the calling app. Give provider owners a way to stop new connections and clear existing ones when retiring an API.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking removal while apps are connected is intended: deleting the provider or an entrypoint would break those callers. Organization administrators manage every app, so they can disconnect a caller when an API is retired; the provider owner asks them or the caller's managers. A per-API switch to stop new connections is the availability setting this PR removes on purpose. Who may connect to an API will follow the API's access rules in a later change.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it — that makes sense. The blocking is there to protect callers from breakage, and administrators having full app management rights gives them the tools to coordinate retirement when needed. Thanks for clarifying the design intent.

@tnkuehne
tnkuehne removed this pull request from stack #371 November 24, 2026 16:15
@tnkuehne
tnkuehne merged commit 8ff341b into main Nov 24, 2026
18 checks passed
@tnkuehne
tnkuehne deleted the open-connections branch November 24, 2026 16:20
tnkuehne added a commit that referenced this pull request Nov 24, 2026
Drops the `connection_request` table and the `app.service_access_mode`
column that #369 stopped using.

This ships in a later deployment than #369. Hosted deployments migrate
the database before the new control plane replaces the old one, and the
previous control plane still selected `app.service_access_mode`.

## Testing

- Locally, once: an upgrade from `0041` with a stored connection request
and availability value removes the table and the column and keeps the
apps.


<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a
href="https://app.greptile.com/api/retrigger?id=117969562&amp;sig=817e007b931e0cb09bf86ab791557471b441d686e3eda91a79d0550aaf1b4f11"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"
align="right"></picture></a><a
href="https://app.greptile.com/-/switch-tenant?tenant=mendra&amp;next=%2Fwidefleet%2Fwidefleet%2Fpull%2F372&amp;utm_source=greptile_review&amp;utm_medium=github&amp;utm_campaign=view_in_greptile"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img
alt="View in Greptile"
src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"
align="right"></picture></a>Confidence Score: 4/5</h2>

<!-- greptile-risk -->

Verify that each Hosted installation is running a Worker that includes
#369 before applying `0042`.

<h2>Findings</h2>

1. <img alt="P1"
src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9"
align="top">&nbsp;**Older Workers lose app connections** <a
href="https://github.com/widefleet/widefleet/pull/372#discussion_r4683279977">▶</a>

<details open><summary><h3>Summary</h3></summary>

Migration `0042` removes the `connection_request` table and
`app.service_access_mode` column now that #369 no longer uses them.

- The database drops old connection requests and app access settings.
</details>

<details open><summary><h3>Diagram</h3></summary>

```mermaid
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["Hosted applies migration 0042"] --> B["Live Worker continues serving"]
  B --> C["Hosted deploys replacement Worker"]
  B --> D["Pre-#369 Worker reads the dropped column and fails"]
```
</details>

<!-- greptile_confidence_score:4 -->

<sub>Reviews (1) · Last reviewed commit: ["Drop the migration journal
check"](63163f8)
· [Reviewed by
Greptile](https://www.greptile.com/?utm_source=greptile_review&utm_medium=github&utm_campaign=review_public&utm_content=widefleet/widefleet)</sub>

<!-- /greptile_comment -->
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