litestar-auth-guards

Official

Implement secure Litestar auth guards with ease.

Authorlitestar-org
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Manually writing authentication and authorization logic directly in Litestar route handlers creates duplicated code, inconsistent security policies, and increased vulnerability risk, especially for complex use cases like WebSocket authentication and multi-tenant access control.

Core Features & Use Cases

  • Pre-built Guard Patterns: Ready-to-use guard implementations for common auth scenarios including JWT bearer token validation, session authentication, multi-tenant membership checks, and WebSocket-compatible auth flows.
  • Scope-aware Guard Composition: Guidance on applying guards at the correct level (application, controller, or route) to avoid redundant logic and ensure consistent policy enforcement across your Litestar service.
  • Validation & Safety Guardrails: Built-in validation checkpoints and explicit guardrails to prevent common auth mistakes like inline handler checks, repeated database queries for user data, and trust in untrusted client-supplied tenant IDs.
  • Real-world Use Case: For a multi-tenant Litestar application with both HTTP REST endpoints and WebSocket real-time features, use this skill to implement a unified, secure auth guard system that works across all endpoint types, eliminating duplicated auth logic and closing security gaps.

Quick Start

Use the litestar-auth-guards skill to add JWT authentication and multi-tenant authorization guards to your Litestar application's routes and controllers.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: litestar-auth-guards
Download link: https://github.com/litestar-org/litestar-skills/archive/main.zip#litestar-auth-guards

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 537,000+ vetted skills library on demand.