Skillquality 0.45
litestar-auth-guards
Auto-activate for guards=, Guard, ASGIConnection, BaseRouteHandler, connection.user, PermissionDeniedException, JWT auth, OAuth2, role checks, tenant checks, or WebSocket auth. Use when implementing Litestar authentication, authorization, Guards, or permission boundaries. Not for
Price
free
Protocol
skill
Verified
no
What it does
Litestar Auth and Guards
Use this skill for authentication boundaries, authorization checks, guard composition, and user context.
Code Style Rules
- Put auth and permission checks in Guards or middleware, not handler bodies.
- Prefer Controller-level guards when a whole domain shares a policy.
- Raise Litestar HTTP exceptions or domain exceptions consistently.
- Keep tenant isolation explicit in guard logic and service filters.
Quick Reference
- Guard patterns: guards.md
- Middleware user loading: litestar-middleware
- Realtime auth: litestar-realtime
Workflow
- Determine where identity is loaded.
- Add Guards at app, Controller, or route scope.
- Keep permission checks reusable and testable.
- Verify denial paths and authenticated success paths.
Guardrails
- Do not inline auth checks in handlers.
- Do not make Guards perform database work repeatedly when middleware can load the user once.
- Do not trust client-supplied tenant IDs without server-side scoping.
- Do not use HTTP-only assumptions for WebSocket auth.
Validation Checkpoint
- Guard scope matches the policy scope.
- Denial paths return the expected status.
- Handlers contain no duplicated auth branching.
- WebSocket routes use an explicit browser-compatible auth path.
Example
from litestar.connection import ASGIConnection
from litestar.exceptions import PermissionDeniedException
from litestar.handlers import BaseRouteHandler
async def requires_active_user(connection: ASGIConnection, _: BaseRouteHandler) -> None:
if not connection.user or not connection.user.is_active:
raise PermissionDeniedException("Authentication required")
</example>
References Index
Official References
- https://docs.litestar.dev/ - Litestar documentation
- https://docs.litestar.dev/latest/reference/ - Litestar API reference
Shared Styleguide Baseline
Capabilities
skillsource-litestar-orgskill-litestar-auth-guardstopic-advanced-alchemytopic-agent-skillstopic-agentskillstopic-ai-agentstopic-claude-code-plugintopic-claude-code-skillstopic-gemini-cli-extensiontopic-htmxtopic-inertiatopic-litestartopic-mcptopic-python
Install
Installnpx skills add litestar-org/litestar-skills
Transportskills-sh
Protocolskill
Quality
0.45/ 1.00
deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 7 github stars · SKILL.md body (2,308 chars)
Provenance
Indexed fromgithub
Enriched2026-05-18 19:13:53Z · deterministic:skill-github:v1 · v1
First seen2026-05-18
Last seen2026-05-18