fix: connection URL parsing, SSH key resolution, and export compatibility#902
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f67ac59f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if connection.type == .redis, let redisDb = connection.redisDatabase, redisDb > 0 { | ||
| sshPathComponent = String(redisDb) |
There was a problem hiding this comment.
Keep Redis SSH DB index round-trippable
When exporting SSH Redis connections, this now writes the selected Redis DB index into the path, but ConnectionURLParser.parseSSHURL still hard-codes redisDatabase: nil and does not map that path back to ParsedConnectionURL.redisDatabase. In practice, copying a Redis-over-SSH URL with DB > 0 and re-opening/importing it reconnects to DB 0 (the connection layer falls back to 0 when redisDatabase is nil), so users can run commands against the wrong logical Redis database.
Useful? React with 👍 / 👎.
| if connection.mongoUseSrv { | ||
| params.append("mongoUseSrv=true") |
There was a problem hiding this comment.
Parse exported mongoUseSrv query flag on import
The formatter now emits mongoUseSrv=true, but the parser never handles this key (there is no mongousesrv case in ConnectionURLParser.applyQueryParam), so exported URLs silently drop the SRV intent when re-imported unless the scheme is already mongodb+srv. This makes the new export field non-functional and breaks URL round-tripping for MongoDB connections that rely on the SRV toggle.
Useful? React with 👍 / 👎.
- Extract SafeModeLevel.from(urlInteger:) helper to unify mapping - Unify resolveIdentityFiles for main and jump host SSH auth - Simplify jump host .privateKey case to match main pattern - Remove unrelated Localizable.xcstrings entries - Add SafeModeLevel invalid-value test - Add Redis database index URL parsing test
When a URL-opened connection fails before being saved, delete the DB and SSH passwords from keychain to prevent orphaned entries with ephemeral UUIDs. Also adds CHANGELOG entries for URL parsing changes.
Summary
user:password@hostnot split (fulluser:passwent into SSH username field)usePrivateKey=truefrom TablePlus URLs correctly sets Private Key auth with auto-key resolutionsafeModeLevelparsing from TablePlus URLs~/.ssh/configand default locations (id_ed25519,id_rsa,id_ecdsa) when no explicit path setTest plan
postgresql+ssh://root@host:24700/postgres:pass@localhost/db?usePrivateKey=true-- SSH tab shows Private Key auth, buttons enabledmariadb+ssh://root:sshpass@host:22/dbuser:dbpass@localhost/db-- SSH user=root, password=sshpass (not full string in user field)mysql://root:pass@localhost/db?safeModeLevel=2-- safe mode set to Read Onlypostgresql://user:pass@host/db?SSLMODE=require-- SSL mode set (case-insensitive)/3?authSource=...~/.ssh/configor default keys