Skip to content

feat(protocol): implement --secluded-args stdin argument passing - #2499

Merged
oferchen merged 1 commit into
masterfrom
feat/secluded-args
Feb 26, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/secluded-args

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Implement --secluded-args (-s, --protect-args) that transmits remote arguments over stdin as null-separated strings instead of the SSH command line, preventing shell expansion
  • Add SecludedInvocation to RemoteInvocationBuilder splitting args into minimal command-line + stdin payload
  • Add protocol::secluded_args module with send_secluded_args/recv_secluded_args for null-terminated wire format
  • Wire protect_args through ClientConfig, ClientConfigBuilder, ConfigInputs, and SSH transfer pipeline
  • Add server-side detection and stdin reception of secluded args

Test plan

  • Unit tests for secluded_args protocol module (round-trip, wire format, edge cases)
  • Unit tests for SecludedInvocation builder (enabled, disabled, pull mode)
  • Unit tests for protect_args in ClientConfig and ClientConfigBuilder
  • Unit tests for server-side secluded-args detection and flag parsing
  • All 22,151 workspace tests pass
  • clippy clean, fmt clean

Add --secluded-args (-s, --protect-args) support that transmits remote
arguments over stdin as null-separated strings instead of the SSH
command line, preventing shell expansion issues. Includes protocol
module, SSH invocation builder, config wiring, and server-side
reception.
@github-actions github-actions Bot added the enhancement New feature or request label Feb 26, 2026
@oferchen
oferchen merged commit 8f7a2d8 into master Feb 26, 2026
31 checks passed
@oferchen
oferchen deleted the feat/secluded-args branch February 26, 2026 17:16
oferchen added a commit that referenced this pull request May 1, 2026
Add --secluded-args (-s, --protect-args) support that transmits remote
arguments over stdin as null-separated strings instead of the SSH
command line, preventing shell expansion issues. Includes protocol
module, SSH invocation builder, config wiring, and server-side
reception.
oferchen added a commit that referenced this pull request May 5, 2026
Add --secluded-args (-s, --protect-args) support that transmits remote
arguments over stdin as null-separated strings instead of the SSH
command line, preventing shell expansion issues. Includes protocol
module, SSH invocation builder, config wiring, and server-side
reception.
oferchen added a commit that referenced this pull request May 20, 2026
…DeltaApplier (BR-3i.b)

Adds a `strategy: Arc<dyn ChecksumStrategy>` field plus a
`with_strategy(concurrency, strategy)` constructor so the receiver
pipeline can thread the negotiated algorithm into the per-chunk
verify step without re-boxing on every rayon worker. `new(concurrency)`
keeps its existing signature and defaults to MD5 (seed 0), matching the
protocol >= 30 fallback `ChecksumFactory::from_negotiation` resolves
when no `NegotiationResult` is present, so the 12 test/bench callers
identified by the BR-3i.a audit need zero changes.

`verify_chunk` still returns `digest_len = chunk.data.len()` - the
dispatch to `self.strategy.compute(&chunk.data)` lands as a
one-function-body change in BR-3i.c (#2499). This commit is wiring only.

Adds three unit tests:
- `new_defaults_strategy_to_md5` pins the default algorithm.
- `with_strategy_threads_negotiated_algorithm` verifies the Arc handle
  round-trips through the constructor.
- `with_strategy_does_not_change_verify_chunk_behaviour` proves the stub
  is byte-identical regardless of the configured strategy.

Refs: #2498
oferchen added a commit that referenced this pull request May 21, 2026
…DeltaApplier (BR-3i.b) (#4616)

Adds a `strategy: Arc<dyn ChecksumStrategy>` field plus a
`with_strategy(concurrency, strategy)` constructor so the receiver
pipeline can thread the negotiated algorithm into the per-chunk
verify step without re-boxing on every rayon worker. `new(concurrency)`
keeps its existing signature and defaults to MD5 (seed 0), matching the
protocol >= 30 fallback `ChecksumFactory::from_negotiation` resolves
when no `NegotiationResult` is present, so the 12 test/bench callers
identified by the BR-3i.a audit need zero changes.

`verify_chunk` still returns `digest_len = chunk.data.len()` - the
dispatch to `self.strategy.compute(&chunk.data)` lands as a
one-function-body change in BR-3i.c (#2499). This commit is wiring only.

Adds three unit tests:
- `new_defaults_strategy_to_md5` pins the default algorithm.
- `with_strategy_threads_negotiated_algorithm` verifies the Arc handle
  round-trips through the constructor.
- `with_strategy_does_not_change_verify_chunk_behaviour` proves the stub
  is byte-identical regardless of the configured strategy.

Refs: #2498
oferchen added a commit that referenced this pull request Aug 24, 2026
…DeltaApplier (BR-3i.b) (#4616)

Adds a `strategy: Arc<dyn ChecksumStrategy>` field plus a
`with_strategy(concurrency, strategy)` constructor so the receiver
pipeline can thread the negotiated algorithm into the per-chunk
verify step without re-boxing on every rayon worker. `new(concurrency)`
keeps its existing signature and defaults to MD5 (seed 0), matching the
protocol >= 30 fallback `ChecksumFactory::from_negotiation` resolves
when no `NegotiationResult` is present, so the 12 test/bench callers
identified by the BR-3i.a audit need zero changes.

`verify_chunk` still returns `digest_len = chunk.data.len()` - the
dispatch to `self.strategy.compute(&chunk.data)` lands as a
one-function-body change in BR-3i.c (#2499). This commit is wiring only.

Adds three unit tests:
- `new_defaults_strategy_to_md5` pins the default algorithm.
- `with_strategy_threads_negotiated_algorithm` verifies the Arc handle
  round-trips through the constructor.
- `with_strategy_does_not_change_verify_chunk_behaviour` proves the stub
  is byte-identical regardless of the configured strategy.

Refs: #2498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant