Look up identity, access checks, browser defenses, secrets and safe input boundaries.
Scope and conventions
Web/API security patterns, not a complete authentication implementation or security certification. Sequences are labeled sketches. Use maintained framework/provider libraries for identity and cryptography; adapt policies to your trust boundaries. Primary sources accompany each entry.
Keep secrets out of source, client bundles and diagnostic output. Retrieve them through your platform’s secret facility with narrowly scoped access; define rotation and rapid revocation. Environment variables are a delivery mechanism, not automatically a secret vault.
Protocol / decision sketch
Sequence or decision sketch; not executable code.
Web & API security · Own secret access, rotation and revocation
Log relevant authentication, authorization and administrative outcomes with useful event IDs and time. Exclude passwords, session IDs and access tokens; constrain log access and encode untrusted fields as data.
Fragment
Illustrative structured event. Identifiers and retention need an application privacy/access policy.
Web & API security · Record security events without recording credentials
Bound request bodies, expensive parsing, concurrent operations and execution duration. Apply controls at the relevant account/resource/network scopes; one IP-based limiter is not a complete abuse policy.
Protocol / decision sketch
Sequence or decision sketch; not executable code.
Web & API security · Limit work as well as request count
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
limit: body bytes + records + queued work + active workbudget: downstream duration + retries + total operation time
Include unauthenticated requests, wrong principals/tenants, revoked sessions, malformed inputs and unexpected methods. Verify absence of forbidden side effects as well as the returned status; a green test suite is evidence for the cases exercised.
Protocol / decision sketch
Sequence or decision sketch; not executable code.
Web & API security · Test denial and boundary cases explicitly
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
owner allowed → intended change occursother tenant denied → no change and no protected dataexpired authority → no protected operation