Skip to content

Commit 606384b

Browse files
committed
bump version and add changelog
1 parent 784169c commit 606384b

3 files changed

Lines changed: 147 additions & 3 deletions

File tree

docs/release-notes/changelog.rst

Lines changed: 145 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,150 @@
33
Litestar 2 Changelog
44
====================
55

6+
.. changelog:: 2.18.0
7+
:date: 2025-10-05
8+
9+
.. change:: Fix header spoofing vulnerability in ``RateLimitMiddleware`` that allowed bypassing client-specific rate limits
10+
:type: bugfix
11+
12+
Fix a vulnerability in
13+
:class:`~litestar.middleware.rate_limit.RateLimitMiddleware` that allowed
14+
clients to bypass the limit by spoofing the ``X-FORWARDED-FOR`` header.
15+
16+
**Who is affected?**
17+
18+
All usages of the ``RateLimitMiddleware`` that did not customize
19+
:meth:`~litestar.middleware.rate_limit.RateLimitMiddleware.cache_key_from_request``.
20+
21+
**What needs to be done?**
22+
23+
The middleware has been fixed to remove this particular vulnerability, by
24+
ignoring the ``X-FORWARDED-FOR`` header when determining a client's identity.
25+
If you are using ``litestar>=2.18.0``, nothing needs to be done.
26+
27+
.. info::
28+
29+
Applications operating behind a proxy should consult
30+
:ref:`usage/middleware/builtin-middleware:Using behing a proxy` on how to
31+
obtain reliable client identification in such cases.
32+
33+
.. change:: CLI: Fix command registration
34+
:type: bugfix
35+
:pr: 4298
36+
37+
Fix an issue where CLI plugins no longer appear in the command help text
38+
after recent updates to ``rich-click`` and ``click``.
39+
40+
Ensure plugins load before rendering the help text so they appear in the
41+
formatted help output.
42+
43+
.. change:: Remove fix polyfactory deprecation warning
44+
:type: bugfix
45+
:pr: 4292
46+
47+
Fix a deprecation warning from polyfactory caused by a changed default value.
48+
49+
.. change:: Ensure ``MethodNotAllowedException`` properly sets ``Allow`` header during routing
50+
:type: bugfix
51+
:pr: 4289
52+
:issue: 4277
53+
54+
Ensure :exc:`MethodNotAllowedException` exceptions raised during routing
55+
always includes an ``Allow`` header.
56+
57+
.. change:: Preserve empty strings in ``multipart/form-data`` requests
58+
:type: bugfix
59+
:pr: 4271
60+
:issue: 4204
61+
62+
Preserve empty strings in multipart forms instead of converting them to
63+
:obj:`None`.
64+
65+
.. change:: OpenAPI: Regression - Fix missing constraints for ``msgspec.Struct``
66+
:type: bugfix
67+
:pr: 4282
68+
:issue: 3999
69+
70+
Ensure constraints on set on an ``msgspec.Struct`` are always reflected in
71+
the OpenAPI schema, for simple (non-union, non-optional, non-nested) fields.
72+
73+
.. change:: Fix ``KeyError`` when using ``data`` keyword argument in dependency function
74+
:type: bugfix
75+
:pr: 4270
76+
:issue: 4230
77+
78+
Fix a ``KeyError`` that occured when a dependency function used the ``data``
79+
keyword argument, if no ``data`` keyword argument was used in the handler
80+
requesting this dependency.
81+
82+
.. change:: OpenAPI - Regression: Allow ``Parameter`` to set an Enum's schema fields
83+
:type: bugfix
84+
:pr: 4251
85+
:issue: 4250
86+
87+
Fix a bug introduced in ``2.14.0`` that would prevent an Enum field's OpenAPI
88+
schema to be modified via :func:`~litestar.params.Parameter`.
89+
90+
.. change:: CLI: Fix ``TypeError`` when passing ``--help`` and `--app-dir`` simultaneously
91+
:type: bugfix
92+
:pr: 4341
93+
:issue: 4331
94+
95+
Fix a bug that would raise a :exc:`TypeError` when the CLI's ``--help`` option
96+
was invoked, if the ``--app-dir`` option was also set.
97+
98+
99+
.. change:: CLI: Fix ``--app-dir`` being ignore on subsequent reloads when used together with ``--reload`` option
100+
:type: bugfix
101+
:pr: 4352
102+
:issue: 4329
103+
104+
Fix a bug that would cause the ``--app-dir`` option to be ignored after the first
105+
reload, because it was not passed properly to uvicorn.
106+
107+
.. change:: OpenAPI: Use ``NotRequired`` instead of ``Optional`` for values with a ``default_factory``
108+
:type: bugfix
109+
:pr: 4347
110+
:issue: 4294
111+
112+
Fix a bug that would consider fields with a ``default_factory`` set to be
113+
``Optional`` instead of ``NotRequired``.
114+
115+
.. change:: Fix ``Stream`` response being treated as ``File`` response in OpenAPI schema
116+
:type: bugfix
117+
:pr: 4371
118+
119+
Prevent handlers returning a ``Stream`` from falsely indicating a file
120+
response in the OpenAPI schema with file-specific headers such as
121+
``content-length``, ``last-modified``, and ``etag``.
122+
123+
.. change:: Deprecate ``litestar.plugins.sqlalchemy`` module
124+
:type: feature
125+
:pr: 4343
126+
127+
Deprecate the ``litestar.plugins.sqlalchemy`` module, which is scheduled for
128+
removal in v3.0.
129+
130+
This deprecation follows the migration to advanced-alchemy. Users should update their imports:
131+
132+
.. code-block:: python
133+
134+
# Old (deprecated)
135+
from litestar.plugins.sqlalchemy import SQLAlchemyPlugin
136+
137+
# New
138+
from advanced_alchemy.extensions.litestar import SQLAlchemyPlugin
139+
140+
.. change:: Add ``round_trip`` parameter to ``PydanticPlugin``
141+
:type: feature
142+
:pr: 4350
143+
:issue: 4349
144+
145+
Add new ``round_trip`` parameter to
146+
:class:`~litestar.contrib.pydantic.PydanticPlugin`, allowing correct
147+
serialization of types like ``pydanctic.Json``.
148+
149+
6150
.. changelog:: 2.17.0
7151
:date: 2025-08-09
8152

@@ -6226,4 +6370,4 @@ Litestar 2 Changelog
62266370
:issue: 1149
62276371

62286372
A middleware's ``exclude`` parameter would sometimes not be honoured if the path was used to serve static files
6229-
using ``StaticFilesConfig``
6373+
using ``StaticFilesConfig``

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ maintainers = [
6464
name = "litestar"
6565
readme = "docs/PYPI_README.md"
6666
requires-python = ">=3.8,<4.0"
67-
version = "2.17.0"
67+
version = "2.18.0"
6868

6969
[project.urls]
7070
Blog = "https://blog.litestar.dev"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)