/zeff-claude-setup:api:api-protectfrom zeff-claude-setup
Add authentication, authorization, and security to API endpoints
Ships in zeff-claude-setup. Installing the plugin adds it to Claude Code.
Add comprehensive security, authentication, and authorization to the specified API route.
$ARGUMENTS
###1. Authentication (Who are you?)
// Use Supabase Auth + RLS
- getUser() from server-side client
- RLS policies for data access
- Service role key for admin operations
// Use NextAuth sessions
- getServerSession() in route handlers
- Protect with middleware
- Role checking logic
// JWT validation
- Verify tokens
- Decode and validate claims
- Check expiration
Authentication
Authorization
Input Validation
Rate Limiting
CORS
Error Handling
Logging & Monitoring
Pattern 1: Simple Token Auth
// For internal tools, admin panels
const token = request.headers.get('authorization')
if (token !== process.env.ADMIN_TOKEN) {
return new Response('Unauthorized', { status: 401 })
}
Pattern 2: User-based Auth
// For user-facing apps
const user = await getCurrentUser(request)
if (!user) {
return new Response('Unauthorized', { status: 401 })
}
Pattern 3: Role-based Auth
// For apps with different user types
const user = await getCurrentUser(request)
if (!user || !hasRole(user, 'admin')) {
return new Response('Forbidden', { status: 403 })
}
Generate production-ready, secure code that follows the principle of least privilege.
What the command file sets; muted values are Claude Code's defaults
claude-sonnet-4-57-day visitors to each command page
3 plugins ship this exact command · first indexed Jun 20, 2026
npx claudepluginhub zeff01/zeff-claude-setup --plugin zeff-claude-setup11 commands in this plugin
/api:api-newCreate New API Endpoint (RepairCoin)Create a new API endpoint for RepairCoin. This command supports both:/api:api-testTargetTest API endpoints with automated test generation/misc:code-cleanupCode to CleanRefactor and clean up code following best practices/misc:code-explainCode Explanation and AnalysisYou are a code education expert specializing in explaining complex code through clear narratives, visual diagrams, and step-by-step breakdowns. Transform difficult concepts into understandable explanations for developers at all levels./misc:code-optimizeCode to OptimizeAnalyze and optimize code for performance, memory, and efficiency/misc:docs-generateCode to DocumentGenerate documentation for code, APIs, and components