Skip to content

fix: handle 403 entitlement errors for bot detection and captcha on export - #1434

Draft
ankita10119 wants to merge 4 commits into
masterfrom
DXCDT-1689
Draft

fix: handle 403 entitlement errors for bot detection and captcha on export #1434
ankita10119 wants to merge 4 commits into
masterfrom
DXCDT-1689

Conversation

@ankita10119

Copy link
Copy Markdown
Contributor

🔧 Changes

Fixes 403 entitlement error handling for bot detection and captcha on export, in preparation for ROAD-8051 (free_bot_detection_deprecation FF).

Export (GET):

  • Decoupled botDetection.get() and captcha.get() into independent calls with independent error handling. Previously both were in a single Promise.all, a 403 on bot detection would silently discard captcha data even though captcha returned 200.
  • A 403 on either endpoint now logs a warning and skips that resource independently, without affecting the other.
  • Updated warning message to reference the tenant's plan rather than OAuth scopes.

Deploy (PATCH):

  • Bot detection and captcha 403s surface to the user as errors (per API team confirmation that PATCH 403 should not be handled gracefully).

📚 References

🔬 Testing

Unit tests cover:

  • GET 403 on bot detection - captcha data is preserved in the export
  • GET 403 on captcha - bot detection data is preserved in the export
  • Happy path export and import verified on real tenant

Real tenant 403 testing is pending entitlement access (requires free_bot_detection_deprecation FF + bot detection entitlement revoked)

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@ankita10119
ankita10119 requested a review from a team as a code owner July 24, 2026 11:18
@ankita10119
ankita10119 marked this pull request as draft July 24, 2026 11:18
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@52b338f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/tools/auth0/handlers/attackProtection.ts 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1434   +/-   ##
=========================================
  Coverage          ?   80.15%           
=========================================
  Files             ?      163           
  Lines             ?     7539           
  Branches          ?     1664           
=========================================
  Hits              ?     6043           
  Misses            ?      802           
  Partials          ?      694           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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