Summary
The SFTP authority parser uses rsplit_once(':') to separate host and port, which breaks on IPv6 addresses containing multiple colons.
Current State
- File:
src-tauri/src/locations/sftp/mod.rs:334
parse_sftp_authority("user@::1") incorrectly parses as host=::, port=1
parse_sftp_authority("user@[::1]:2222") would also fail
Proposed Changes
Support bracketed IPv6 literals per RFC 3986:
sftp://user@[::1]/path → host=::1, port=22
sftp://user@[::1]:2222/path → host=::1, port=2222
Parse logic:
- If host_part starts with
[, find matching ]
- Extract IPv6 address from brackets
- Check for
:port after closing bracket
Acceptance Criteria
Summary
The SFTP authority parser uses
rsplit_once(':')to separate host and port, which breaks on IPv6 addresses containing multiple colons.Current State
src-tauri/src/locations/sftp/mod.rs:334parse_sftp_authority("user@::1")incorrectly parses as host=::, port=1parse_sftp_authority("user@[::1]:2222")would also failProposed Changes
Support bracketed IPv6 literals per RFC 3986:
sftp://user@[::1]/path→ host=::1, port=22sftp://user@[::1]:2222/path→ host=::1, port=2222Parse logic:
[, find matching]:portafter closing bracketAcceptance Criteria
sftp://user@[::1]/pathparses correctlysftp://user@[::1]:2222/pathparses correctlysftp://user@[fe80::1%25eth0]:22/pathworks (link-local with zone ID)