golang-gin-auth
Installation
SKILL.md
golang-gin-auth — Authentication & Authorization
Add JWT-based authentication and role-based access control to a Gin API. This skill covers the patterns you need for secure APIs: JWT middleware, login handler, token lifecycle, and RBAC.
When to Use
- Adding JWT authentication to a Gin API
- Implementing login or registration endpoints
- Protecting routes with middleware
- Implementing role-based or permission-based access control (RBAC)
- Handling token refresh and revocation
- Getting the current user in any handler
Quick Reference
Dependencies: github.com/golang-jwt/jwt/v5, golang.org/x/crypto, github.com/google/uuid, golang.org/x/time/rate