cli: update dependencies (#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 https://github.com/microsoft/vscode-internalbacklog/issues/4328
Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4077
This commit is contained in:
Connor Peet 2023-06-02 10:27:47 -07:00 committed by GitHub
parent 0cf685c1da
commit 75c2f321b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 739 additions and 526 deletions

1129
cli/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -12,70 +12,68 @@ path = "src/lib.rs"
name = "code"
[dependencies]
futures = "0.3"
clap = { version = "3.0", features = ["derive", "env"] }
open = { version = "2.1.0" }
reqwest = { version = "0.11.9", default-features = false, features = ["json", "stream", "native-tls"] }
tokio = { version = "1.24.2", features = ["full"] }
tokio-util = { version = "0.7", features = ["compat", "codec"] }
flate2 = { version = "1.0.22" }
zip = { version = "0.5.13", default-features = false, features = ["time", "deflate"] }
regex = { version = "1.5.5" }
lazy_static = { version = "1.4.0" }
sysinfo = { version = "0.27.7", default-features = false }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
rmp-serde = "1.0"
uuid = { version = "0.8.2", features = ["serde", "v4"] }
dirs = "4.0.0"
futures = "0.3.28"
clap = { version = "4.3.0", features = ["derive", "env"] }
open = "4.1.0"
reqwest = { version = "0.11.18", default-features = false, features = ["json", "stream", "native-tls"] }
tokio = { version = "1.28.2", features = ["full"] }
tokio-util = { version = "0.7.8", features = ["compat", "codec"] }
flate2 = "1.0.26"
zip = { version = "0.6.6", default-features = false, features = ["time", "deflate"] }
regex = "1.8.3"
lazy_static = "1.4.0"
sysinfo = { version = "0.29.0", default-features = false }
serde = { version = "1.0.163", features = ["derive"] }
serde_json = "1.0.96"
rmp-serde = "1.1.1"
uuid = { version = "1.3.3", features = ["serde", "v4"] }
dirs = "5.0.1"
rand = "0.8.5"
atty = "0.2.14"
opentelemetry = { version = "0.18.0", features = ["rt-tokio"] }
opentelemetry-application-insights = { version = "0.22.0", features = ["reqwest-client"] }
serde_bytes = "0.11.5"
chrono = { version = "0.4", features = ["serde"] }
gethostname = "0.2.3"
libc = "0.2"
tunnels = { git = "https://github.com/microsoft/dev-tunnels", rev = "730aa86f8ccd9e2dd4541693fbce763357da93f4", default-features = false, features = ["connections"] }
keyring = "1.1"
dialoguer = "0.10"
hyper = "0.14"
indicatif = "0.16"
tempfile = "3.4"
clap_lex = "0.2"
url = "2.3"
async-trait = "0.1"
log = "0.4"
const_format = "0.2"
sha2 = "0.10"
base64 = "0.13"
opentelemetry = { version = "0.19.0", features = ["rt-tokio"] }
serde_bytes = "0.11.9"
chrono = { version = "0.4.26", features = ["serde"] }
gethostname = "0.4.3"
libc = "0.2.144"
tunnels = { git = "https://github.com/microsoft/dev-tunnels", rev = "2621784a9ad72aa39500372391332a14bad581a3", default-features = false, features = ["connections"] }
keyring = { version = "2.0.3", default-features = false, features = ["linux-secret-service-rt-tokio-crypto-openssl"] }
dialoguer = "0.10.4"
hyper = "0.14.26"
indicatif = "0.17.4"
tempfile = "3.5.0"
clap_lex = "0.5.0"
url = "2.3.1"
async-trait = "0.1.68"
log = "0.4.18"
const_format = "0.2.31"
sha2 = "0.10.6"
base64 = "0.21.2"
shell-escape = "0.1.5"
thiserror = "1.0"
thiserror = "1.0.40"
cfg-if = "1.0.0"
pin-project = "1.0"
console = "0.15"
bytes = "1.4"
tar = { version = "0.4" }
pin-project = "1.1.0"
console = "0.15.7"
bytes = "1.4.0"
tar = "0.4.38"
[build-dependencies]
serde = { version = "1.0" }
serde_json = { version = "1.0" }
serde = "1.0.163"
serde_json = "1.0.96"
[target.'cfg(windows)'.dependencies]
winreg = "0.10"
winreg = "0.50.0"
winapi = "0.3.9"
[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = "0.9.3"
[target.'cfg(target_os = "linux")'.dependencies]
zbus = { version = "3.4", default-features = false, features = ["tokio"] }
zbus = { version = "3.13.1", default-features = false, features = ["tokio"] }
[patch.crates-io]
russh = { git = "https://github.com/microsoft/vscode-russh", branch = "main" }
russh-cryptovec = { git = "https://github.com/microsoft/vscode-russh", branch = "main" }
russh-keys = { git = "https://github.com/microsoft/vscode-russh", branch = "main" }
secret-service = { git = "https://github.com/microsoft/vscode-secret-service-rs", rev = "fbbaf222de10546609be26bb043e64356e855edb" }
[profile.release]
strip = true

View file

@ -49,7 +49,7 @@ struct AuthenticationError {
error_description: Option<String>,
}
#[derive(clap::ArgEnum, Serialize, Deserialize, Debug, Clone, Copy)]
#[derive(clap::ValueEnum, Serialize, Deserialize, Debug, Clone, Copy)]
pub enum AuthProvider {
Microsoft,
Github,
@ -222,7 +222,7 @@ macro_rules! get_next_entry {
match $self.entries.get($i) {
Some(e) => e,
None => {
let e = keyring::Entry::new("vscode-cli", &format!("vscode-cli-{}", $i));
let e = keyring::Entry::new("vscode-cli", &format!("vscode-cli-{}", $i)).unwrap();
$self.entries.push(e);
$self.entries.last().unwrap()
}

View file

@ -29,12 +29,12 @@ pub fn try_parse_legacy(
match args.get_mut(long) {
Some(prev) => {
if let Some(v) = value {
prev.push(v.to_str_lossy().to_string());
prev.push(v.to_string_lossy().to_string());
}
}
None => {
if let Some(v) = value {
args.insert(long.to_string(), vec![v.to_str_lossy().to_string()]);
args.insert(long.to_string(), vec![v.to_string_lossy().to_string()]);
} else {
args.insert(long.to_string(), vec![]);
}

View file

@ -6,7 +6,7 @@
use std::{fmt, path::PathBuf};
use crate::{constants, log, options, tunnels::code_server::CodeServerArgs};
use clap::{ArgEnum, Args, Parser, Subcommand};
use clap::{ValueEnum, Args, Parser, Subcommand};
use const_format::concatcp;
const CLI_NAME: &str = concatcp!(constants::PRODUCT_NAME_LONG, " CLI");
@ -399,7 +399,7 @@ pub struct DesktopCodeOptions {
#[derive(Args, Debug, Clone)]
pub struct OutputFormatOptions {
/// Set the data output formats.
#[clap(arg_enum, long, value_name = "format", default_value_t = OutputFormat::Text)]
#[clap(value_enum, long, value_name = "format", default_value_t = OutputFormat::Text)]
pub format: OutputFormat,
}
@ -429,7 +429,7 @@ pub struct GlobalOptions {
pub log_to_file: Option<PathBuf>,
/// Log level to use.
#[clap(long, arg_enum, value_name = "level", global = true)]
#[clap(long, value_enum, value_name = "level", global = true)]
pub log: Option<log::Level>,
/// Disable telemetry for the current command, even if it was previously
@ -438,7 +438,7 @@ pub struct GlobalOptions {
pub disable_telemetry: bool,
/// Sets the initial telemetry level
#[clap(arg_enum, long, global = true, hide = true)]
#[clap(value_enum, long, global = true, hide = true)]
pub telemetry_level: Option<options::TelemetryLevel>,
}
@ -474,7 +474,7 @@ pub struct EditorTroubleshooting {
pub disable_extension: Vec<String>,
/// Turn sync on or off.
#[clap(arg_enum, long, value_name = "on | off")]
#[clap(value_enum, long, value_name = "on | off")]
pub sync: Option<SyncState>,
/// Allow debugging and profiling of extensions. Check the developer tools for the connection URI.
@ -524,7 +524,7 @@ impl EditorTroubleshooting {
}
}
#[derive(ArgEnum, Clone, Copy, Debug)]
#[derive(ValueEnum, Clone, Copy, Debug)]
pub enum SyncState {
On,
Off,
@ -539,7 +539,7 @@ impl fmt::Display for SyncState {
}
}
#[derive(ArgEnum, Clone, Copy, Debug)]
#[derive(ValueEnum, Clone, Copy, Debug)]
pub enum OutputFormat {
Json,
Text,
@ -677,11 +677,11 @@ pub struct LoginArgs {
pub access_token: Option<String>,
/// The auth provider to use. If not provided, a prompt will be shown.
#[clap(arg_enum, long)]
#[clap(value_enum, long)]
pub provider: Option<AuthProvider>,
}
#[derive(clap::ArgEnum, Debug, Clone, Copy)]
#[derive(clap::ValueEnum, Debug, Clone, Copy)]
pub enum AuthProvider {
Microsoft,
Github,

View file

@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
use async_trait::async_trait;
use base64::{Engine as _, engine::general_purpose as b64};
use sha2::{Digest, Sha256};
use std::{str::FromStr, time::Duration};
use sysinfo::Pid;
@ -316,7 +317,7 @@ fn get_connection_token(tunnel: &ActiveTunnel) -> String {
let mut hash = Sha256::new();
hash.update(tunnel.id.as_bytes());
let result = hash.finalize();
base64::encode_config(result, base64::URL_SAFE_NO_PAD)
b64::URL_SAFE_NO_PAD.encode(result)
}
async fn serve_with_csa(

View file

@ -26,21 +26,20 @@ pub fn next_counter() -> u32 {
}
// Log level
#[derive(clap::ArgEnum, PartialEq, Eq, PartialOrd, Clone, Copy, Debug, Serialize, Deserialize)]
#[derive(Default)]
#[derive(
clap::ValueEnum, PartialEq, Eq, PartialOrd, Clone, Copy, Debug, Serialize, Deserialize, Default,
)]
pub enum Level {
Trace = 0,
Debug,
#[default]
Info,
Info,
Warn,
Error,
Critical,
Off,
}
impl fmt::Display for Level {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
@ -344,8 +343,7 @@ impl log::Log for RustyLogger {
// exclude noisy log modules:
let src = match record.module_path() {
Some("russh::cipher") => return,
Some("russh::negotiation") => return,
Some("russh::cipher" | "russh::negotiation" | "russh::kex::dh") => return,
Some(s) => s,
None => "<unknown>",
};

View file

@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
use crate::constants::{APPLICATION_NAME_MAP, PRODUCT_NAME_LONG_MAP, SERVER_NAME_MAP};
#[derive(clap::ArgEnum, Copy, Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
#[derive(clap::ValueEnum, Copy, Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub enum Quality {
#[serde(rename = "stable")]
Stable,
@ -95,7 +95,7 @@ impl TryFrom<&str> for Quality {
}
}
#[derive(clap::ArgEnum, Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(clap::ValueEnum, Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum TelemetryLevel {
Off,
Crash,

View file

@ -11,11 +11,12 @@ pub fn create_challenge() -> String {
#[cfg(not(feature = "vsda"))]
pub fn sign_challenge(challenge: &str) -> String {
use base64::{engine::general_purpose as b64, Engine as _};
use sha2::{Digest, Sha256};
let mut hash = Sha256::new();
hash.update(challenge.as_bytes());
let result = hash.finalize();
base64::encode_config(result, base64::URL_SAFE_NO_PAD)
b64::URL_SAFE_NO_PAD.encode(result)
}
#[cfg(not(feature = "vsda"))]