Skip to content

feat: Added Support for Bot Detection Endpoints#1213

Merged
tanya732 merged 7 commits intov4from
SDK-6856-public-api-for-bot-detection-node-auth0-v4
Nov 3, 2025
Merged

feat: Added Support for Bot Detection Endpoints#1213
tanya732 merged 7 commits intov4from
SDK-6856-public-api-for-bot-detection-node-auth0-v4

Conversation

@kushalshit27
Copy link
Contributor

@kushalshit27 kushalshit27 commented Oct 16, 2025

Changes

Added Bot Detection configuration endpoints to /attack-protection manager

Endpoint Method Function
/api/v2/attack-protection/bot-detection GET getBotDetectionConfig
/api/v2/attack-protection/bot-detection PATCH updateBotDetectionConfig
/api/v2/attack-protection/captcha GET getCaptchaConfig
/api/v2/attack-protection/captcha PATCH updateCaptchaConfig

Manual Testing Snippet

  1. Install npm install auth0
  2. Get Domain, ClientId and ClientSecret from Auth0 Dashboard
import { ManagementClient } from 'auth0';

const client = new ManagementClient({
  domain: '<DOMAIN>',
  clientId: '<CLIENT_ID>',
  clientSecret: '<CLIENT_SECRET>',
});

// Get Bot Detection configuration
const botConfig = await client.attackProtection.getBotDetectionConfig();
console.log('Bot Detection Config:', botConfig.data);

// Update Bot Detection settings
const updateBotPayload: UpdateBotDetectionSettingsRequestContent = {
  bot_detection_level: 'medium',
  allowlist: ['192.168.1.0'],
  monitoring_mode_enabled: true
};

const updatedBotConfig = await client.attackProtection.updateBotDetectionConfig(updateBotPayload);
console.log('Updated Bot Detection Config:', updatedBotConfig.data);

// Get CAPTCHA configuration
const captchaConfig = await client.attackProtection.getCaptchaConfig();
console.log('CAPTCHA Config:', captchaConfig.data);

// Update CAPTCHA configuration
const updateCaptchaPayload: UpdateCaptchaRequestContent = {
  siteKey: 'your-site-key',
  secret: 'your-secret'
};

const updatedCaptchaConfig = await client.attackProtection.updateCaptchaConfig(updateCaptchaPayload);
console.log('Updated CAPTCHA Config:', updatedCaptchaConfig.data);

Testing

This change adds comprehensive unit test coverage for the new Bot Detection and CAPTCHA configuration endpoints.

  • This change adds unit test coverage
  • This change adds integration test coverage

Test Results:

  • Added 18 new unit tests for Bot Detection endpoints (getBotDetectionConfig, updateBotDetectionConfig)
  • Added 18 new unit tests for CAPTCHA configuration endpoints (getCaptchaConfig, updateCaptchaConfig)
  • All 57 attack protection tests pass successfully

Checklist

@kushalshit27 kushalshit27 changed the title feat: Added Support for Bot Detection feat: Added Support for Bot Detection endpoints Oct 16, 2025
@kushalshit27 kushalshit27 changed the title feat: Added Support for Bot Detection endpoints feat: Added Support for Bot Detection Endpoints Oct 16, 2025
@tanya732 tanya732 marked this pull request as ready for review November 3, 2025 07:39
@tanya732 tanya732 requested a review from a team as a code owner November 3, 2025 07:39
@tanya732 tanya732 merged commit 20a115b into v4 Nov 3, 2025
1 check passed
@tanya732 tanya732 deleted the SDK-6856-public-api-for-bot-detection-node-auth0-v4 branch November 3, 2025 07:42
@tanya732 tanya732 mentioned this pull request Nov 4, 2025
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