Skip to content

Handle FTP gallery endpoints, credentials and failed connections - #1685

Merged
serengil merged 3 commits into
serengil:masterfrom
Afloat16:fix/ftp-gallery-connections
Nov 9, 2026
Merged

serengil merged 3 commits into
serengil:masterfrom
Afloat16:fix/ftp-gallery-connections

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

What has been done

Gallery URIs now bracket IPv6 hosts and reject a different port on the same host. Endpoint validation errors omit supplied credentials. Decode credentials from a URI while keeping percent sequences in environment-provided usernames and passwords literal. Clean up FTP sockets when a cached connection fails its health check or a replacement cannot connect or log in. During existence checks, propagate authentication and unsupported-command errors while retaining the existing 550 file-unavailable behavior.

How to test

python -m pytest -q tests/unit/test_ftp_connection.py tests/unit/test_ftp_path_encoding.py tests/unit/test_filestore.py passed all 22 cases on Python 3.12. The eight new cases fail on base a8cee7b. A loopback FTP server also exercised percent-containing credentials, listing, reading, and checking present and absent files.

@serengil

serengil commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Can you rebase from main for this and other PRs? I updated python version to 3.9.

@Afloat16
Afloat16 force-pushed the fix/ftp-gallery-connections branch 2 times, most recently from e0afe8e to bcd6dd0 Compare November 9, 2026 12:43
@Afloat16
Afloat16 force-pushed the fix/ftp-gallery-connections branch from bcd6dd0 to 70e5224 Compare November 9, 2026 12:45
Flask 3 supplies Werkzeug Headers to the API routes. Include that existing input alongside the dictionary used by gRPC in the validate annotation. Keep the optional header type under TYPE_CHECKING.

Verified the six mypy errors on the unchanged base. With this annotation, all 144 source files pass mypy 1.14.1 under both Flask 3.1.3 and Flask 2.0.2. Pylint scores 10.00/10, the existing token-validation tests pass in both environments, and dictionary, Headers and EnvironHeaders checks cover valid, absent, invalid and disabled authentication.
@Afloat16
Afloat16 force-pushed the fix/ftp-gallery-connections branch from 70e5224 to 7d514e9 Compare November 9, 2026 12:54
@serengil
serengil merged commit e7734e1 into serengil:master Nov 9, 2026
3 checks passed
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