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.
Enforce authorization on the server for every protected request, including downloads and alternate routes. Missing policy, malformed context or a failed policy lookup must not silently grant access.
Protocol / decision sketch
Sequence or decision sketch; not executable code.
Web & API security · Deny access unless a policy permits it
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
no explicit permit → denypolicy evaluation fails → fail closedUI hides a button → server still checks the action
Use the authenticated principal and server-established tenant scope in the resource lookup and permission decision. A UUID or unguessable ID does not replace object-level authorization.
Protocol / decision sketch
Sequence or decision sketch; not executable code.
Web & API security · Check the particular object and tenant
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
principal A requests /documents/Bcheck: tenant membership + resource ownership/relationship + actionreturn only data permitted by that decision
A role can grant a category of action, while resource attributes and relationships constrain which objects are accessible. Evaluate the policy using trusted server data, not client-supplied roles.
Protocol / decision sketch
Sequence or decision sketch; not executable code.
Web & API security · Keep role membership separate from the full decision
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
editor role + same tenant + document editable → may editeditor role + different tenant → deny