Repository navigation
Let anyone who manages an app connect it to any API in the organization - #369
Conversation
This comment has been minimized.
This comment has been minimized.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 9ef69a5 | Nov 24 2026, 01:43 PM |
|
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 |
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.
2a69f86 to
9ef69a5
Compare
| <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"> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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&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&next=%2Fwidefleet%2Fwidefleet%2Fpull%2F372&utm_source=greptile_review&utm_medium=github&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"> **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 -->
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
PUT /api/v1/app-services/{appId}/accessand/api/v1/connection-requests(list, create, approve, reject);accessModeleaves the app service schemaswidefleet services access|requests|approve|rejectandwidefleet connect --requestconnection_requestandapp.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.
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.tslets members connect any API in their organization,shows versioned service documentation through authenticated API and accessible pagescargo clippy -p platform-cli --all-targets -- -D warnings,cargo test -p platform-clipnpm typecheck,oxfmt --check,oxlint --type-aware