Skip to content

rust: update dependencies#624

Open
connor4312 wants to merge 3 commits intomicrosoft:mainfrom
connor4312:connor4312/rs-updates
Open

rust: update dependencies#624
connor4312 wants to merge 3 commits intomicrosoft:mainfrom
connor4312:connor4312/rs-updates

Conversation

@connor4312
Copy link
Copy Markdown
Member

@connor4312 connor4312 commented Apr 24, 2026

⚠️ Please do a traditional merge commit to avoid conflicts #626

  • chrono->jiff as chrono is going into maintence mode Differences between this crate and time chronotope/chrono#1423 (comment)
  • async-trait replaced when possible with Rust 1.75+ native async traits; kept for compat with russh
  • futures->futures_util, underlying library for just the things we need
  • urlencoding->percent-encoding as it's already a dep of the url module, so just one less dependency
  • general version updates

Verified in the VS Code CLI that tunnel functionality still works as expected with these updates.

- chrono->jiff as chrono is going into maintence mode chronotope/chrono#1423 (comment)
- async-trait replaced when possible with Rust 1.75+ native async traits; kept for compat with russh
- futures->futures_util, underlying library for just the things we need
- urlencoding->percent-encoding as it's already a dep of the url module, so just one less dependency
- general version updates

Verified in the VS Code CLI that tunnel functionality still works as expected with these updates.
@connor4312 connor4312 marked this pull request as draft April 24, 2026 20:05
@connor4312 connor4312 marked this pull request as ready for review April 24, 2026 20:16
@adamasmar adamasmar requested a review from Copilot April 24, 2026 20:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Rust SDK’s dependency stack (time handling, async/futures utilities, HTTP/WebSocket layers, and URL encoding) while adjusting the code to compile and run against the newer crates.

Changes:

  • Replaced chrono::{DateTime<Utc>} usages with jiff::Timestamp across tunnel-related structs.
  • Updated connection/websocket/proxy code to the newer tokio-tungstenite + hyper/hyper-util/http-body-util APIs and swapped futuresfutures_util.
  • Switched Windows policy header encoding from urlencoding to percent-encoding and updated Cargo.toml feature/dependency wiring.
Show a summary per file
File Description
rs/src/tunnel.rs Swaps tunnel timestamp type to jiff::Timestamp.
rs/src/management/policy_provider.rs Replaces urlencoding with percent-encoding for registry-derived header values.
rs/src/management/http_client.rs Removes async-trait usage in end-to-end test provider; minor test cleanup.
rs/src/management/authorization.rs Reworks AuthorizationProvider to return a boxed Future instead of using async-trait.
rs/src/contracts/tunnel_event.rs Migrates contract timestamp field to jiff::Timestamp.
rs/src/contracts/tunnel_access_control_entry.rs Migrates contract expiration field to jiff::Timestamp.
rs/src/contracts/tunnel.rs Migrates contract created/expiration fields to jiff::Timestamp.
rs/src/connections/ws.rs Updates futures imports and rewrites proxy CONNECT handshake for Hyper 1 + body utilities.
rs/src/connections/relay_tunnel_host.rs Moves off futures crate APIs; adjusts error mapping placement.
rs/src/connections/errors.rs Updates websocket error type path for newer tokio-tungstenite.
rs/Cargo.toml Dependency upgrades and feature gating for new HTTP/WebSocket stack + time crate swap.
rs/Cargo.lock Lockfile refresh reflecting upgraded dependency graph.
rs/.vscode/settings.json Adds Rust-analyzer feature selection + format-on-save for the Rust subfolder.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

rs/src/connections/ws.rs:268

  • The spawned Hyper connection task (tokio::spawn(conn.without_shutdown())) is left running on early returns (e.g. if send_request errors or the response status is non-success). Consider aborting/joining the task (or using an approach like hyper::upgrade that doesn't require a background task) to avoid leaking a detached task and open proxy connection in failure cases.
    let conn = tokio::spawn(conn.without_shutdown());
    let connect_req = hyper::Request::connect(&authority)
        .body(http_body_util::Empty::<hyper::body::Bytes>::new())
        .expect("expected to make connect request");

    let res = request_sender
        .send_request(connect_req)
        .await
        .map_err(TunnelError::ProxyConnectRequestFailed)?;
  • Files reviewed: 12/13 changed files
  • Comments generated: 6

Comment thread rs/src/connections/ws.rs Outdated
Comment thread rs/src/management/policy_provider.rs Outdated
Comment thread rs/src/management/authorization.rs
Comment thread rs/Cargo.toml Outdated
Comment thread rs/src/connections/ws.rs
Comment thread rs/src/connections/ws.rs
@connor4312
Copy link
Copy Markdown
Member Author

⚠️ Please do a traditional merge commit to avoid conflicts #626

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.

2 participants