rust: update dependencies#624
Open
connor4312 wants to merge 3 commits intomicrosoft:mainfrom
Open
Conversation
- 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.
There was a problem hiding this comment.
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 withjiff::Timestampacross tunnel-related structs. - Updated connection/websocket/proxy code to the newer
tokio-tungstenite+hyper/hyper-util/http-body-utilAPIs and swappedfutures→futures_util. - Switched Windows policy header encoding from
urlencodingtopercent-encodingand updatedCargo.tomlfeature/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. ifsend_requesterrors or the response status is non-success). Consider aborting/joining the task (or using an approach likehyper::upgradethat 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
Member
Author
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
timechronotope/chrono#1423 (comment)Verified in the VS Code CLI that tunnel functionality still works as expected with these updates.