Skip to content

Commit 75c2f32

Browse files
authored
cli: update dependencies (microsoft#184189)
Up all the dependencies! Notably: - russh to the latest main now that tunnel changes are merged - secret-service-rs to 3.x and dropping our custom fork - which also fixes SDL pings Fixes microsoft/vscode-internalbacklog#4328 Fixes microsoft/vscode-internalbacklog#4077
1 parent 0cf685c commit 75c2f32

File tree

9 files changed

+726
-513
lines changed

9 files changed

+726
-513
lines changed

cli/Cargo.lock

Lines changed: 659 additions & 444 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/Cargo.toml

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,70 +12,68 @@ path = "src/lib.rs"
1212
name = "code"
1313

1414
[dependencies]
15-
futures = "0.3"
16-
clap = { version = "3.0", features = ["derive", "env"] }
17-
open = { version = "2.1.0" }
18-
reqwest = { version = "0.11.9", default-features = false, features = ["json", "stream", "native-tls"] }
19-
tokio = { version = "1.24.2", features = ["full"] }
20-
tokio-util = { version = "0.7", features = ["compat", "codec"] }
21-
flate2 = { version = "1.0.22" }
22-
zip = { version = "0.5.13", default-features = false, features = ["time", "deflate"] }
23-
regex = { version = "1.5.5" }
24-
lazy_static = { version = "1.4.0" }
25-
sysinfo = { version = "0.27.7", default-features = false }
26-
serde = { version = "1.0", features = ["derive"] }
27-
serde_json = { version = "1.0" }
28-
rmp-serde = "1.0"
29-
uuid = { version = "0.8.2", features = ["serde", "v4"] }
30-
dirs = "4.0.0"
15+
futures = "0.3.28"
16+
clap = { version = "4.3.0", features = ["derive", "env"] }
17+
open = "4.1.0"
18+
reqwest = { version = "0.11.18", default-features = false, features = ["json", "stream", "native-tls"] }
19+
tokio = { version = "1.28.2", features = ["full"] }
20+
tokio-util = { version = "0.7.8", features = ["compat", "codec"] }
21+
flate2 = "1.0.26"
22+
zip = { version = "0.6.6", default-features = false, features = ["time", "deflate"] }
23+
regex = "1.8.3"
24+
lazy_static = "1.4.0"
25+
sysinfo = { version = "0.29.0", default-features = false }
26+
serde = { version = "1.0.163", features = ["derive"] }
27+
serde_json = "1.0.96"
28+
rmp-serde = "1.1.1"
29+
uuid = { version = "1.3.3", features = ["serde", "v4"] }
30+
dirs = "5.0.1"
3131
rand = "0.8.5"
3232
atty = "0.2.14"
33-
opentelemetry = { version = "0.18.0", features = ["rt-tokio"] }
34-
opentelemetry-application-insights = { version = "0.22.0", features = ["reqwest-client"] }
35-
serde_bytes = "0.11.5"
36-
chrono = { version = "0.4", features = ["serde"] }
37-
gethostname = "0.2.3"
38-
libc = "0.2"
39-
tunnels = { git = "https://github.com/microsoft/dev-tunnels", rev = "730aa86f8ccd9e2dd4541693fbce763357da93f4", default-features = false, features = ["connections"] }
40-
keyring = "1.1"
41-
dialoguer = "0.10"
42-
hyper = "0.14"
43-
indicatif = "0.16"
44-
tempfile = "3.4"
45-
clap_lex = "0.2"
46-
url = "2.3"
47-
async-trait = "0.1"
48-
log = "0.4"
49-
const_format = "0.2"
50-
sha2 = "0.10"
51-
base64 = "0.13"
33+
opentelemetry = { version = "0.19.0", features = ["rt-tokio"] }
34+
serde_bytes = "0.11.9"
35+
chrono = { version = "0.4.26", features = ["serde"] }
36+
gethostname = "0.4.3"
37+
libc = "0.2.144"
38+
tunnels = { git = "https://github.com/microsoft/dev-tunnels", rev = "2621784a9ad72aa39500372391332a14bad581a3", default-features = false, features = ["connections"] }
39+
keyring = { version = "2.0.3", default-features = false, features = ["linux-secret-service-rt-tokio-crypto-openssl"] }
40+
dialoguer = "0.10.4"
41+
hyper = "0.14.26"
42+
indicatif = "0.17.4"
43+
tempfile = "3.5.0"
44+
clap_lex = "0.5.0"
45+
url = "2.3.1"
46+
async-trait = "0.1.68"
47+
log = "0.4.18"
48+
const_format = "0.2.31"
49+
sha2 = "0.10.6"
50+
base64 = "0.21.2"
5251
shell-escape = "0.1.5"
53-
thiserror = "1.0"
52+
thiserror = "1.0.40"
5453
cfg-if = "1.0.0"
55-
pin-project = "1.0"
56-
console = "0.15"
57-
bytes = "1.4"
58-
tar = { version = "0.4" }
54+
pin-project = "1.1.0"
55+
console = "0.15.7"
56+
bytes = "1.4.0"
57+
tar = "0.4.38"
5958

6059
[build-dependencies]
61-
serde = { version = "1.0" }
62-
serde_json = { version = "1.0" }
60+
serde = "1.0.163"
61+
serde_json = "1.0.96"
6362

6463
[target.'cfg(windows)'.dependencies]
65-
winreg = "0.10"
64+
winreg = "0.50.0"
6665
winapi = "0.3.9"
6766

6867
[target.'cfg(target_os = "macos")'.dependencies]
6968
core-foundation = "0.9.3"
7069

7170
[target.'cfg(target_os = "linux")'.dependencies]
72-
zbus = { version = "3.4", default-features = false, features = ["tokio"] }
71+
zbus = { version = "3.13.1", default-features = false, features = ["tokio"] }
7372

7473
[patch.crates-io]
7574
russh = { git = "https://github.com/microsoft/vscode-russh", branch = "main" }
7675
russh-cryptovec = { git = "https://github.com/microsoft/vscode-russh", branch = "main" }
7776
russh-keys = { git = "https://github.com/microsoft/vscode-russh", branch = "main" }
78-
secret-service = { git = "https://github.com/microsoft/vscode-secret-service-rs", rev = "fbbaf222de10546609be26bb043e64356e855edb" }
7977

8078
[profile.release]
8179
strip = true

cli/src/auth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct AuthenticationError {
4949
error_description: Option<String>,
5050
}
5151

52-
#[derive(clap::ArgEnum, Serialize, Deserialize, Debug, Clone, Copy)]
52+
#[derive(clap::ValueEnum, Serialize, Deserialize, Debug, Clone, Copy)]
5353
pub enum AuthProvider {
5454
Microsoft,
5555
Github,
@@ -222,7 +222,7 @@ macro_rules! get_next_entry {
222222
match $self.entries.get($i) {
223223
Some(e) => e,
224224
None => {
225-
let e = keyring::Entry::new("vscode-cli", &format!("vscode-cli-{}", $i));
225+
let e = keyring::Entry::new("vscode-cli", &format!("vscode-cli-{}", $i)).unwrap();
226226
$self.entries.push(e);
227227
$self.entries.last().unwrap()
228228
}

cli/src/bin/code/legacy_args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ pub fn try_parse_legacy(
2929
match args.get_mut(long) {
3030
Some(prev) => {
3131
if let Some(v) = value {
32-
prev.push(v.to_str_lossy().to_string());
32+
prev.push(v.to_string_lossy().to_string());
3333
}
3434
}
3535
None => {
3636
if let Some(v) = value {
37-
args.insert(long.to_string(), vec![v.to_str_lossy().to_string()]);
37+
args.insert(long.to_string(), vec![v.to_string_lossy().to_string()]);
3838
} else {
3939
args.insert(long.to_string(), vec![]);
4040
}

cli/src/commands/args.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use std::{fmt, path::PathBuf};
77

88
use crate::{constants, log, options, tunnels::code_server::CodeServerArgs};
9-
use clap::{ArgEnum, Args, Parser, Subcommand};
9+
use clap::{ValueEnum, Args, Parser, Subcommand};
1010
use const_format::concatcp;
1111

1212
const CLI_NAME: &str = concatcp!(constants::PRODUCT_NAME_LONG, " CLI");
@@ -399,7 +399,7 @@ pub struct DesktopCodeOptions {
399399
#[derive(Args, Debug, Clone)]
400400
pub struct OutputFormatOptions {
401401
/// Set the data output formats.
402-
#[clap(arg_enum, long, value_name = "format", default_value_t = OutputFormat::Text)]
402+
#[clap(value_enum, long, value_name = "format", default_value_t = OutputFormat::Text)]
403403
pub format: OutputFormat,
404404
}
405405

@@ -429,7 +429,7 @@ pub struct GlobalOptions {
429429
pub log_to_file: Option<PathBuf>,
430430

431431
/// Log level to use.
432-
#[clap(long, arg_enum, value_name = "level", global = true)]
432+
#[clap(long, value_enum, value_name = "level", global = true)]
433433
pub log: Option<log::Level>,
434434

435435
/// Disable telemetry for the current command, even if it was previously
@@ -438,7 +438,7 @@ pub struct GlobalOptions {
438438
pub disable_telemetry: bool,
439439

440440
/// Sets the initial telemetry level
441-
#[clap(arg_enum, long, global = true, hide = true)]
441+
#[clap(value_enum, long, global = true, hide = true)]
442442
pub telemetry_level: Option<options::TelemetryLevel>,
443443
}
444444

@@ -474,7 +474,7 @@ pub struct EditorTroubleshooting {
474474
pub disable_extension: Vec<String>,
475475

476476
/// Turn sync on or off.
477-
#[clap(arg_enum, long, value_name = "on | off")]
477+
#[clap(value_enum, long, value_name = "on | off")]
478478
pub sync: Option<SyncState>,
479479

480480
/// Allow debugging and profiling of extensions. Check the developer tools for the connection URI.
@@ -524,7 +524,7 @@ impl EditorTroubleshooting {
524524
}
525525
}
526526

527-
#[derive(ArgEnum, Clone, Copy, Debug)]
527+
#[derive(ValueEnum, Clone, Copy, Debug)]
528528
pub enum SyncState {
529529
On,
530530
Off,
@@ -539,7 +539,7 @@ impl fmt::Display for SyncState {
539539
}
540540
}
541541

542-
#[derive(ArgEnum, Clone, Copy, Debug)]
542+
#[derive(ValueEnum, Clone, Copy, Debug)]
543543
pub enum OutputFormat {
544544
Json,
545545
Text,
@@ -677,11 +677,11 @@ pub struct LoginArgs {
677677
pub access_token: Option<String>,
678678

679679
/// The auth provider to use. If not provided, a prompt will be shown.
680-
#[clap(arg_enum, long)]
680+
#[clap(value_enum, long)]
681681
pub provider: Option<AuthProvider>,
682682
}
683683

684-
#[derive(clap::ArgEnum, Debug, Clone, Copy)]
684+
#[derive(clap::ValueEnum, Debug, Clone, Copy)]
685685
pub enum AuthProvider {
686686
Microsoft,
687687
Github,

cli/src/commands/tunnels.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
use async_trait::async_trait;
7+
use base64::{Engine as _, engine::general_purpose as b64};
78
use sha2::{Digest, Sha256};
89
use std::{str::FromStr, time::Duration};
910
use sysinfo::Pid;
@@ -316,7 +317,7 @@ fn get_connection_token(tunnel: &ActiveTunnel) -> String {
316317
let mut hash = Sha256::new();
317318
hash.update(tunnel.id.as_bytes());
318319
let result = hash.finalize();
319-
base64::encode_config(result, base64::URL_SAFE_NO_PAD)
320+
b64::URL_SAFE_NO_PAD.encode(result)
320321
}
321322

322323
async fn serve_with_csa(

cli/src/log.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,20 @@ pub fn next_counter() -> u32 {
2626
}
2727

2828
// Log level
29-
#[derive(clap::ArgEnum, PartialEq, Eq, PartialOrd, Clone, Copy, Debug, Serialize, Deserialize)]
30-
#[derive(Default)]
29+
#[derive(
30+
clap::ValueEnum, PartialEq, Eq, PartialOrd, Clone, Copy, Debug, Serialize, Deserialize, Default,
31+
)]
3132
pub enum Level {
3233
Trace = 0,
3334
Debug,
3435
#[default]
35-
Info,
36+
Info,
3637
Warn,
3738
Error,
3839
Critical,
3940
Off,
4041
}
4142

42-
43-
4443
impl fmt::Display for Level {
4544
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4645
match self {
@@ -344,8 +343,7 @@ impl log::Log for RustyLogger {
344343

345344
// exclude noisy log modules:
346345
let src = match record.module_path() {
347-
Some("russh::cipher") => return,
348-
Some("russh::negotiation") => return,
346+
Some("russh::cipher" | "russh::negotiation" | "russh::kex::dh") => return,
349347
Some(s) => s,
350348
None => "<unknown>",
351349
};

cli/src/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
99

1010
use crate::constants::{APPLICATION_NAME_MAP, PRODUCT_NAME_LONG_MAP, SERVER_NAME_MAP};
1111

12-
#[derive(clap::ArgEnum, Copy, Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
12+
#[derive(clap::ValueEnum, Copy, Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
1313
pub enum Quality {
1414
#[serde(rename = "stable")]
1515
Stable,
@@ -95,7 +95,7 @@ impl TryFrom<&str> for Quality {
9595
}
9696
}
9797

98-
#[derive(clap::ArgEnum, Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
98+
#[derive(clap::ValueEnum, Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
9999
pub enum TelemetryLevel {
100100
Off,
101101
Crash,

cli/src/tunnels/challenge.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ pub fn create_challenge() -> String {
1111

1212
#[cfg(not(feature = "vsda"))]
1313
pub fn sign_challenge(challenge: &str) -> String {
14+
use base64::{engine::general_purpose as b64, Engine as _};
1415
use sha2::{Digest, Sha256};
1516
let mut hash = Sha256::new();
1617
hash.update(challenge.as_bytes());
1718
let result = hash.finalize();
18-
base64::encode_config(result, base64::URL_SAFE_NO_PAD)
19+
b64::URL_SAFE_NO_PAD.encode(result)
1920
}
2021

2122
#[cfg(not(feature = "vsda"))]

0 commit comments

Comments
 (0)