litestar-security
Installation
SKILL.md
Security
Use this skill when a Litestar service needs defense-in-depth security implementation, not only authentication wiring.
For full implementation patterns, open references/security-patterns.md.
Execution Workflow
- Define public, authenticated, and privileged route classes first.
- Choose the authentication mechanism and attach it once at app scope.
- Keep request parsing concerns separate from identity establishment.
- Consume authenticated context from
request.user/request.authonly after auth runs. - Apply guards for authorization and ownership checks.
- Normalize
401and403behavior intentionally and document exclusions. - Store and compare secrets safely.