Skip to content

Pass SCP URI connection settings through the SSH options hash - #90

Open
OskarEichler wants to merge 1 commit into
net-ssh:masterfrom
OskarEichler:codex/uri-connection-options
Open

Pass SCP URI connection settings through the SSH options hash#90
OskarEichler wants to merge 1 commit into
net-ssh:masterfrom
OskarEichler:codex/uri-connection-options

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Put URI-derived port/password defaults in the nested :ssh hash consumed by Net::SCP.download!, while preserving explicit SSH options and their precedence.

Reproduction and evidence

The existing adapter passes URI port/password at the outer SCP-options level, but the class download! method only forwards options.delete(:ssh) to Net::SSH.start. A captured call for scp://user:example@host:2222/file previously lacked these values in :ssh; it now includes them. Frozen options and nested hashes remain unchanged. Explicit ssh: {port: 3333, password: 'override'} still wins over URI defaults.

Compatibility / breaking changes

URI port/password values previously ignored by this adapter now take effect as defaults. Explicit nested SSH options retain precedence; an absent URI password does not clear a supplied password. Percent-decoding is proposed separately. No secrets or real authentication were used in verification.

Verification and limits

  • This focused branch passes the existing upstream suite: 36 tests / 70 assertions, Ruby 4.0.6, net-ssh 7.3.3, test-unit 3.7.8 and Mocha 2.1.0; all Ruby commands used rbenv.
  • The combined release-based consumer candidate passes the suite with frozen string literals enabled, 10 focused cases, 2,906 model assertions, 24 URI-component assertions and 19 local scp/URI assertions. Combined evidence includes other separately proposed fixes and existing upstream frozen-string corrections; it is not attributed to this patch alone.
  • No repository tests added/modified under the consuming project's explicit no-new-tests policy. Reproductions/models ran externally. No deployed servers, SSH connections or production data were used.
  • All seven runtime files parse with the Ruby 2.6 parser; actual older-Ruby/Windows/remote-server matrices were not run locally. No upstream lint config exists; targeted lint has the same eight pre-existing warnings, with no new warnings.
  • Existing upstream PRs/issues and contribution guidance were checked. Maintainer CI results are pending; no CI pass is claimed.

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