|
8 | 8 | import com.browserup.bup.filters.RequestFilter; |
9 | 9 | import com.browserup.bup.filters.ResponseFilter; |
10 | 10 | import com.browserup.bup.mitm.TrustSource; |
11 | | -import com.browserup.bup.proxy.BlacklistEntry; |
| 11 | +import com.browserup.bup.proxy.BlocklistEntry; |
12 | 12 | import com.browserup.bup.proxy.CaptureType; |
13 | 13 | import com.browserup.bup.proxy.auth.AuthType; |
14 | 14 | import com.browserup.bup.proxy.dns.AdvancedHostResolver; |
@@ -406,105 +406,105 @@ default Har getHar() { |
406 | 406 | void clearRewriteRules(); |
407 | 407 |
|
408 | 408 | /** |
409 | | - * Adds a URL-matching regular expression to the blacklist. Requests that match a blacklisted URL will return the specified HTTP |
410 | | - * statusCode for all HTTP methods. If there are existing patterns on the blacklist, the urlPattern will be evaluated last, |
411 | | - * after the URL is checked against all other blacklist entries. |
| 409 | + * Adds a URL-matching regular expression to the blocklist. Requests that match a blocklisted URL will return the specified HTTP |
| 410 | + * statusCode for all HTTP methods. If there are existing patterns on the blocklist, the urlPattern will be evaluated last, |
| 411 | + * after the URL is checked against all other blocklist entries. |
412 | 412 | * The urlPattern matches the full URL of the request, including scheme, host, and port, path, and query parameters |
413 | | - * for both HTTP and HTTPS requests. For example, to blacklist both HTTP and HTTPS requests to www.google.com, |
| 413 | + * for both HTTP and HTTPS requests. For example, to blocklist both HTTP and HTTPS requests to www.google.com, |
414 | 414 | * use a urlPattern of "https?://www\\.google\\.com/.*". |
415 | 415 | * |
416 | | - * @param urlPattern URL-matching regular expression to blacklist |
| 416 | + * @param urlPattern URL-matching regular expression to blocklist |
417 | 417 | * @param statusCode HTTP status code to return |
418 | 418 | */ |
419 | | - void blacklistRequests(String urlPattern, int statusCode); |
| 419 | + void blocklistRequests(String urlPattern, int statusCode); |
420 | 420 |
|
421 | 421 | /** |
422 | | - * Adds a URL-matching regular expression to the blacklist. Requests that match a blacklisted URL will return the specified HTTP |
| 422 | + * Adds a URL-matching regular expression to the blocklist. Requests that match a blocklisted URL will return the specified HTTP |
423 | 423 | * statusCode only when the request's HTTP method (GET, POST, PUT, etc.) matches the specified httpMethodPattern regular expression. |
424 | | - * If there are existing patterns on the blacklist, the urlPattern will be evaluated last, after the URL is checked against all |
425 | | - * other blacklist entries. |
426 | | - * See {@link #blacklistRequests(String, int)} for details on the URL the urlPattern will match. |
| 424 | + * If there are existing patterns on the blocklist, the urlPattern will be evaluated last, after the URL is checked against all |
| 425 | + * other blocklist entries. |
| 426 | + * See {@link #blocklistRequests(String, int)} for details on the URL the urlPattern will match. |
427 | 427 | * |
428 | | - * @param urlPattern URL-matching regular expression to blacklist |
| 428 | + * @param urlPattern URL-matching regular expression to blocklist |
429 | 429 | * @param statusCode HTTP status code to return |
430 | 430 | * @param httpMethodPattern regular expression matching a request's HTTP method |
431 | 431 | */ |
432 | | - void blacklistRequests(String urlPattern, int statusCode, String httpMethodPattern); |
| 432 | + void blocklistRequests(String urlPattern, int statusCode, String httpMethodPattern); |
433 | 433 |
|
434 | 434 | /** |
435 | | - * Replaces any existing blacklist with the specified blacklist. URLs will be evaluated against the blacklist in the order |
| 435 | + * Replaces any existing blocklist with the specified blocklist. URLs will be evaluated against the blocklist in the order |
436 | 436 | * specified by the Collection's iterator. |
437 | 437 | * |
438 | | - * @param blacklist new blacklist entries |
| 438 | + * @param blocklist new blocklist entries |
439 | 439 | */ |
440 | | - void setBlacklist(Collection<BlacklistEntry> blacklist); |
| 440 | + void setBlocklist(Collection<BlocklistEntry> blocklist); |
441 | 441 |
|
442 | 442 | /** |
443 | | - * Returns all blacklist entries currently in effect. Iterating over the returned Collection is guaranteed to return |
444 | | - * blacklist entries in the order in which URLs are actually evaluated against the blacklist. |
| 443 | + * Returns all blocklist entries currently in effect. Iterating over the returned Collection is guaranteed to return |
| 444 | + * blocklist entries in the order in which URLs are actually evaluated against the blocklist. |
445 | 445 | * |
446 | | - * @return blacklist entries, or an empty collection if none exist |
| 446 | + * @return blocklist entries, or an empty collection if none exist |
447 | 447 | */ |
448 | | - Collection<BlacklistEntry> getBlacklist(); |
| 448 | + Collection<BlocklistEntry> getBlocklist(); |
449 | 449 |
|
450 | 450 | /** |
451 | | - * Clears any existing blacklist. |
| 451 | + * Clears any existing blocklist. |
452 | 452 | */ |
453 | | - void clearBlacklist(); |
| 453 | + void clearBlocklist(); |
454 | 454 |
|
455 | 455 | /** |
456 | | - * Whitelists URLs matching the specified regular expression patterns. Replaces any existing whitelist. |
| 456 | + * Allowlists URLs matching the specified regular expression patterns. Replaces any existing allowlist. |
457 | 457 | * The urlPattern matches the full URL of the request, including scheme, host, and port, path, and query parameters |
458 | | - * for both HTTP and HTTPS requests. For example, to whitelist both HTTP and HTTPS requests to www.google.com, use a urlPattern |
| 458 | + * for both HTTP and HTTPS requests. For example, to allowlist both HTTP and HTTPS requests to www.google.com, use a urlPattern |
459 | 459 | * of "https?://www\\.google\\.com/.*". |
460 | | - * <b>Note:</b> All HTTP CONNECT requests are automatically whitelisted and cannot be short-circuited using the |
461 | | - * whitelist response code. |
| 460 | + * <b>Note:</b> All HTTP CONNECT requests are automatically allowlisted and cannot be short-circuited using the |
| 461 | + * allowlist response code. |
462 | 462 | * |
463 | | - * @param urlPatterns URL-matching regular expressions to whitelist; null or an empty collection will enable an empty whitelist |
| 463 | + * @param urlPatterns URL-matching regular expressions to allowlist; null or an empty collection will enable an empty allowlist |
464 | 464 | * @param statusCode HTTP status code to return to clients when a URL matches a pattern |
465 | 465 | */ |
466 | | - void whitelistRequests(Collection<String> urlPatterns, int statusCode); |
| 466 | + void allowlistRequests(Collection<String> urlPatterns, int statusCode); |
467 | 467 |
|
468 | 468 | /** |
469 | | - * Adds a URL-matching regular expression to an existing whitelist. |
| 469 | + * Adds a URL-matching regular expression to an existing allowlist. |
470 | 470 | * |
471 | | - * @param urlPattern URL-matching regular expressions to whitelist |
472 | | - * @throws java.lang.IllegalStateException if the whitelist is not enabled |
| 471 | + * @param urlPattern URL-matching regular expressions to allowlist |
| 472 | + * @throws java.lang.IllegalStateException if the allowlist is not enabled |
473 | 473 | */ |
474 | | - void addWhitelistPattern(String urlPattern); |
| 474 | + void addAllowlistPattern(String urlPattern); |
475 | 475 |
|
476 | 476 | /** |
477 | | - * Enables the whitelist, but with no matching URLs. All requests will generated the specified HTTP statusCode. |
| 477 | + * Enables the allowlist, but with no matching URLs. All requests will generated the specified HTTP statusCode. |
478 | 478 | * |
479 | 479 | * @param statusCode HTTP status code to return to clients on all requests |
480 | 480 | */ |
481 | | - void enableEmptyWhitelist(int statusCode); |
| 481 | + void enableEmptyAllowlist(int statusCode); |
482 | 482 |
|
483 | 483 | /** |
484 | | - * Clears any existing whitelist and disables whitelisting. |
| 484 | + * Clears any existing allowlist and disables allowlisting. |
485 | 485 | */ |
486 | | - void disableWhitelist(); |
| 486 | + void disableAllowlist(); |
487 | 487 |
|
488 | 488 | /** |
489 | | - * Returns the URL-matching regular expressions currently in effect. If the whitelist is disabled, this method always returns an empty collection. |
490 | | - * If the whitelist is enabled but empty, this method return an empty collection. |
| 489 | + * Returns the URL-matching regular expressions currently in effect. If the allowlist is disabled, this method always returns an empty collection. |
| 490 | + * If the allowlist is enabled but empty, this method return an empty collection. |
491 | 491 | * |
492 | | - * @return whitelist currently in effect, or an empty collection if the whitelist is disabled or empty |
| 492 | + * @return allowlist currently in effect, or an empty collection if the allowlist is disabled or empty |
493 | 493 | */ |
494 | | - Collection<String> getWhitelistUrls(); |
| 494 | + Collection<String> getAllowlistUrls(); |
495 | 495 |
|
496 | 496 | /** |
497 | | - * Returns the status code returned for all URLs that do not match the whitelist. If the whitelist is not currently enabled, returns -1. |
| 497 | + * Returns the status code returned for all URLs that do not match the allowlist. If the allowlist is not currently enabled, returns -1. |
498 | 498 | * |
499 | | - * @return HTTP status code returned for non-whitelisted URLs, or -1 if the whitelist is disabled. |
| 499 | + * @return HTTP status code returned for non-allowlisted URLs, or -1 if the allowlist is disabled. |
500 | 500 | */ |
501 | | - int getWhitelistStatusCode(); |
| 501 | + int getAllowlistStatusCode(); |
502 | 502 |
|
503 | 503 | /** |
504 | | - * Returns true if the whitelist is enabled, otherwise false. |
505 | | - * @return is WhitelistEnabled |
| 504 | + * Returns true if the allowlist is enabled, otherwise false. |
| 505 | + * @return is AllowlistEnabled |
506 | 506 | */ |
507 | | - boolean isWhitelistEnabled(); |
| 507 | + boolean isAllowlistEnabled(); |
508 | 508 |
|
509 | 509 | /** |
510 | 510 | * Adds the specified HTTP headers to every request. Replaces any existing additional headers with the specified headers. |
|
0 commit comments