Skip to content

Commit 88099dc

Browse files
committed
version bumped warg to the 0.6.0 and removed unused deps
1 parent 1b4aa7c commit 88099dc

4 files changed

Lines changed: 25 additions & 69 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ indicatif = { workspace = true, optional = true }
4343
default = ["wit", "registry"]
4444
wat = ["wac-resolver/wat"]
4545
wit = ["wac-resolver/wit"]
46-
registry = ["wac-resolver/registry", "indicatif"]
46+
registry = ["wac-resolver/registry", "dep:indicatif"]
4747

4848
[workspace.dependencies]
4949
wac-parser = { path = "crates/wac-parser", version = "0.1.0", default-features = false }
@@ -71,12 +71,10 @@ wat = "1.202.0"
7171
logos = "0.14.0"
7272
miette = "7.2.0"
7373
thiserror = "1.0.58"
74-
warg-client = "0.5.0"
75-
warg-protocol = "0.5.0"
76-
warg-crypto = "0.5.0"
77-
warg-server = "0.5.0"
78-
warg-credentials = "0.5.0"
79-
secrecy = "0.8.0"
74+
warg-client = "0.6.0"
75+
warg-protocol = "0.6.0"
76+
warg-crypto = "0.6.0"
77+
warg-server = "0.6.0"
8078
futures = "0.3.30"
8179
indicatif = "0.17.8"
8280
pretty_assertions = "1.4.0"

crates/wac-resolver/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ miette = { workspace = true }
2424
warg-client = { workspace = true, optional = true }
2525
warg-protocol = { workspace = true, optional = true }
2626
warg-crypto = { workspace = true, optional = true }
27-
warg-credentials = { workspace = true, optional = true }
28-
secrecy = { workspace = true, optional = true }
2927
tokio = { workspace = true, optional = true }
3028
futures = { workspace = true, optional = true }
3129

@@ -40,5 +38,5 @@ tempdir = "0.3.7"
4038
[features]
4139
default = ["registry"]
4240
wat = ["dep:wat"]
43-
wit = ["wit-parser"]
44-
registry = ["warg-client", "warg-protocol", "warg-crypto", "warg-credentials", "secrecy", "tokio", "futures"]
41+
wit = ["dep:wit-parser"]
42+
registry = ["dep:warg-client", "dep:warg-protocol", "dep:warg-crypto", "dep:tokio", "dep:futures"]

crates/wac-resolver/src/registry.rs

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ use anyhow::Result;
33
use futures::{stream::FuturesUnordered, StreamExt};
44
use indexmap::IndexMap;
55
use miette::SourceSpan;
6-
use secrecy::Secret;
76
use semver::{Version, VersionReq};
87
use std::{fs, path::Path, sync::Arc};
98
use wac_types::BorrowedPackageKey;
10-
use warg_client::{Client, ClientError, Config, FileSystemClient, RegistryUrl};
11-
use warg_credentials::keyring::get_auth_token;
9+
use warg_client::{Client, ClientError, Config, FileSystemClient};
1210
use warg_protocol::registry::PackageName;
1311

1412
/// Implemented by progress bars.
@@ -43,13 +41,8 @@ impl RegistryPackageResolver {
4341
///
4442
/// If `url` is `None`, the default URL will be used.
4543
pub fn new(url: Option<&str>, bar: Option<Box<dyn ProgressBar>>) -> Result<Self> {
46-
let config = Config::from_default_file()?.unwrap_or_default();
4744
Ok(Self {
48-
client: Arc::new(Client::new_with_config(
49-
url,
50-
&config,
51-
Self::auth_token(&config, url)?,
52-
)?),
45+
client: Arc::new(Client::new_with_default_config(url)?),
5346
bar,
5447
})
5548
}
@@ -63,11 +56,7 @@ impl RegistryPackageResolver {
6356
bar: Option<Box<dyn ProgressBar>>,
6457
) -> Result<Self> {
6558
Ok(Self {
66-
client: Arc::new(Client::new_with_config(
67-
url,
68-
config,
69-
Self::auth_token(config, url)?,
70-
)?),
59+
client: Arc::new(Client::new_with_config(url, config, None)?),
7160
bar,
7261
})
7362
}
@@ -201,18 +190,4 @@ impl RegistryPackageResolver {
201190
source: e.into(),
202191
})
203192
}
204-
205-
pub fn auth_token(config: &Config, url: Option<&str>) -> Result<Option<Secret<String>>> {
206-
if config.keyring_auth {
207-
return if let Some(url) = url {
208-
Ok(get_auth_token(&RegistryUrl::new(url)?)?)
209-
} else if let Some(url) = config.home_url.as_ref() {
210-
Ok(get_auth_token(&RegistryUrl::new(url)?)?)
211-
} else {
212-
Ok(None)
213-
};
214-
}
215-
216-
Ok(None)
217-
}
218193
}

0 commit comments

Comments
 (0)