feat: add Bot Detection and CAPTCHA attack protection endpoints#1235
Merged
developerkunal merged 1 commit intomasterfrom Nov 4, 2025
Merged
feat: add Bot Detection and CAPTCHA attack protection endpoints#1235developerkunal merged 1 commit intomasterfrom
developerkunal merged 1 commit intomasterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1235 +/- ##
==========================================
+ Coverage 79.55% 79.56% +0.01%
==========================================
Files 506 515 +9
Lines 18716 18926 +210
Branches 8934 9027 +93
==========================================
+ Hits 14889 15059 +170
- Misses 3827 3867 +40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kushalshit27
approved these changes
Nov 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This PR adds support for managing Bot Detection and CAPTCHA attack protection settings in the Management API client. It introduces new resource clients for both features with full CRUD operations, comprehensive type definitions, and test coverage.
Endpoints Added
Bot Detection Resource (
client.attackProtection.botDetection)GET /api/v2/attack-protection/bot-detection- Get bot detection configurationPATCH /api/v2/attack-protection/bot-detection- Update bot detection settingsCAPTCHA Resource (
client.attackProtection.captcha)GET /api/v2/attack-protection/captcha- Get CAPTCHA configurationPATCH /api/v2/attack-protection/captcha- Update CAPTCHA settingsClasses and Methods Added
New Resource Clients:
BotDetectionclass with:get()- Retrieve bot detection configurationupdate(request)- Update bot detection settingsCaptchaclass with:get()- Retrieve CAPTCHA configurationupdate(request)- Update CAPTCHA settingsAttackProtection Class Enhanced:
botDetection: BotDetectionpropertycaptcha: CaptchapropertyType Definitions Added
Bot Detection Types:
GetBotDetectionSettingsResponseContentUpdateBotDetectionSettingsRequestContentUpdateBotDetectionSettingsResponseContentBotDetectionAllowlistBotDetectionLevelEnum(strict, moderate, relaxed)BotDetectionMonitoringModeEnabledBotDetectionChallengePolicyPasswordFlowEnumBotDetectionChallengePolicyPasswordResetFlowEnumBotDetectionChallengePolicyPasswordlessFlowEnumBotDetectionIPv4OrCidrBlock,BotDetectionIPv6OrCidrBlock,BotDetectionIpAddressOrCidrBlockCAPTCHA Types:
GetAttackProtectionCaptchaResponseContentUpdateAttackProtectionCaptchaRequestContentUpdateAttackProtectionCaptchaResponseContentAttackProtectionCaptchaProviderId(enum for provider selection)AttackProtectionCaptchaAuthChallengeRequestAttackProtectionCaptchaAuthChallengeResponseContentAttackProtectionCaptchaArkoseResponseContent&AttackProtectionUpdateCaptchaArkoseAttackProtectionCaptchaRecaptchaV2ResponseContent&AttackProtectionUpdateCaptchaRecaptchaV2AttackProtectionCaptchaRecaptchaEnterpriseResponseContent&AttackProtectionUpdateCaptchaRecaptchaEnterpriseAttackProtectionCaptchaHcaptchaResponseContent&AttackProtectionUpdateCaptchaHcaptchaAttackProtectionCaptchaFriendlyCaptchaResponseContent&AttackProtectionUpdateCaptchaFriendlyCaptchaAttackProtectionCaptchaSimpleCaptchaResponseContentUsage Examples
Documentation
reference.mdwith comprehensive API documentation for new endpointsDependency Updates
yarn.lockdependenciesReferences
Testing
All new functionality has comprehensive test coverage.
New Test Files:
src/management/tests/wire/attackProtection/botDetection.test.ts(237 lines) - Tests for bot detection operationssrc/management/tests/wire/attackProtection/captcha.test.ts(272 lines) - Tests for CAPTCHA operationsCI Status:
All checks are expected to pass for this Fern-generated code.
Checklist