7cb2756b67
Add user-based rate limiting middleware (100 req/min) for authenticated endpoints using httprate library. Implement common password validation blocking 50+ weak passwords. Improve test coverage from 38.3% to 44.6% with comprehensive refresh token tests. Security improvements: - Rate limiting by user ID for /habits and /stats endpoints - X-RateLimit-Limit header in responses - Common password blacklist in password validation - Refresh token test suite with 5 scenarios (valid, invalid, expired, revoked, empty)
12 lines
326 B
Go
12 lines
326 B
Go
package errors
|
|
|
|
import "errors"
|
|
|
|
var (
|
|
ErrNotFound = errors.New("resource not found")
|
|
ErrAlreadyExists = errors.New("resource already exists")
|
|
ErrInvalidInput = errors.New("invalid input")
|
|
ErrUnauthorized = errors.New("unauthorized")
|
|
ErrInvalidCredentials = errors.New("invalid credentials")
|
|
)
|