Skip to content

fix(ssh): allow blank user in VS Code authority - #10072

Merged
AmethystLiang merged 1 commit into
mainfrom
fix-p1-vscode-ssh-blank-user
Jul 23, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
fix-p1-vscode-ssh-blank-user

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

Allows blank usernames in VS Code SSH authority configuration. When a manual SSH target has an empty username, the authority string uses host-only format (host) instead of the user@host format.

Changes

  • Modified isValidAuthorityPart() to accept an allowEmpty parameter, allowing blank usernames for manual targets while still rejecting control characters
  • Updated resolveVsCodeSshAuthority() to generate host-only authority when username is empty
  • Enhanced validation to distinguish between empty usernames (valid for manual targets) and newlines (always invalid)
  • Added test coverage for blank and whitespace-only usernames

Testing

  • Added test in shell.test.ts for manual port-22 target with blank username
  • Updated vscode-ssh-authority.test.ts with parameterized test for empty and whitespace usernames
  • Existing validation tests updated to verify newline rejection in usernames
  • All changes maintain security by rejecting control characters regardless of username emptiness

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 91bc026f-ea3a-4ab4-88c4-8167ffc7ccc9

📥 Commits

Reviewing files that changed from the base of the PR and between ffe54a5 and b9a41be.

📒 Files selected for processing (3)
  • src/main/ipc/shell.test.ts
  • src/main/ssh/vscode-ssh-authority.test.ts
  • src/main/ssh/vscode-ssh-authority.ts

📝 Walkthrough

Walkthrough

SSH authority resolution now accepts empty or whitespace usernames for manual port-22 targets and returns a host-only authority. Validation continues to reject unsafe host, username, config-host, and port values. Tests cover the new authority behavior and verify that external editor launch arguments use the host-only SSH authority.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, changes, and testing, but omits required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, complete the testing checklist, and include the requested AI review, security, and platform-specific notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: allowing blank SSH usernames in VS Code authority.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant