v0.6.100: auth, mothership, scopes improvements, new apify tools#4852
Conversation
…ding page (#4845) Adds an optional aiDisclaimer field to the integration landing content (types + data), rendered as an independent 'AI-generated content' section and baked into integrations.json via docs-gen. Populates Slack to satisfy Slack's AI-components guideline (disclaimer on the landing page).
…ch` (#4848) * fix(oauth): skipStateCookieCheck flag change * browser initated solution * fix draft timing issue
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryHigh Risk Overview Workspace OAuth from chat now uses a new browser Copilot passes Integration landing pages gain optional Reviewed by Cursor Bugbot for commit 34ee7f9. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR bundles five related changes: removal of the OIDC/JWT MCP provider plugin and its backing tables (
Confidence Score: 4/5Safe to merge with awareness that the management-handler permission model has a design gap that is now more visible. The OAuth state-mismatch fix is well-reasoned and the browser-initiated flow is implemented correctly with a proper open-redirect guard. The OIDC removal is complete — schema, routes, plugins, CORS rules, and the DB migration all match. Two areas warrant follow-up: the new authorize endpoint creates a pendingCredentialDraft for any non-empty providerId string before validating it against known services, which could produce orphaned drafts; and userPermission flowing from the client payload is now the sole write-gate in the management handlers, which can be bypassed by omission. Neither is a regression — the draft expires, and the permission gap existed before. The HubSpot scope reduction and AI disclaimer addition are straightforward and low-risk. apps/sim/app/api/auth/oauth2/authorize/route.ts (providerId validation before draft creation) and apps/sim/lib/copilot/tools/handlers/management/* (userPermission as sole write gate) Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant CopilotAPI as /api/chat (copilot)
participant OAuthHandler as oauth.ts handler
participant AuthorizeRoute as /api/auth/oauth2/authorize
participant BetterAuth as Better Auth
participant Provider as OAuth Provider
Browser->>CopilotAPI: POST /api/chat (message: connect Google)
CopilotAPI->>OAuthHandler: executeOAuthGetAuthLink(context)
OAuthHandler->>OAuthHandler: ensureWorkspaceAccess(workspaceId, userId, write)
OAuthHandler->>OAuthHandler: generateOAuthLink(workspaceId, workflowId, ...)
OAuthHandler-->>CopilotAPI: "oauth_url = /api/auth/oauth2/authorize?providerId=...&workspaceId=..."
CopilotAPI-->>Browser: stream response with oauth_url
Note over Browser,Provider: User clicks the oauth_url link
Browser->>AuthorizeRoute: "GET /api/auth/oauth2/authorize?providerId=google&workspaceId=ws-1"
AuthorizeRoute->>AuthorizeRoute: getSession() validate auth
AuthorizeRoute->>AuthorizeRoute: checkWorkspaceAccess(workspaceId, userId)
AuthorizeRoute->>AuthorizeRoute: createConnectDraft(userId, workspaceId, providerId)
AuthorizeRoute->>BetterAuth: "auth.api.oAuth2LinkAccount({ providerId, callbackURL })"
BetterAuth-->>AuthorizeRoute: "{ url: provider_auth_url } + Set-Cookie state"
AuthorizeRoute-->>Browser: 302 to provider + Set-Cookie forwarded
Browser->>Provider: GET provider_auth_url
Provider-->>Browser: "302 to /api/auth/callback/google?code=...&state=..."
Browser->>BetterAuth: GET /api/auth/callback/google with state cookie
BetterAuth->>BetterAuth: account.create.after hook consume pendingCredentialDraft
BetterAuth-->>Browser: 302 to callbackURL
Reviews (1): Last reviewed commit: "fix(mothership): connect integrations fr..." | Re-trigger Greptile |
… dispatch (#4850) The live SSE path counts pending pre-stamps (isExecInFlight) but countRunningCells excluded them, so each per-window refetch reset the badge from ~20 to 0 (visible flicker now that the control stays shown via hasActiveDispatch). Include unclaimed pre-stamps in byRowId when a dispatch is active; keep excluding them only in the no-dispatch fallback (orphan case).
* feat(apify): add run task, get dataset items, and get run tools * fix(apify): guard undefined dataset id and forward explicit offset=0
state_mismatch#4848)