Skip to content

Commit 200951f

Browse files
committed
docs(client/hooks): add trustedlogin/{ns}/in_local_development filter
New advanced-internal filter on the Client SDK side that overrides whether SecurityChecks treats the current site as a local/development environment (bypassing lockdown + brute-force enforcement). Primary use case: the SDK's own PHPUnit suite under wp-env, which hard-codes WP_ENVIRONMENT_TYPE=local and otherwise short-circuits the brute-force counter to always-allow. Documented alongside meets_ssl_requirement since both are testability hooks with similar warnings.
1 parent caa4bca commit 200951f

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

docs/Client/hooks.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,25 @@ helpful to have a filter to override this behavior.
360360
|-----------|--------|--------------------------------------|------------------------------------------|
361361
| `$return` | `bool` | `is_ssl() && $config['require_ssl']` | Does this site meet the SSL requirement? |
362362

363+
### `trustedlogin/{namespace}/in_local_development` {#trustedloginnamespacein_local_development}
364+
365+
Overrides whether the SDK considers the current site to be a local-development environment. When `true`, lockdown
366+
and brute-force enforcement are bypassed. The default is computed from the `TRUSTEDLOGIN_TESTING_{NAMESPACE}` constant
367+
and `wp_get_environment_type()` (treated as local when it returns `'local'` or `'development'`).
368+
369+
Primary use case: the SDK's own PHPUnit suite, where the WordPress test harness pins `WP_ENVIRONMENT_TYPE=local` and
370+
the brute-force tests need the real check to fire.
371+
372+
| Key | Type | Default | Description |
373+
|-------------|-----------------------|-----------------------------------------|------------------------------------------------------------------------------|
374+
| `$is_local` | `bool` | Computed from env type + testing const | `true` if the SDK considers this a local/dev environment, `false` otherwise. |
375+
| `$config` | `TrustedLogin\Config` | Current TrustedLogin configuration | For namespace-aware extension. |
376+
377+
:::warning
378+
These filters should not be used in production code. They are included here as helpful developer reference only, and
379+
they may change.
380+
:::
381+
363382
### `trustedlogin/{namespace}/api_url` {#trustedloginnamespaceapi_url}
364383

365384
Modifies the endpoint URL for the TrustedLogin service. This allows pointing requests to test servers.

0 commit comments

Comments
 (0)