Skip to content

🔒️ server: restrict bridge ramp to enabled users - #1079

Merged
cruzdanilo merged 1 commit into
mainfrom
enable
Jun 5, 2026
Merged

🔒️ server: restrict bridge ramp to enabled users#1079
cruzdanilo merged 1 commit into
mainfrom
enable

Conversation

@mainqueg

@mainqueg mainqueg commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Bridge integration now restricted to users with bridge access enabled. System returns appropriate error responses when users attempt access without proper enablement.
  • Tests

    • Expanded test suite to cover bridge enablement validation during onboarding and provider retrieval flows.

@changeset-bot

changeset-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: db8be2a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mainqueg, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 43 minutes and 33 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9add7267-3b2f-4632-8529-0555a4db32f0

📥 Commits

Reviewing files that changed from the base of the PR and between c6a630e and db8be2a.

📒 Files selected for processing (6)
  • .changeset/bridge-enable-flag.md
  • server/api/ramp.ts
  • server/test/api/ramp.test.ts
  • server/test/utils/bridge.test.ts
  • server/utils/persona.ts
  • server/utils/ramps/bridge.ts

Walkthrough

This PR adds a bridge_enable flag from Persona to gate access to the Bridge ramp provider. When the flag is false or missing, getProvider returns ONBOARDING status without proceeding with KYC, and onboarding throws a NOT_ENABLED error code (HTTP 400). The API layer is updated to map the new error, and comprehensive tests cover both enabled and disabled user flows.

Changes

Bridge enable flag feature

Layer / File(s) Summary
Persona schema extension for bridge_enable
server/utils/persona.ts
Extend BridgeAccount schema with a new nullish(boolean()) bridge_enable field to validate the flag from Persona account responses.
Bridge enable gating logic, error handling, and test coverage
server/utils/ramps/bridge.ts, server/api/ramp.ts, server/test/api/ramp.test.ts, server/test/utils/bridge.test.ts
Implement bridge_enable checks in getProvider and onboarding to return early or throw NOT_ENABLED for disabled users. Add ErrorCodes.NOT_ENABLED and wire it through the API error-handling switch. Define enabledPersonaAccount test fixture and add new tests verifying enabled/disabled behavior in both success and error flows. Update ~40 existing test cases to use the enabled fixture, ensuring they align with the new bridge_enable requirement.
Release documentation
.changeset/bridge-enable-flag.md
Document patch release with note that bridge ramp is restricted to enabled users.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • exactly/exa#1066: Both PRs extend the bridge onboarding flow's error handling by adding new bridge.ErrorCodes cases and updating the corresponding error-handling switch in server/api/ramp.ts plus server/utils/ramps/bridge.ts.
  • exactly/exa#950: Both PRs modify the bridge provider flow in server/utils/ramps/bridge.ts—the main PR gates onboarding/provider behavior via bridge_enable while the related PR extends the same getProvider logic for KYC link allowlisting.
  • exactly/exa#940: Both PRs modify server/utils/ramps/bridge.ts's getProvider logic for returning ONBOARDING and triggering warning capture, though one gates on bridge_enable and the other redirects on user status.

Suggested reviewers

  • nfmelendez
  • cruzdanilo
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly summarizes the main change: restricting bridge ramp functionality to users with an enabled flag, which is exactly what the changeset implements.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch enable
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch enable

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request restricts the bridge ramp feature to enabled users by checking the bridge_enable flag on the Persona account. It updates the Persona account schema, adds checks in the getProvider and onboarding functions to handle cases where the bridge is not enabled, and introduces a new NOT_ENABLED error code. Additionally, comprehensive unit tests have been added and updated to verify these changes. No review comments were provided, so there is no feedback to address.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6a630eded

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/utils/persona.ts Outdated
@sentry

sentry Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.57%. Comparing base (ce6ad88) to head (db8be2a).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server/utils/ramps/bridge.ts 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1079      +/-   ##
==========================================
+ Coverage   74.26%   74.57%   +0.31%     
==========================================
  Files         243      243              
  Lines       11213    11387     +174     
  Branches     3806     3886      +80     
==========================================
+ Hits         8327     8492     +165     
- Misses       2562     2571       +9     
  Partials      324      324              
Flag Coverage Δ
e2e 74.57% <93.33%> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nfmelendez

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db8be2ac0d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/utils/ramps/bridge.ts
@cruzdanilo
cruzdanilo merged commit db8be2a into main Jun 5, 2026
11 of 12 checks passed
@cruzdanilo
cruzdanilo deleted the enable branch June 5, 2026 19:27
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.

3 participants