Reference

Security & identity

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.

Secrets & operations

Own secret access, rotation and revocation

Web & API security

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
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
application identity → minimum required secret access
compromise response  → revoke/rotate + investigate exposure

Record security events without recording credentials

Web & API security

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
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
{"event":"access_denied","request_id":"req-42","resource_type":"document","outcome":"deny"}

Limit work as well as request count

Web & API security

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 work
budget: downstream duration + retries + total operation time

Test denial and boundary cases explicitly

Web & API security

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 occurs
other tenant denied → no change and no protected data
expired authority   → no protected operation