Skip to content

fix(deps): upgrade aioftp from ~=0.20.0 to ==0.27.2#3333

Open
deacon-mp wants to merge 3 commits intomasterfrom
fix/aioftp-version-pin
Open

fix(deps): upgrade aioftp from ~=0.20.0 to ==0.27.2#3333
deacon-mp wants to merge 3 commits intomasterfrom
fix/aioftp-version-pin

Conversation

@deacon-mp
Copy link
Contributor

Summary

  • aioftp ~= 0.20.0 is flagged by the safety vulnerability database as insecure
  • Pin to aioftp == 0.27.2 (latest stable release) which resolves the advisory
  • Verified full API compatibility with contact_ftp.py: User, Permission, Server, ConnectionConditions, PathPermissions, and worker are all present and have the same signatures in 0.27.2

Changes

  • requirements.txt: aioftp~=0.20.0aioftp==0.27.2
  • tests/contacts/test_aioftp_version.py: new tests asserting the installed version meets the minimum threshold (≥ 0.21.0) and that the server-side API surface expected by contact_ftp.py remains intact

Test plan

  • pytest tests/contacts/test_aioftp_version.py passes
  • Existing FTP contact tests (tests/contacts/test_contact_ftp.py) still pass
  • pip install -r requirements.txt resolves without conflicts

aioftp ~=0.20.0 is flagged by the safety vulnerability database.
Pin to 0.27.2 (latest stable) which resolves the advisory while
maintaining full API compatibility with the existing FTP contact code
(User, Permission, Server, ConnectionConditions, PathPermissions and
worker are all present in the new release).

Add tests/contacts/test_aioftp_version.py to assert the installed
version meets the minimum threshold and that the server-side API
surface expected by contact_ftp.py remains intact.
@deacon-mp deacon-mp requested a review from Copilot March 16, 2026 03:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades aioftp to a non-vulnerable version and adds tests to prevent regressions in dependency versioning and the expected server-side API surface used by the FTP contact integration.

Changes:

  • Pin aioftp from ~=0.20.0 to ==0.27.2 in requirements.txt.
  • Add tests to assert a minimum safe aioftp version and verify required server-side attributes exist.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/contacts/test_aioftp_version.py Adds dependency/version guardrails and basic API surface checks for aioftp.
requirements.txt Pins aioftp to 0.27.2 to address the vulnerability flagged in 0.20.x.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +12


def test_aioftp_version_meets_minimum():
"""aioftp must be >= 0.21.0 to avoid CVE / safety-DB advisory for 0.20.x."""
version_str = importlib.metadata.version("aioftp")
parts = tuple(int(p) for p in version_str.split(".")[:3])
assert parts >= (0, 21, 0), (
Comment on lines +22 to +24
for name in ("Server", "User", "Permission", "ConnectionConditions",
"PathPermissions", "worker"):
assert hasattr(aioftp, name), f"aioftp missing expected attribute: {name}"
- Use packaging.version.Version for robust PEP 440 version comparison
  instead of manual split/int logic (avoids ValueError on pre/post suffixes)
- Strengthen test_aioftp_server_api_intact to assert attributes are classes
  (not just present) and document that worker may be a function
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades aioftp to a secure pinned version and adds guardrail tests to ensure the installed aioftp version and server-side API surface remain compatible with contact_ftp.py.

Changes:

  • Pin aioftp from ~=0.20.0 to ==0.27.2 in requirements.txt.
  • Add tests that assert aioftp is at/above a safe minimum version and exposes required server-side symbols.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/contacts/test_aioftp_version.py Adds version + API-surface assertions to detect insecure or incompatible aioftp installs.
requirements.txt Pins aioftp to 0.27.2 to address the reported vulnerability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4 to +6
import inspect

import pytest
for name, expected_type in expected_classes.items():
obj = getattr(aioftp, name, None)
assert obj is not None, f"aioftp missing expected attribute: {name}"
assert isinstance(obj, type), (
)

# worker may be a function or coroutine function rather than a class
assert hasattr(aioftp, "worker"), "aioftp missing expected attribute: worker"
The hasattr check alone could produce false positives if worker
exists but is non-callable. Also removes unused inspect and pytest
imports.
@deacon-mp deacon-mp requested a review from Copilot March 16, 2026 13:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates aioftp to a non-vulnerable release and adds regression tests to ensure the installed aioftp version and server-side API used by contact_ftp.py remain compatible.

Changes:

  • Pin aioftp to ==0.27.2 to remediate the Safety DB advisory affecting 0.20.x.
  • Add tests validating aioftp meets a minimum safe version and exposes the expected server-side symbols.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/contacts/test_aioftp_version.py Adds version threshold and API surface assertions for aioftp.
requirements.txt Pins aioftp to 0.27.2 to address the reported vulnerability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

for name, expected_type in expected_classes.items():
obj = getattr(aioftp, name, None)
assert obj is not None, f"aioftp missing expected attribute: {name}"
assert isinstance(obj, type), (
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants