feat(core): add test_accounts_captcha for staging CAPTCHA bypass#417
feat(core): add test_accounts_captcha for staging CAPTCHA bypass#417
Conversation
Allow specific phone numbers to skip CAPTCHA validation, enabling automated agents to authenticate on staging without solving Geetest. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a new test_accounts_captcha configuration option to allow specific phone numbers to bypass CAPTCHA validation during authentication on staging environments. This enables automated agents to authenticate without solving Geetest challenges, while maintaining all other security checks like rate limiting and SMS verification.
Changes:
- Adds
test_accounts_captchaconfiguration schema and getter function to support phone number-based CAPTCHA bypass - Modifies
requestPhoneCodeWithCaptchato skip Geetest validation for phones in the bypass list - Sets default empty array in galoy.yaml to ensure production safety by default
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| core/api/src/config/schema.types.d.ts | Adds type definition for test_accounts_captcha as array of phone objects |
| core/api/src/config/schema.ts | Defines JSON schema for test_accounts_captcha configuration with validation rules |
| core/api/src/config/yaml.ts | Implements getTestAccountsCaptcha getter to extract phone numbers from config |
| core/api/src/app/authentication/request-code.ts | Adds conditional CAPTCHA bypass logic for phones in test_accounts_captcha list |
| core/api/galoy.yaml | Sets empty default array ensuring no phones bypass CAPTCHA by default |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
On Local/Staging, call API with dummy CAPTCHA values instead of skipping the request entirely. Server-side test_accounts_captcha handles bypass while SMS still gets sent. Requires backend PR blinkbitcoin/blink#417 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Mobile companion PR: blinkbitcoin/blink-mobile#3588 |
- Add info logging when CAPTCHA validation is skipped - Add tracing attributes for observability - Add unit tests for test_accounts_captcha config Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Addressed Copilot review feedback:
|
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
On Local/Staging, call API with dummy CAPTCHA values instead of skipping the request entirely. Server-side test_accounts_captcha handles bypass while SMS still gets sent. Requires backend PR blinkbitcoin/blink#417 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Copilot review comments addressed in commit 0aaec67:
|
Co-authored-by: dolcalmi <2079600+dolcalmi@users.noreply.github.com>
…03fe109f9a290ba517d2dffd05ac92ab78bc303b2f57975601a5a
Co-authored-by: dolcalmi <2079600+dolcalmi@users.noreply.github.com>
…e1d76053c691df1d2cc76055441af708bbfa75ff862db94345327
Co-authored-by: dolcalmi <2079600+dolcalmi@users.noreply.github.com>
…85ca5b073646d51eca8c22097124b83715039ffc5021120bef0ac
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 13 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Allows specific phone numbers (configured in galoy.yaml) to bypass Geetest CAPTCHA validation. Enables automated agents to authenticate on staging without solving challenges. Changes: - Add test_accounts_captcha config option (schema + types + yaml parser) - Skip CAPTCHA in requestPhoneCodeWithCaptcha when phone is in list - Add logging and tracing when CAPTCHA is skipped - Integration tests with mocked dependencies verify bypass logic - Unit tests for config parsing Recreates blinkbitcoin#417 (reverted in blinkbitcoin#424) with: - No quickstart changes (auto-generated) - No unrelated dependency bumps - Proper integration tests with mocking
Summary
test_accounts_captchaconfig option to allow specific phone numbers to bypass CAPTCHA validationRelated blink-mobile PR: blinkbitcoin/blink-mobile#3588
Why This Is Important
Currently, there's no difference between production and staging CAPTCHA requirements. Automated agents (e.g., for testing, monitoring, or CI) cannot authenticate via phone because they cannot solve Geetest CAPTCHA challenges. This blocks agent-based workflows on staging environments.
How It Works
test_accounts_captcha- an array of phone numbers that skip CAPTCHA validationrequestPhoneCodeWithCaptchais called, it checks if the phone is in the listHow To Use
Add phone numbers to your staging config (e.g.,
custom.yaml):Agents call
/auth/phone/codewith dummy CAPTCHA values:{ "phone": "+1234567890", "challengeCode": "bypass", "validationCode": "bypass", "secCode": "bypass", "channel": "sms" }Note: CAPTCHA params are still required by the API schema—just pass any string values.
Security Considerations
test_accountsfor full bypassTest plan
pnpm buildin core/api)test_accounts_captchacan request code without valid CAPTCHA🤖 Generated with Claude Code