Skip to content

Commit 8cac8a3

Browse files
committed
Security fixes and dependency updates
- Updated FastAPI from 0.111.0 to 0.116.1 - Updated uvicorn from 0.29.0 to 0.35.0 - Removed leftover speckit reference from requirements-dev.txt - Updated requirements.txt to match installed versions - Ran Trivy security scan - no vulnerabilities found - All tests passing with updated dependencies - Fixed version mismatches between requirements and installed packages
1 parent 84b8c5e commit 8cac8a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+3237
-2644
lines changed

.venv_ci/lib/python3.12/site-packages/fastapi-0.111.0.dist-info/METADATA renamed to .venv_ci/lib/python3.12/site-packages/fastapi-0.116.1.dist-info/METADATA

Lines changed: 77 additions & 56 deletions
Large diffs are not rendered by default.

.venv_ci/lib/python3.12/site-packages/fastapi-0.111.0.dist-info/RECORD renamed to .venv_ci/lib/python3.12/site-packages/fastapi-0.116.1.dist-info/RECORD

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
fastapi-0.111.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2-
fastapi-0.111.0.dist-info/METADATA,sha256=E4htngMdh1XMorTOXG49Q4_NiD5dkSasEvOzzSu95cE,25954
3-
fastapi-0.111.0.dist-info/RECORD,,
4-
fastapi-0.111.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5-
fastapi-0.111.0.dist-info/WHEEL,sha256=vnE8JVcI2Wz7GRKorsPArnBdnW2SWKWGow5gu5tHlRU,90
6-
fastapi-0.111.0.dist-info/licenses/LICENSE,sha256=Tsif_IFIW5f-xYSy1KlhAy7v_oNEU4lP2cEnSQbMdE4,1086
7-
fastapi/__init__.py,sha256=YhhDsditFgjCfvQR8M0CXSRhp4dlFLbGd9q1Hbtkcq8,1081
1+
../../../bin/fastapi,sha256=YU5sQPCAnLgb5QGWEOnaPWWQCsslee-nc8vN7yoiqpI,293
2+
fastapi-0.116.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
3+
fastapi-0.116.1.dist-info/METADATA,sha256=pnu4s6rAsNuB66sYhB59UFxRuZv2ua6fbH_jUM6HM2k,28115
4+
fastapi-0.116.1.dist-info/RECORD,,
5+
fastapi-0.116.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6+
fastapi-0.116.1.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
7+
fastapi-0.116.1.dist-info/entry_points.txt,sha256=GCf-WbIZxyGT4MUmrPGj1cOHYZoGsNPHAvNkT6hnGeA,61
8+
fastapi-0.116.1.dist-info/licenses/LICENSE,sha256=Tsif_IFIW5f-xYSy1KlhAy7v_oNEU4lP2cEnSQbMdE4,1086
9+
fastapi/__init__.py,sha256=-U8vW9K3Hy78v_3O0ECrEfMmPtSuHaA1yAql96bd8ts,1081
10+
fastapi/__main__.py,sha256=bKePXLdO4SsVSM6r9SVoLickJDcR2c0cTOxZRKq26YQ,37
811
fastapi/__pycache__/__init__.cpython-312.pyc,,
12+
fastapi/__pycache__/__main__.cpython-312.pyc,,
913
fastapi/__pycache__/_compat.cpython-312.pyc,,
1014
fastapi/__pycache__/applications.cpython-312.pyc,,
1115
fastapi/__pycache__/background.cpython-312.pyc,,
16+
fastapi/__pycache__/cli.cpython-312.pyc,,
1217
fastapi/__pycache__/concurrency.cpython-312.pyc,,
1318
fastapi/__pycache__/datastructures.cpython-312.pyc,,
1419
fastapi/__pycache__/encoders.cpython-312.pyc,,
@@ -26,17 +31,18 @@ fastapi/__pycache__/testclient.cpython-312.pyc,,
2631
fastapi/__pycache__/types.cpython-312.pyc,,
2732
fastapi/__pycache__/utils.cpython-312.pyc,,
2833
fastapi/__pycache__/websockets.cpython-312.pyc,,
29-
fastapi/_compat.py,sha256=OjE3FUZ0IPXqIJWKhoWKDNCHv4so-FQ-rfN8ngQZeFE,23134
30-
fastapi/applications.py,sha256=owRSmdslsJhJCDxxatkfMdewlaiE-9DPbwQ7alyexgU,176342
34+
fastapi/_compat.py,sha256=PwGTZd6d-u2o6YF9M8pQahuBtD_3q3Kpj7vU5-ngChc,24228
35+
fastapi/applications.py,sha256=rZTr0Ix-vdMwh6MQGCI_NC-Ir9lpfIGHHBY-JnNWZ_E,176550
3136
fastapi/background.py,sha256=rouLirxUANrcYC824MSMypXL_Qb2HYg2YZqaiEqbEKI,1768
32-
fastapi/concurrency.py,sha256=AYLnS4judDUmXsNRICtoKSP0prfYDcS8ehBtYW9JhQQ,1403
37+
fastapi/cli.py,sha256=OYhZb0NR_deuT5ofyPF2NoNBzZDNOP8Salef2nk-HqA,418
38+
fastapi/concurrency.py,sha256=MirfowoSpkMQZ8j_g0ZxaQKpV6eB3G-dB5TgcXCrgEA,1424
3339
fastapi/datastructures.py,sha256=b2PEz77XGq-u3Ur1Inwk0AGjOsQZO49yF9C7IPJ15cY,5766
3440
fastapi/dependencies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3541
fastapi/dependencies/__pycache__/__init__.cpython-312.pyc,,
3642
fastapi/dependencies/__pycache__/models.cpython-312.pyc,,
3743
fastapi/dependencies/__pycache__/utils.cpython-312.pyc,,
38-
fastapi/dependencies/models.py,sha256=-n-YCxzgVBkurQi49qOTooT71v_oeAhHJ-qQFonxh5o,2494
39-
fastapi/dependencies/utils.py,sha256=rynOrwW6BKSv0bTVDCY1ag4kRsOzJwmmzO31sRKsTzA,30241
44+
fastapi/dependencies/models.py,sha256=Pjl6vx-4nZ5Tta9kJa3-RfQKkXtCpS09-FhMgs9eWNs,1507
45+
fastapi/dependencies/utils.py,sha256=wGN-BAb0NpG-89nA_OllS0F4wYwGfhHgb8IuT3MTqck,36619
4046
fastapi/encoders.py,sha256=LvwYmFeOz4tVwvgBoC5rvZnbr7hZr73KGrU8O7zSptU,11068
4147
fastapi/exception_handlers.py,sha256=MBrIOA-ugjJDivIi4rSsUJBdTsjuzN76q4yh0q1COKw,1332
4248
fastapi/exceptions.py,sha256=taNixuFEXb67lI1bnX1ubq8y8TseJ4yoPlWjyP0fTzk,4969
@@ -60,15 +66,15 @@ fastapi/openapi/__pycache__/docs.cpython-312.pyc,,
6066
fastapi/openapi/__pycache__/models.cpython-312.pyc,,
6167
fastapi/openapi/__pycache__/utils.cpython-312.pyc,,
6268
fastapi/openapi/constants.py,sha256=adGzmis1L1HJRTE3kJ5fmHS_Noq6tIY6pWv_SFzoFDU,153
63-
fastapi/openapi/docs.py,sha256=INQd4dFFyOwckrtlrkMbWzsyI1a4wvz8c7S_u0vYgOo,10356
69+
fastapi/openapi/docs.py,sha256=zSDv4xY6XHcKsaG4zyk1HqSnrZtfZFBB0J7ZBk5YHPE,10345
6470
fastapi/openapi/models.py,sha256=PqkxQiqcEgjKuhfUIWPZPQcyTcubtUCB3vcObLsB7VE,15397
65-
fastapi/openapi/utils.py,sha256=asSbOKDuagDfpByNQvPy7OM0sqOBdUmqh64BH-n-5f0,22286
66-
fastapi/param_functions.py,sha256=LcVyxFoK-W1gYGaH7H1dGvth1alwwxXouReg4zKSk88,64005
67-
fastapi/params.py,sha256=GB7aNcyBt8xFUVLnLzt8AGJfZAncQJvwd4N8nhjcXHk,28191
71+
fastapi/openapi/utils.py,sha256=e00G_p0IdpiffBUaq31BUyiloXbpld8RryKYnYKisdY,23964
72+
fastapi/param_functions.py,sha256=JHNPLIYvoAwdnZZavIVsxOat8x23fX_Kl33reh7HKl8,64019
73+
fastapi/params.py,sha256=g450axUBQgQJODdtM7WBxZbQj9Z64inFvadrgHikBbU,28237
6874
fastapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6975
fastapi/requests.py,sha256=zayepKFcienBllv3snmWI20Gk0oHNVLU4DDhqXBb4LU,142
7076
fastapi/responses.py,sha256=QNQQlwpKhQoIPZTTWkpc9d_QGeGZ_aVQPaDV3nQ8m7c,1761
71-
fastapi/routing.py,sha256=dcQBjxUsO9KT0pmp1ewJzM8qD3wjcZi1BrnyyqYELoE,174150
77+
fastapi/routing.py,sha256=-SaOgqaseKw5mlTCk-FliS6Wx5la_CjdV5FqSPDmW9g,176337
7278
fastapi/security/__init__.py,sha256=bO8pNmxqVRXUjfl2mOKiVZLn0FpBQ61VUYVjmppnbJw,881
7379
fastapi/security/__pycache__/__init__.cpython-312.pyc,,
7480
fastapi/security/__pycache__/api_key.cpython-312.pyc,,
@@ -77,15 +83,15 @@ fastapi/security/__pycache__/http.cpython-312.pyc,,
7783
fastapi/security/__pycache__/oauth2.cpython-312.pyc,,
7884
fastapi/security/__pycache__/open_id_connect_url.cpython-312.pyc,,
7985
fastapi/security/__pycache__/utils.cpython-312.pyc,,
80-
fastapi/security/api_key.py,sha256=_OqUUjEHG5_MT1IPAhXIGJRCPldTBdSww_DegFy_W8Y,9368
86+
fastapi/security/api_key.py,sha256=cBI5Z4zWVjL1uJrsjTeLy7MafHPAO2HQPzTrpyoIYWA,9094
8187
fastapi/security/base.py,sha256=dl4pvbC-RxjfbWgPtCWd8MVU-7CB2SZ22rJDXVCXO6c,141
82-
fastapi/security/http.py,sha256=sXw3jvaMPxDmMaGlf5e2ES5TuGXDKXFOigntzUfSqIg,13506
83-
fastapi/security/oauth2.py,sha256=lWemX4CLAvanR6-jiQxFtOyHjHbzEnNbpytA_WXgZcw,21583
88+
fastapi/security/http.py,sha256=rWR2x-5CUsjWmRucYthwRig6MG1o-boyrr4Xo-PuuxU,13606
89+
fastapi/security/oauth2.py,sha256=M1AFIDT7G3oQChq83poI3eg8ZDeibcvnGmya2CTS7JY,22036
8490
fastapi/security/open_id_connect_url.py,sha256=8vizZ2tGqEp1ur8SwtVgyHJhGAJ5AqahgcvSpaIioDI,2722
8591
fastapi/security/utils.py,sha256=bd8T0YM7UQD5ATKucr1bNtAvz_Y3__dVNAv5UebiPvc,293
8692
fastapi/staticfiles.py,sha256=iirGIt3sdY2QZXd36ijs3Cj-T0FuGFda3cd90kM9Ikw,69
8793
fastapi/templating.py,sha256=4zsuTWgcjcEainMJFAlW6-gnslm6AgOS1SiiDWfmQxk,76
8894
fastapi/testclient.py,sha256=nBvaAmX66YldReJNZXPOk1sfuo2Q6hs8bOvIaCep6LQ,66
8995
fastapi/types.py,sha256=nFb36sK3DSoqoyo7Miwy3meKK5UdFBgkAgLSzQlUVyI,383
90-
fastapi/utils.py,sha256=lHKngr-TmOx9QzSyA6PXYSvEgxPYUIk5t3u-kZtskEM,8035
96+
fastapi/utils.py,sha256=y8Bj5ttMaI9tS4D60OUgXqKnktBr99NdYUnHHV9LgoY,7948
9197
fastapi/websockets.py,sha256=419uncYObEKZG0YcrXscfQQYLSWoE10jqxVMetGdR98,222
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Wheel-Version: 1.0
2-
Generator: pdm-backend (2.3.0)
2+
Generator: pdm-backend (2.4.5)
33
Root-Is-Purelib: true
44
Tag: py3-none-any
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[console_scripts]
2+
fastapi = fastapi.cli:main
3+
4+
[gui_scripts]
5+

.venv_ci/lib/python3.12/site-packages/fastapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
22

3-
__version__ = "0.111.0"
3+
__version__ = "0.116.1"
44

55
from starlette import status as status
66

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from fastapi.cli import main
2+
3+
main()

.venv_ci/lib/python3.12/site-packages/fastapi/_compat.py

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from copy import copy
33
from dataclasses import dataclass, is_dataclass
44
from enum import Enum
5+
from functools import lru_cache
56
from typing import (
67
Any,
78
Callable,
@@ -15,18 +16,18 @@
1516
Tuple,
1617
Type,
1718
Union,
19+
cast,
1820
)
1921

2022
from fastapi.exceptions import RequestErrorModel
2123
from fastapi.types import IncEx, ModelNameMap, UnionType
2224
from pydantic import BaseModel, create_model
23-
from pydantic.version import VERSION as P_VERSION
25+
from pydantic.version import VERSION as PYDANTIC_VERSION
2426
from starlette.datastructures import UploadFile
2527
from typing_extensions import Annotated, Literal, get_args, get_origin
2628

27-
# Reassign variable to make it reexported for mypy
28-
PYDANTIC_VERSION = P_VERSION
29-
PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")
29+
PYDANTIC_VERSION_MINOR_TUPLE = tuple(int(x) for x in PYDANTIC_VERSION.split(".")[:2])
30+
PYDANTIC_V2 = PYDANTIC_VERSION_MINOR_TUPLE[0] == 2
3031

3132

3233
sequence_annotation_to_type = {
@@ -45,6 +46,8 @@
4546

4647
sequence_types = tuple(sequence_annotation_to_type.keys())
4748

49+
Url: Type[Any]
50+
4851
if PYDANTIC_V2:
4952
from pydantic import PydanticSchemaGenerationError as PydanticSchemaGenerationError
5053
from pydantic import TypeAdapter
@@ -70,7 +73,7 @@
7073
general_plain_validator_function as with_info_plain_validator_function, # noqa: F401
7174
)
7275

73-
Required = PydanticUndefined
76+
RequiredParam = PydanticUndefined
7477
Undefined = PydanticUndefined
7578
UndefinedType = PydanticUndefinedType
7679
evaluate_forwardref = eval_type_lenient
@@ -229,6 +232,10 @@ def get_definitions(
229232
field_mapping, definitions = schema_generator.generate_definitions(
230233
inputs=inputs
231234
)
235+
for item_def in cast(Dict[str, Dict[str, Any]], definitions).values():
236+
if "description" in item_def:
237+
item_description = cast(str, item_def["description"]).split("\f")[0]
238+
item_def["description"] = item_description
232239
return field_mapping, definitions # type: ignore[return-value]
233240

234241
def is_scalar_field(field: ModelField) -> bool:
@@ -279,6 +286,12 @@ def create_body_model(
279286
BodyModel: Type[BaseModel] = create_model(model_name, **field_params) # type: ignore[call-overload]
280287
return BodyModel
281288

289+
def get_model_fields(model: Type[BaseModel]) -> List[ModelField]:
290+
return [
291+
ModelField(field_info=field_info, name=name)
292+
for name, field_info in model.model_fields.items()
293+
]
294+
282295
else:
283296
from fastapi.openapi.constants import REF_PREFIX as REF_PREFIX
284297
from pydantic import AnyUrl as Url # noqa: F401
@@ -306,9 +319,10 @@ def create_body_model(
306319
from pydantic.fields import ( # type: ignore[no-redef,attr-defined]
307320
ModelField as ModelField, # noqa: F401
308321
)
309-
from pydantic.fields import ( # type: ignore[no-redef,attr-defined]
310-
Required as Required, # noqa: F401
311-
)
322+
323+
# Keeping old "Required" functionality from Pydantic V1, without
324+
# shadowing typing.Required.
325+
RequiredParam: Any = Ellipsis # type: ignore[no-redef]
312326
from pydantic.fields import ( # type: ignore[no-redef,attr-defined]
313327
Undefined as Undefined,
314328
)
@@ -513,6 +527,9 @@ def create_body_model(
513527
BodyModel.__fields__[f.name] = f # type: ignore[index]
514528
return BodyModel
515529

530+
def get_model_fields(model: Type[BaseModel]) -> List[ModelField]:
531+
return list(model.__fields__.values()) # type: ignore[attr-defined]
532+
516533

517534
def _regenerate_error_with_loc(
518535
*, errors: Sequence[Any], loc_prefix: Tuple[Union[str, int], ...]
@@ -532,6 +549,12 @@ def _annotation_is_sequence(annotation: Union[Type[Any], None]) -> bool:
532549

533550

534551
def field_annotation_is_sequence(annotation: Union[Type[Any], None]) -> bool:
552+
origin = get_origin(annotation)
553+
if origin is Union or origin is UnionType:
554+
for arg in get_args(annotation):
555+
if field_annotation_is_sequence(arg):
556+
return True
557+
return False
535558
return _annotation_is_sequence(annotation) or _annotation_is_sequence(
536559
get_origin(annotation)
537560
)
@@ -634,3 +657,8 @@ def is_uploadfile_sequence_annotation(annotation: Any) -> bool:
634657
is_uploadfile_or_nonable_uploadfile_annotation(sub_annotation)
635658
for sub_annotation in get_args(annotation)
636659
)
660+
661+
662+
@lru_cache
663+
def get_cached_model_fields(model: Type[BaseModel]) -> List[ModelField]:
664+
return get_model_fields(model)

0 commit comments

Comments
 (0)