Skip to content

[comp] Production Deploy#2721

Merged
tofikwest merged 4 commits intoreleasefrom
main
Apr 30, 2026
Merged

[comp] Production Deploy#2721
tofikwest merged 4 commits intoreleasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.

tofikwest and others added 3 commits April 30, 2026 08:35
The frontend hook posted `userId: ''` with a comment that the API would
fill it in from the auth context, but the controller was reading userId
straight from the request body, so every IntegrationOAuthState row was
written with an empty userId.

This was harmless until #2712 added a defense-in-depth session check
on the OAuth callback that compares `session.user.id` to
`oauthState.userId`. Because the stored value was always empty, every
OAuth flow (GitHub, GCP, AWS, Rippling, etc.) now redirects with
`error=session_mismatch` and "OAuth flow can only be completed by the
user who initiated it." The spec did not catch this because the
callback tests mocked `oauthState` directly with a non-empty userId
rather than exercising start -> callback end-to-end.

Resolve userId via the @userid() decorator instead of trusting the
request body, drop it from StartOAuthDto, and stop sending it from the
client.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Address cubic-dev-ai review feedback. With HybridAuthGuard alone, an
API-key or service-token caller would reach the @userid() decorator,
which throws a plain Error (turning into a generic 500) when no
session user is present.

Add SessionOnlyGuard between HybridAuthGuard and PermissionGuard so
non-session auth is rejected with a clean 403 and a clear message.
The OAuth callback already requires a real session (see
checkSessionMatchesState), so non-session callers could never have
completed the flow anyway — this just moves the rejection upfront.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ntext

fix(integrations): source OAuth initiator userId from auth context
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comp-framework-editor (staging) Ready Ready Preview, Comment Apr 30, 2026 0:55am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app (staging) Skipped Skipped Apr 30, 2026 0:55am
portal (staging) Skipped Skipped Apr 30, 2026 0:55am

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Requires human review: Modifies authentication logic and API request shapes by adding SessionOnlyGuard and deriving userId from auth context. These are core logic and security-related changes.

@tofikwest tofikwest merged commit 22e44df into release Apr 30, 2026
13 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.39.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants