Skip to content

Commit 1cac147

Browse files
authored
[CVAT] Update deps, fix warnings (#2728)
* Update fastapi and sqlalchemy to mitigate DOS attacks * Remove invalid subquery call * Remove extra alembic hooks * Fix foreign key overlap warnings
1 parent 5191a22 commit 1cac147

File tree

8 files changed

+244
-257
lines changed

8 files changed

+244
-257
lines changed

packages/examples/cvat/exchange-oracle/alembic.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ sqlalchemy.url =
6464
# on newly generated revision scripts. See the documentation for further
6565
# detail and examples
6666

67-
hooks=ruff, ruff_format, types_update
67+
hooks=ruff, ruff_format
6868

6969
ruff.type = exec
7070
ruff.executable = ruff

packages/examples/cvat/exchange-oracle/poetry.lock

Lines changed: 117 additions & 126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/examples/cvat/exchange-oracle/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ packages = [{include = "exchange_oracle"}]
88

99
[tool.poetry.dependencies]
1010
python = "^3.10,<3.13"
11-
fastapi = "^0.111.1"
11+
fastapi = {version = "^0.115.4", extras = ["standard"]}
1212
uvicorn = "^0.30.0"
1313
python-dotenv = "^1.0.0"
1414
psycopg2 = "^2.9.6"
@@ -32,6 +32,7 @@ fastapi-filter = "^1.1.0"
3232
fastapi-limiter = "^0.1.6"
3333
strenum = "^0.4.15"
3434
pyjwt = "^2.9.0"
35+
starlette = ">=0.40.0" # avoid the vulnerability with multipart/form-data
3536

3637

3738
[tool.poetry.group.dev.dependencies]

packages/examples/cvat/exchange-oracle/src/models/cvat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class Project(Base):
6161
")"
6262
),
6363
foreign_keys=[escrow_address, chain_id],
64+
overlaps="escrow_validation",
6465
)
6566
escrow_validation: Mapped[EscrowValidation] = relationship(
6667
back_populates="projects",
@@ -73,6 +74,7 @@ class Project(Base):
7374
")"
7475
),
7576
foreign_keys=[escrow_address, chain_id],
77+
overlaps="escrow_creation",
7678
)
7779

7880
def __repr__(self) -> str:
@@ -129,6 +131,7 @@ class EscrowCreation(Base):
129131
")"
130132
),
131133
foreign_keys=[Project.escrow_address, Project.chain_id],
134+
overlaps="projects, escrow_validation",
132135
)
133136

134137
def __repr__(self) -> str:
@@ -157,6 +160,7 @@ class EscrowValidation(Base):
157160
")"
158161
),
159162
foreign_keys=[Project.escrow_address, Project.chain_id],
163+
overlaps="projects, escrow_creation",
160164
)
161165

162166

packages/examples/cvat/exchange-oracle/src/services/cvat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ def prepare_escrows_for_validation(
412412
.where(EscrowValidation.status == EscrowValidationStatuses.awaiting)
413413
.limit(limit)
414414
.order_by(EscrowValidation.attempts.asc())
415-
.subquery()
416415
)
417416
update_stmt = (
418417
update(EscrowValidation)

packages/examples/cvat/recording-oracle/alembic.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ sqlalchemy.url = driver://user:pass@localhost/dbname
6868
# on newly generated revision scripts. See the documentation for further
6969
# detail and examples
7070

71-
hooks=ruff, ruff_format, types_update
71+
hooks=ruff, ruff_format
7272

7373
ruff.type = exec
7474
ruff.executable = ruff

packages/examples/cvat/recording-oracle/poetry.lock

Lines changed: 117 additions & 126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/examples/cvat/recording-oracle/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ packages = [{include = "recording_oracle"}]
88

99
[tool.poetry.dependencies]
1010
python = "^3.10, <3.13"
11-
fastapi = "^0.111.1"
11+
fastapi = {version = "^0.115.4", extras = ["standard"]}
1212
uvicorn = "^0.22.0"
1313
python-dotenv = "^1.0.0"
1414
SQLAlchemy = "^2.0.17"
@@ -24,6 +24,7 @@ google-cloud-storage = "^2.14.0"
2424
datumaro = {git = "https://github.com/cvat-ai/datumaro.git", rev = "ff83c00c2c1bc4b8fdfcc55067fcab0a9b5b6b11"}
2525
human-protocol-sdk = "^3.0.4"
2626
hexbytes = ">=1.2.0" # required for to_0x_hex() function
27+
starlette = ">=0.40.0" # avoid the vulnerability with multipart/form-data
2728

2829
[tool.poetry.group.dev.dependencies]
2930
hypothesis = "^6.82.6"

0 commit comments

Comments
 (0)