fix(connectors): deploy connectors with workspace API keys - #617
Open
netanelgilad wants to merge 1 commit into
Open
fix(connectors): deploy connectors with workspace API keys#617netanelgilad wants to merge 1 commit into
netanelgilad wants to merge 1 commit into
Conversation
`base44 deploy` with a `BASE44_API_KEY` workspace key failed with
"Error listing connectors: Forbidden" whenever the project had any
connector. The per-connector `external-auth/*` routes (list, set, remove)
and the Stripe `payments/stripe/*` routes require a platform user and
reject workspace keys, while the backend already exposes a key-capable
`PUT /api/apps/{id}/deployment/connectors` that reconciles the desired
connector set server-side.
Under a workspace key, `pushConnectors` now sends the local OAuth
connectors to that deployment route (mirroring the auth-config fix in
#565) and never touches the user-bound routes. Reconciliation with an
empty list is no longer skipped for keys, matching OAuth deploys. A local
Stripe connector is reported as an explicit unsupported error instead of
failing on the status call.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LeLErzhtT98SP1DVGM1UuX
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.14-pr.617.31be75ePrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.14-pr.617.31be75e"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.14-pr.617.31be75e"
}
}
Preview published to npm registry — try new features instantly! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
base44 deploywith aBASE44_API_KEYworkspace key failed withError listing connectors: Forbiddenas soon as a project had at least one connector, because connector sync went through the per-connectorexternal-auth/*andpayments/stripe/*routes, which all require a platform user. This PR routes connector sync through the key-capablePUT /api/apps/{id}/deployment/connectorsendpoint when a workspace API key is in use, mirroring the auth-config fix in #565. The previous "skip reconcile when there are no local connectors" workaround is removed, so key-based deploys now reconcile stale remote connectors the same way OAuth deploys do.Related Issue
None (reported by the BRIK/Wix team; follows the same pattern as #565)
Type of Change
Changes Made
connector/api.ts: newsyncDeploymentConnectors()callingPUT deployment/connectors, withApiError.fromHttpError()handling and Zod validationconnector/schema.ts:SyncDeploymentConnectorsResponseSchemawith the standard snake_case-to-camelCase transformconnector/push.ts:pushConnectors()branches onhasWorkspaceApiKeyAuth()and syncs via the deployment route, never touchingexternal-auth/*or Stripe routes under a key; each returned connector is reported assyncederror("not supported with a workspace API key") instead of a confusing status-call failure, and no Stripe request is madeproject/deploy.ts: removed theskipConnectorSyncworkaround so key-based deploys reconcile removals like OAuth deploys (deliberate behavior change; the skip only existed because of the 403)mockDeploymentConnectorsSync()toTestAPIServerdocs/resources.md(deploy step 5) anddocs/api-patterns.md(guidance to prefer key-capabledeployment/*routes for resources indeploy)Testing
npm test)Changelog
pushConnectors: OAuth-only sync, empty-list reconcile, and the Stripe error path (asserting no list/set/remove/Stripe calls)deployunder a workspace key with and without local connectors, asserting the deployment-route request body andapi_keyheader while the 403-ing routes stay mocked as forbiddenconnectors push, asserting the Stripe status route is never calledbun run typecheck,bun run lint, andbun run knippass; fullvitest runreports 763 passed with 2 pre-existingdev.spec.tsfailures that reproduce with this change stashed (sandbox has no Deno)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
Connectors created by the deployment route start disconnected and must be authorized once from the dashboard; already-authorized connectors (the reported BRIK case) are unaffected. Not in scope:
base44 connectors pullunder a workspace key still hitsexternal-auth/listand 403s.🤖 Generated by Claude | 2026-09-10 09:30 UTC | 31be75e