- Added rate limiting for outbound email sends to prevent abuse, implemented in `internal/api/mail/sendguard`. - Introduced idempotency key support for email sending to avoid duplicate submissions. - Enhanced attachment handling with new limits and validation in `internal/api/mail/limits`. - Updated outbox processing to include retry logic and circuit breaker for SMTP failures. - Improved HTML sanitization for email content to enhance security. - Added unit tests for new features, ensuring robust functionality and error handling. - Updated configuration options in `.env.example` for new mail settings.
19 lines
652 B
Go
19 lines
652 B
Go
package apiresponse
|
|
|
|
// Standard API error codes.
|
|
const (
|
|
CodeAuthUnavailable = "auth.unavailable"
|
|
CodeAuthMissingAuthorization = "auth.missing_authorization"
|
|
CodeAuthInvalidAuthorization = "auth.invalid_authorization"
|
|
CodeAuthInvalidToken = "auth.invalid_token"
|
|
CodeAuthUnauthorized = "auth.unauthorized"
|
|
CodeAuthForbidden = "auth.forbidden"
|
|
|
|
CodeInvalidQueryParam = "invalid_query_param"
|
|
CodeInvalidRequest = "invalid_request_body"
|
|
CodeNotFound = "not_found"
|
|
CodeInternal = "internal_error"
|
|
CodePayloadTooLarge = "request_body_too_large"
|
|
CodeRateLimited = "rate_limited"
|
|
)
|