Skip to content

docs: explain route options and behavior rules - #15

Merged
rennf93 merged 1 commit into
masterfrom
docs/route-reference
Oct 31, 2026
Merged

rennf93 merged 1 commit into
masterfrom
docs/route-reference

Conversation

@rennf93

@rennf93 rennf93 commented Oct 31, 2026

Copy link
Copy Markdown
Member

Closes #14

Adds a "Route policies" page (docs/routes.md) and links it from the nav, the docs home and the usage page.

What the page covers

  • How a request finds its route: optional method plus path, exact or prefix match, longest path wins, one route per request (a specific route replaces a prefix route's options).
  • The default routes, and what replacing one or setting it to null does.
  • Behavior rules: rule_type, threshold, window, pattern, action, ban_duration, with units and defaults; the status:, json:, regex: and plain-text patterns; what ban, log, alert and throttle do (in guard-core-php 4.4.0 throttle only logs); counting per IP and per method plus exact path; passive mode and Redis.
  • Every route option, grouped, with an example, unit, the status code it returns and its traps (options that need ipinfo or Redis, lowercase exclusion entries, authRequired/apiKeyRequired failing without a verifier).

Also fixes the README and usage wording: the default 401 ban rule counts per path, not across the /api/v1/ prefix.

Verification

  • Every claim read at guard-core-php v4.4.0 and psr15-guard v1.6.1 (the versions in the module composer.lock). The json: array pattern and the route rule with a body pattern while behaviorScanResponseBody is off were also run against a composer install of guard-core-php 4.4.0: json:tags[]==admin matches, json:items[].status==error does not, and the route rule is accepted but never evaluated ([false,false]).
  • mkdocs build --strict: exit 0, anchors configuration.md#redis and #trusted-proxies-and-ipaddressserverparam present.
  • pre-commit run on the changed files: all hooks pass (markdownlint included).

Docs only, no code or config change.

Closes #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E28c6iftj4hRmx55Uaaoxc
Entire-Checkpoint: 01M68YZFA9NTM5E6HTV6VVAH70
@github-actions github-actions Bot added the documentation Docs, README, governance files label Oct 31, 2026
@rennf93
rennf93 merged commit 64823c9 into master Oct 31, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Docs, README, governance files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route options and behavior rules are not explained in the docs

1 participant