Versions in this module Expand all Collapse all v0 v0.1.1 May 11, 2026 Changes in this version + func Idempotency(s *store.Store) gin.HandlerFunc + func SessionOrAPIKey(secret string, db *store.Store, adminCheck AdminChecker) gin.HandlerFunc v0.1.0 Mar 26, 2026 Changes in this version + var ActiveLicenses = promauto.NewGauge(prometheus.GaugeOpts{ ... }) + var BruteForceBlocks = promauto.NewCounter(prometheus.CounterOpts{ ... }) + var EmailDeliveries = promauto.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var LicenseActivations = promauto.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var LicenseVerifications = promauto.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var WebhookDeliveries = promauto.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + func APIKeyAuth(s *store.Store) gin.HandlerFunc + func AdminOnly() gin.HandlerFunc + func IssueJWT(secret, userID, email, name string, isAdmin bool, ttl time.Duration) (string, error) + func LicenseBruteForceGuard(bf *BruteForceProtection) gin.HandlerFunc + func PrometheusMetrics() gin.HandlerFunc + func RateLimit(rate int, window time.Duration) gin.HandlerFunc + func RateLimitByIP(rate int, window time.Duration) gin.HandlerFunc + func RequestID() gin.HandlerFunc + func RequireScope(scope string) gin.HandlerFunc + func SessionAuth(secret string, adminCheck ...AdminChecker) gin.HandlerFunc + func SetRateLimitBackend(b RateLimitBackend) + type AdminChecker func(ctx context.Context, userID string) bool + type BruteForceProtection struct + func NewBruteForceProtection(maxFails int, lockout, maxLockout, window time.Duration) *BruteForceProtection + func (bf *BruteForceProtection) IsBlocked(key string) (bool, time.Duration) + func (bf *BruteForceProtection) RecordFailure(key string) + func (bf *BruteForceProtection) RecordSuccess(key string) + type Claims struct + Email string + IsAdmin bool + Name string + UserID string + type RateLimitBackend interface + Allow func(key string, rate int, window time.Duration) bool + func NewMemoryBackend() RateLimitBackend + func NewRedisBackend(client RedisClient) RateLimitBackend + type RedisClient interface + Eval func(ctx context.Context, script string, keys []string, args ...interface{}) RedisResult + type RedisResult interface + Int64 func() (int64, error)