Skip to content

fix(web): auth gate Ask APIs for Public SaaS - #1679

Merged
msukkari merged 6 commits into
mainfrom
cursor/auth-gate-ask-api-fe39
Sep 23, 2026
Merged

msukkari merged 6 commits into
mainfrom
cursor/auth-gate-ask-api-fe39

Conversation

@msukkari

@msukkari msukkari commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Fixes SOU-2308

Require authenticated users for the streaming and blocking Ask APIs when EXPERIMENT_ASK_GH_ENABLED is enabled, while preserving anonymous Ask behavior for self-hosted deployments. The auth override is checked inline at the Ask and MCP HTTP entry points.

Conflict resolution:

  • Resolved the simple CHANGELOG.md conflict by preserving the entries from both branches.
  • Accepted main's non-conflicting removal of the obsolete Ask tutorial/example-query assets and UI.
  • No conflicting intent or semantic conflict remained.

Validation:

  • Web tests: 147 files, 1,503 tests passed (.next/** excluded from Vitest discovery)
  • Public SaaS deployment verification: unauthenticated /api/chat/blocking and /api/ee/chat requests returned 401 NOT_AUTHENTICATED

Linear Issue: SOU-2308

Open in Web Open in Cursor 

Summary by cubic

Requires authenticated users for the streaming and blocking Ask APIs and the MCP ask_codebase tool when EXPERIMENT_ASK_GH_ENABLED is enabled, fixing SOU-2308. Anonymous Ask access is unchanged for self-hosted deployments.

  • Unauthenticated requests are rejected with a 401 (NOT_AUTHENTICATED) service error via an inlined boolean gate at each entry point.
  • The CHANGELOG records the auth requirement for the Ask APIs in Public SaaS deployments.

Written for commit 1daff8a. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Ask chat requests in Public SaaS now require authentication when the Ask experiment is enabled. Unauthenticated requests are rejected before entitlement checks or chat processing.
    • The blocking Ask API also rejects unauthenticated requests in this configuration.

Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 094e3161-9c5e-4cbf-889d-9a80efcb987a

📥 Commits

Reviewing files that changed from the base of the PR and between d12a32e and 1daff8a.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • packages/web/src/app/api/(server)/ee/chat/route.ts
  • packages/web/src/ee/features/mcp/askCodebase.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

When EXPERIMENT_ASK_GH_ENABLED is 'true', the chat route and askCodebase return notAuthenticated() if no user is authenticated. The Unreleased changelog records the authentication requirement for streaming and blocking Ask APIs in Public SaaS deployments.

Changes

Ask API authentication

Layer / File(s) Summary
Add authentication checks to Ask paths
packages/web/src/app/api/(server)/ee/chat/route.ts, packages/web/src/ee/features/mcp/askCodebase.ts, CHANGELOG.md
The chat route and askCodebase return notAuthenticated() when the Ask experiment is enabled and no user is present. The changelog records the Public SaaS authentication requirement.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: brendan-kellam

Merge Risk: ⚪ Minimal · up to 1daff

The streaming and blocking Ask APIs enforce the intended authentication requirement when the experiment is enabled. No merge-blocking issue was identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding authentication gates to the Ask APIs for Public SaaS.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
cursoragent and others added 3 commits September 23, 2026 03:07
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
@msukkari
msukkari marked this pull request as ready for review September 23, 2026 03:32
@msukkari
msukkari enabled auto-merge (squash) September 23, 2026 03:32
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/web/src/app/api/(server)/ee/chat/route.ts
Comment thread packages/web/src/app/api/(server)/ee/chat/route.ts
@msukkari
msukkari disabled auto-merge September 23, 2026 03:42
@msukkari
msukkari merged commit 23dc7bc into main Sep 23, 2026
16 checks passed
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.

2 participants