Repository navigation
Releases
Releases · AlijonovUz/routly
What’s New in v0.4.0
New Features
- Pluggable & Redis Store Backends (
routly.stores): AddedBaseRateLimitStore,BaseSessionStore,StoreResolver,RedisRateLimitStore(ZSET sliding window), andRedisSessionStore(server-side TTL sessions with HMAC-signed session ID cookies) configured viaRATE_LIMIT_STORE,SESSION_STORE, andREDIS_URL(optionalpip install "routly[redis]"). - Interactive CLI Shell — Added routly shell [target] to open an interactive Python REPL with
app,settings,Request, andTestClientpreloaded and startup/shutdown hooks invoked cleanly.
Improvements
- Added strict validation and normalization for
ERROR_FORMAT("auto", "json", "html") inroutly.conf.settingsso invalid settings fail fast withValueError, and added explicit "html" mode support inrender_exception. - Added optional store= support to
@rate_limit(...)alongside globalRATE_LIMIT_STOREsharing.
What’s New in v0.3.1
Bug Fixes & Improvements
- REST API Error Negotiation: Added
API_PREFIXES (default ["/api/"])andERROR_FORMAT ("auto" / "json")so API endpoints return flat JSON errors even without Accept: application/json when DEBUG = False, and sanitized direct raw exception messages in production. - CSRF Exemptions: Added
CSRF_EXEMPT_PATHSand dual-mode@csrf_exempt/dependencies=[csrf_exempt]inroutly.decoratorsfor webhooks and token-authenticated APIs. - Safe JSON Input & Extended Serialization: Added
request.get_json(default=..., silent=...)raisingBadRequest (400)instead of 500 on empty/invalid JSON, fixed 3-tuple (body, status_code, headers) unpacking in build_response, and added JSON serialization for UUID, datetime, date, time, Decimal, Enum, Path, and set. - HTTP Compliance & Middleware Polish: Added implicit HEAD handling for GET routes, Allow headers on 405 responses, bare
@require_api_keysupport,CORS_EXPOSE_HEADERS, and explicitGZipMiddlewareskips for HEAD, 204, and 304 responses. - Security & Stability: Enabled Jinja2 autoescape in TemplateEngine and
render_debug_page, escaped tokens insidecsrf_input(), reset thecurrent_requestContextVarinRoutlyApp.handle_request, hardenedSessionMiddlewarecookie decoding, and handled callables without__name__in routly routes. - Documentation: Fixed the JSON error payload example in REST API Development to match Routly’s flat JSON schema and updated starter template comments.
What’s New in v0.3.0
New Features
- Logging Middleware — Formatted single-line request logs with optional ANSI colors, millisecond timing, client IP detection, and automatic wsgiref duplicate-log suppression during routly runserver.
- Rate Limiting — Thread-safe SlidingWindowLimiter via RateLimitMiddleware and endpoint-level @rate_limit decorator with RATE_LIMIT_SCOPE, RATE_LIMIT_EXEMPT_PATHS, X-RateLimit-* headers, and TooManyRequests (429).
- TestClient — Dedicated in-process WSGI test client supporting persistent cookies, params/json/data/body, follow_redirects, and context-managed startup/shutdown hooks.
- Route Guards & Auth Decorators — Router-level and endpoint-level dependencies=[...] short-circuiting paired with dual-mode routly.decorators guards (is_authenticated, login_required, require_role, require_permissions, require_api_key, require_https).
- Streaming & File Responses — Memory-efficient StreamingResponse and FileResponse with automatic MIME detection, safe Content-Disposition headers, and is_streaming protection in GZipMiddleware.
- Uploaded Media Files — Multipart request.files / UploadedFile helpers (.save(), .read(), .size), dynamic MEDIA_URL / MEDIA_ROOT file serving, {{ media(...) }} Jinja2 helper, and files= support in TestClient.
- Added UnprocessableEntity (422) HTTP exception and header forwarding support on HttpException responses.
Improvements
- Unified FBV access control decorators and router dependency guards under routly.decorators.
- Added get_client_ip helper in routly.utils.http for proxy-aware IP extraction.
What’s New in v0.2.0
New Features
- Command-Line Interface — Project scaffolding, auto-reloading development server, route table inspector, and secret key generator.
- Typed Path Converters — Built-in string, integer, float, slug, UUID, and multi-segment path converters compiled via Python regular expressions.
- Modular Routers — Group routes under shared URL prefixes and mount routers cleanly into the main application or inside other routers.
- Multi-Method Routes — Register multiple HTTP verbs on a single handler using the unified route decorator.
- Custom Error Handlers — Bind custom views to HTTP status codes or Python exception classes.
- Application Lifecycle Hooks — Thread-safe startup and shutdown callbacks integrated across WSGI servers and the CLI.
Improvements
- Removed the external parse dependency in favor of native compiled regex routing with strict slash isolation.
- Improved Settings Reference auto-discovery across CLI commands and environment variables.