Commit f0010e7
authored
feat: add support for attack-protection bot-detection and captcha configurations (#1189)
* feat: enhance attack protection configuration
- src/context/directory/handlers/attackProtection.ts: add botDetection and captcha properties to ParsedAttackProtection
- src/context/directory/handlers/attackProtection.ts: update attackProtectionFiles to include botDetection and captcha file paths
- src/context/directory/handlers/attackProtection.ts: load botDetection and captcha configurations in parse function
- src/context/directory/handlers/attackProtection.ts: dump botDetection and captcha configurations in dump function
- src/context/yaml/handlers/attackProtection.ts: include botDetection and captcha in ParsedAttackProtection
- src/tools/auth0/handlers/attackProtection.ts: add schema definitions for botDetection and captcha
- test/context/directory/attackProtection.test.js: add tests for botDetection and captcha configurations
- test/context/yaml/attackProtection.test.js: add YAML tests for botDetection and captcha
- test/tools/auth0/handlers/attackProtection.tests.js: mock botDetection and captcha in handler tests
* feat: implement attack protection defaults and integration
- src/context/defaults.ts: add attackProtectionDefaults function to mask sensitive captcha secrets.
- src/context/directory/handlers/attackProtection.ts: integrate attackProtectionDefaults for parsing attack protection data.
- src/context/yaml/handlers/attackProtection.ts: utilize attackProtectionDefaults to mask captcha configuration.
- src/tools/auth0/handlers/attackProtection.ts: refactor CAPTCHA providers into a constant and update related logic.
* feat: enhance attack protection types and defaults
- src/context/defaults.ts: add type annotation for attackProtection parameter
- src/context/directory/handlers/attackProtection.ts: update ParsedAttackProtection type to use AttackProtection
- src/context/yaml/handlers/attackProtection.ts: update ParsedAttackProtection type to use AttackProtection
- src/tools/auth0/handlers/attackProtection.ts: define AttackProtection type and update existing property type
- src/types.ts: update attackProtection asset type to use AttackProtection
* feat: refactor attack protection client calls
- src/tools/auth0/handlers/attackProtection.ts: replace direct client reference with this.client for attack protection methods
* feat: update auth0 dependency version
- package.json: bump auth0 from ^4.34.0 to ^4.35.0
- package-lock.json: bump auth0 from 4.34.0 to 4.35.0
* feat: add attack protection configurations
- examples/yaml/tenant.yaml: introduce attackProtection section with botDetection, captcha, breachedPasswordDetection, bruteForceProtection, and suspiciousIpThrottling settings
- examples/directory/attack-protection/bot-detection.json: create bot detection configuration file
- examples/directory/attack-protection/breached-password-detection.json: create breached password detection configuration file
- examples/directory/attack-protection/brute-force-protection.json: create brute force protection configuration file
- examples/directory/attack-protection/captcha.json: create captcha configuration file
- examples/directory/attack-protection/suspicious-ip-throttling.json: create suspicious IP throttling configuration file
* feat(tests): enhance attack protection tests
- test/tools/auth0/handlers/attackProtection.tests.js: add test for handling 403 error when fetching bot detection and captcha configs
- test/tools/auth0/handlers/attackProtection.tests.js: add test to skip updates when attackProtection is null
- test/tools/auth0/handlers/attackProtection.tests.js: add test to skip updates when attackProtection is an empty object
- test/tools/auth0/handlers/attackProtection.tests.js: add test to skip botDetection update when empty object
- test/tools/auth0/handlers/attackProtection.tests.js: add test to skip captcha update when empty object
- test/tools/auth0/handlers/attackProtection.tests.js: add test to clean up empty captcha providers before update
- test/tools/auth0/handlers/attackProtection.tests.js: add test to skip captcha update when updateCaptchaConfig is not a function
- test/tools/auth0/handlers/attackProtection.tests.js: add test to return cached existing data on subsequent calls
* feat: update attack protection handling
- src/context/yaml/handlers/attackProtection.ts: fix maskedAttackProtection assignment to use attackProtectionConfig
- src/tools/auth0/handlers/attackProtection.ts: simplify attackProtectionClient type assertion
- src/tools/auth0/handlers/attackProtection.ts: enhance site_key check for captcha provider configuration
* feat: simplify bot detection and captcha configuration updates
- src/tools/auth0/handlers/attackProtection.ts: streamline bot detection config update logic
- src/tools/auth0/handlers/attackProtection.ts: remove unnecessary checks for captcha config updates
- src/tools/auth0/handlers/attackProtection.ts: optimize captcha provider handling
* feat: clean up CAPTCHA provider configurations and update tests
- src/tools/auth0/handlers/attackProtection.ts: remove empty CAPTCHA provider configurations before updates to prevent API errors
- test/tools/auth0/handlers/attackProtection.tests.js: remove redundant test for skipping captcha update when updateCaptchaConfig is not a function1 parent 307224d commit f0010e7
14 files changed
Lines changed: 948 additions & 51 deletions
File tree
- examples
- directory/attack-protection
- yaml
- src
- context
- directory/handlers
- yaml/handlers
- tools/auth0/handlers
- test
- context
- directory
- yaml
- tools/auth0/handlers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 11 | + | |
17 | 12 | | |
18 | 13 | | |
19 | 14 | | |
| 15 | + | |
20 | 16 | | |
21 | 17 | | |
| 18 | + | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
| 25 | + | |
28 | 26 | | |
29 | 27 | | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
56 | 71 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 72 | + | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
| |||
70 | 81 | | |
71 | 82 | | |
72 | 83 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
76 | 99 | | |
77 | 100 | | |
78 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
13 | 8 | | |
14 | 9 | | |
15 | 10 | | |
16 | 11 | | |
17 | 12 | | |
18 | 13 | | |
19 | | - | |
20 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
21 | 37 | | |
22 | 38 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 39 | + | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
| |||
0 commit comments