Skip to content

Commit

Permalink
fix: update rattler version
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejager committed Mar 22, 2024
1 parent eb98d02 commit 9276ce3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ pep440_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.16" }
pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.16" }
#deno_task_shell = { path = "../deno_task_shell" }

rattler = { git = "https://github.com/mamba-org/rattler", rev = "8779129977dcce25f153f0cba661359a084a97ec" }
rattler_conda_types = { git = "https://github.com/mamba-org/rattler", rev = "8779129977dcce25f153f0cba661359a084a97ec" }
rattler_digest = { git = "https://github.com/mamba-org/rattler", rev = "8779129977dcce25f153f0cba661359a084a97ec" }
rattler_lock = { git = "https://github.com/mamba-org/rattler", rev = "8779129977dcce25f153f0cba661359a084a97ec" }
rattler_networking = { git = "https://github.com/mamba-org/rattler", rev = "8779129977dcce25f153f0cba661359a084a97ec" }
rattler_repodata_gateway = { git = "https://github.com/mamba-org/rattler", rev = "8779129977dcce25f153f0cba661359a084a97ec" }
rattler_shell = { git = "https://github.com/mamba-org/rattler", rev = "8779129977dcce25f153f0cba661359a084a97ec" }
rattler_solve = { git = "https://github.com/mamba-org/rattler", rev = "8779129977dcce25f153f0cba661359a084a97ec" }
rattler_virtual_packages = { git = "https://github.com/mamba-org/rattler", rev = "8779129977dcce25f153f0cba661359a084a97ec" }
rattler = { git = "https://github.com/mamba-org/rattler", rev = "2fb7fc1f60b250985e0674b22c5d42fd31798826" }
rattler_conda_types = { git = "https://github.com/mamba-org/rattler", rev = "2fb7fc1f60b250985e0674b22c5d42fd31798826" }
rattler_digest = { git = "https://github.com/mamba-org/rattler", rev = "2fb7fc1f60b250985e0674b22c5d42fd31798826" }
rattler_lock = { git = "https://github.com/mamba-org/rattler", rev = "2fb7fc1f60b250985e0674b22c5d42fd31798826" }
rattler_networking = { git = "https://github.com/mamba-org/rattler", rev = "2fb7fc1f60b250985e0674b22c5d42fd31798826" }
rattler_repodata_gateway = { git = "https://github.com/mamba-org/rattler", rev = "2fb7fc1f60b250985e0674b22c5d42fd31798826" }
rattler_shell = { git = "https://github.com/mamba-org/rattler", rev = "2fb7fc1f60b250985e0674b22c5d42fd31798826" }
rattler_solve = { git = "https://github.com/mamba-org/rattler", rev = "2fb7fc1f60b250985e0674b22c5d42fd31798826" }
rattler_virtual_packages = { git = "https://github.com/mamba-org/rattler", rev = "2fb7fc1f60b250985e0674b22c5d42fd31798826" }

#rattler_conda_types = { path = "../rattler/crates/rattler_conda_types" }
#rattler_digest = { path = "../rattler/crates/rattler_digest" }
Expand Down
16 changes: 10 additions & 6 deletions src/utils/reqwest.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use std::{path::PathBuf, sync::Arc, time::Duration};

use rattler_networking::{
authentication_storage, mirror_middleware::Mirror, retry_policies::ExponentialBackoff,
authentication_storage::{self, backends::file::FileStorageError},
mirror_middleware::Mirror,
retry_policies::ExponentialBackoff,
AuthenticationMiddleware, AuthenticationStorage, MirrorMiddleware, OciMiddleware,
};

Expand All @@ -17,7 +19,7 @@ pub fn default_retry_policy() -> ExponentialBackoff {
ExponentialBackoff::builder().build_with_max_retries(3)
}

fn auth_middleware(config: &Config) -> AuthenticationMiddleware {
fn auth_middleware(config: &Config) -> Result<AuthenticationMiddleware, FileStorageError> {
if let Some(auth_file) = config.authentication_override_file() {
tracing::info!("Loading authentication from file: {:?}", auth_file);

Expand All @@ -27,13 +29,13 @@ fn auth_middleware(config: &Config) -> AuthenticationMiddleware {

let mut store = AuthenticationStorage::new();
store.add_backend(Arc::from(
authentication_storage::backends::file::FileStorage::new(PathBuf::from(&auth_file)),
authentication_storage::backends::file::FileStorage::new(PathBuf::from(&auth_file))?,
));

return AuthenticationMiddleware::new(store);
return Ok(AuthenticationMiddleware::new(store));
}

AuthenticationMiddleware::default()
Ok(AuthenticationMiddleware::default())
}

fn mirror_middleware(config: &Config) -> MirrorMiddleware {
Expand Down Expand Up @@ -103,7 +105,9 @@ pub(crate) fn build_reqwest_clients(config: Option<&Config>) -> (Client, ClientW
.with(oci_middleware());
}

client_builder = client_builder.with_arc(Arc::new(auth_middleware(&config)));
client_builder = client_builder.with_arc(Arc::new(
auth_middleware(&config).expect("could not create auth middleware"),
));

let authenticated_client = client_builder.build();

Expand Down

0 comments on commit 9276ce3

Please sign in to comment.