From 8c8aaf520f0e6fbda5195694b6ca319b1bc656d8 Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 20 Nov 2024 13:18:31 +0800 Subject: [PATCH 01/14] feat: allow configuring insecure host --- Cargo.lock | 1 + crates/pixi_config/Cargo.toml | 1 + crates/pixi_config/src/lib.rs | 33 +++++++++++++++++++ src/install_pypi.rs | 1 + .../resolve/uv_resolution_context.rs | 4 ++- 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 3fcc33667..d1c7c21b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3350,6 +3350,7 @@ dependencies = [ "toml_edit", "tracing", "url", + "uv-configuration", ] [[package]] diff --git a/crates/pixi_config/Cargo.toml b/crates/pixi_config/Cargo.toml index 47772f06a..9303285b9 100644 --- a/crates/pixi_config/Cargo.toml +++ b/crates/pixi_config/Cargo.toml @@ -26,6 +26,7 @@ serde_json = { workspace = true } toml_edit = { workspace = true, features = ["serde"] } tracing = { workspace = true } url = { workspace = true } +uv-configuration = { workspace = true } [dev-dependencies] insta = { workspace = true, features = ["yaml"] } diff --git a/crates/pixi_config/src/lib.rs b/crates/pixi_config/src/lib.rs index be80ec53a..6f1fea3e2 100644 --- a/crates/pixi_config/src/lib.rs +++ b/crates/pixi_config/src/lib.rs @@ -19,6 +19,7 @@ use rattler_repodata_gateway::{Gateway, SourceConfig}; use reqwest_middleware::ClientWithMiddleware; use serde::{de::IntoDeserializer, Deserialize, Serialize}; use url::Url; +use uv_configuration::TrustedHost; pub fn default_channel_config() -> ChannelConfig { ChannelConfig::default_with_root_dir( @@ -241,6 +242,10 @@ pub struct PyPIConfig { #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] pub keyring_provider: Option, + /// Allow insecure connections to a host + #[serde(default)] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub allow_insecure_host: Vec, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] @@ -286,6 +291,11 @@ impl PyPIConfig { index_url: other.index_url.or(self.index_url), extra_index_urls, keyring_provider: other.keyring_provider.or(self.keyring_provider), + allow_insecure_host: self + .allow_insecure_host + .into_iter() + .chain(other.allow_insecure_host.into_iter()) + .collect(), } } @@ -1110,6 +1120,29 @@ UNUSED = "unused" ); } + #[test] + fn test_pypi_config_allow_insecure_host() { + let toml = r#" + [pypi-config] + index-url = "https://pypi.org/simple" + extra-index-urls = ["https://pypi.org/simple2"] + keyring-provider = "subprocess" + allow-insecure-host = ["https://localhost:1234", "*"] + "#; + let (config, _) = Config::from_toml(toml).unwrap(); + assert_eq!( + config.pypi_config().allow_insecure_host, + vec![ + TrustedHost::Host { + scheme: Some("https".into()), + host: "localhost".into(), + port: Some(1234), + }, + TrustedHost::Wildcard, + ] + ); + } + #[test] fn test_config_merge() { let mut config = Config::default(); diff --git a/src/install_pypi.rs b/src/install_pypi.rs index ff1c06402..c96af4cfc 100644 --- a/src/install_pypi.rs +++ b/src/install_pypi.rs @@ -643,6 +643,7 @@ pub async fn update_python_distributions( let registry_client = Arc::new( RegistryClientBuilder::new(uv_context.cache.clone()) .client(uv_context.client.clone()) + .allow_insecure_host(uv_context.allow_insecure_host.clone()) .index_urls(index_locations.index_urls()) .keyring(uv_context.keyring_provider) .connectivity(Connectivity::Online) diff --git a/src/lock_file/resolve/uv_resolution_context.rs b/src/lock_file/resolve/uv_resolution_context.rs index 593e741ff..7fbbcb152 100644 --- a/src/lock_file/resolve/uv_resolution_context.rs +++ b/src/lock_file/resolve/uv_resolution_context.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use miette::{Context, IntoDiagnostic}; use uv_cache::Cache; -use uv_configuration::{BuildOptions, Concurrency, SourceStrategy}; +use uv_configuration::{BuildOptions, Concurrency, SourceStrategy, TrustedHost}; use uv_distribution_types::IndexCapabilities; use uv_types::{HashStrategy, InFlight}; @@ -22,6 +22,7 @@ pub struct UvResolutionContext { pub concurrency: Concurrency, pub source_strategy: SourceStrategy, pub capabilities: IndexCapabilities, + pub allow_insecure_host: Vec, } impl UvResolutionContext { @@ -57,6 +58,7 @@ impl UvResolutionContext { concurrency: Concurrency::default(), source_strategy: SourceStrategy::Disabled, capabilities: IndexCapabilities::default(), + allow_insecure_host: project.config().pypi_config.allow_insecure_host.clone(), }) } } From b2957fc27e49aef5f8618ca12c58ad49fdf12582 Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 20 Nov 2024 13:52:41 +0800 Subject: [PATCH 02/14] update doc --- docs/reference/pixi_configuration.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/reference/pixi_configuration.md b/docs/reference/pixi_configuration.md index b6901b9f5..8d7d795c2 100644 --- a/docs/reference/pixi_configuration.md +++ b/docs/reference/pixi_configuration.md @@ -207,6 +207,7 @@ To setup a certain number of defaults for the usage of PyPI registries. You can - `index-url`: The default index URL to use for PyPI packages. This will be added to a manifest file on a `pixi init`. - `extra-index-urls`: A list of additional URLs to use for PyPI packages. This will be added to a manifest file on a `pixi init`. - `keyring-provider`: Allows the use of the [keyring](https://pypi.org/project/keyring/) python package to store and retrieve credentials. +- `allow-insecure-host`: Allow insecure connections to host. ```toml title="config.toml" [pypi-config] @@ -216,6 +217,8 @@ index-url = "https://pypi.org/simple" extra-index-urls = ["https://pypi.org/simple2"] # can be "subprocess" or "disabled" keyring-provider = "subprocess" +# allow insecure connections to host +allow-insecure-host = ["localhost:8080"] ``` !!! Note "`index-url` and `extra-index-urls` are *not* globals" From 26df5bf0b42d3050b9db34646c2dcc6c26ddc17d Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 20 Nov 2024 14:45:29 +0800 Subject: [PATCH 03/14] fix lint --- crates/pixi_config/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pixi_config/src/lib.rs b/crates/pixi_config/src/lib.rs index 6f1fea3e2..76695ceba 100644 --- a/crates/pixi_config/src/lib.rs +++ b/crates/pixi_config/src/lib.rs @@ -294,7 +294,7 @@ impl PyPIConfig { allow_insecure_host: self .allow_insecure_host .into_iter() - .chain(other.allow_insecure_host.into_iter()) + .chain(other.allow_insecure_host) .collect(), } } From e086c4fbe5e55c175a6fdbbbf6498754b64038f4 Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 20 Nov 2024 14:57:01 +0800 Subject: [PATCH 04/14] fix test --- .../src/snapshots/pixi_config__tests__config_merge.snap | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/pixi_config/src/snapshots/pixi_config__tests__config_merge.snap b/crates/pixi_config/src/snapshots/pixi_config__tests__config_merge.snap index 8ed30d9b7..ea4c0de53 100644 --- a/crates/pixi_config/src/snapshots/pixi_config__tests__config_merge.snap +++ b/crates/pixi_config/src/snapshots/pixi_config__tests__config_merge.snap @@ -62,6 +62,7 @@ Config { index_url: None, extra_index_urls: [], keyring_provider: None, + allow_insecure_host: [], }, detached_environments: Some( Boolean( From d073d6286ea34dc867dc3f14079c3ca7a445329a Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 27 Nov 2024 13:48:30 +0800 Subject: [PATCH 05/14] redefine TrustedHost and make a conversion method --- Cargo.lock | 2 +- crates/pixi_config/Cargo.toml | 1 - crates/pixi_config/src/lib.rs | 11 ++++++++++- crates/pixi_uv_conversions/Cargo.toml | 1 + crates/pixi_uv_conversions/src/types.rs | 15 +++++++++++++++ src/lock_file/resolve/uv_resolution_context.rs | 9 ++++++++- 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d1c7c21b5..53d85feda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3350,7 +3350,6 @@ dependencies = [ "toml_edit", "tracing", "url", - "uv-configuration", ] [[package]] @@ -3480,6 +3479,7 @@ dependencies = [ "dunce", "pep440_rs", "pep508_rs", + "pixi_config", "pixi_manifest", "rattler_lock", "serde_json", diff --git a/crates/pixi_config/Cargo.toml b/crates/pixi_config/Cargo.toml index 9303285b9..47772f06a 100644 --- a/crates/pixi_config/Cargo.toml +++ b/crates/pixi_config/Cargo.toml @@ -26,7 +26,6 @@ serde_json = { workspace = true } toml_edit = { workspace = true, features = ["serde"] } tracing = { workspace = true } url = { workspace = true } -uv-configuration = { workspace = true } [dev-dependencies] insta = { workspace = true, features = ["yaml"] } diff --git a/crates/pixi_config/src/lib.rs b/crates/pixi_config/src/lib.rs index d3720f618..2f1b24107 100644 --- a/crates/pixi_config/src/lib.rs +++ b/crates/pixi_config/src/lib.rs @@ -19,7 +19,6 @@ use rattler_repodata_gateway::{Gateway, SourceConfig}; use reqwest_middleware::ClientWithMiddleware; use serde::{de::IntoDeserializer, Deserialize, Serialize}; use url::Url; -use uv_configuration::TrustedHost; pub fn default_channel_config() -> ChannelConfig { ChannelConfig::default_with_root_dir( @@ -227,6 +226,16 @@ pub enum KeyringProvider { Subprocess, } +#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] +pub enum TrustedHost { + Wildcard, + Host { + scheme: Option, + host: String, + port: Option, + }, +} + #[derive(Clone, Debug, Deserialize, Serialize, Default)] #[serde(rename_all = "kebab-case")] pub struct PyPIConfig { diff --git a/crates/pixi_uv_conversions/Cargo.toml b/crates/pixi_uv_conversions/Cargo.toml index a93999f8c..7a5d62c1f 100644 --- a/crates/pixi_uv_conversions/Cargo.toml +++ b/crates/pixi_uv_conversions/Cargo.toml @@ -15,6 +15,7 @@ dunce = { workspace = true } pep440_rs = { workspace = true } pep508_rs = { workspace = true } pixi_manifest = { workspace = true } +pixi_config = { workspace = true } rattler_lock = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } diff --git a/crates/pixi_uv_conversions/src/types.rs b/crates/pixi_uv_conversions/src/types.rs index 15e0859c9..cf30a35de 100644 --- a/crates/pixi_uv_conversions/src/types.rs +++ b/crates/pixi_uv_conversions/src/types.rs @@ -1,6 +1,7 @@ // use uv_normalize::PackageName; // use pep508_rs::PackageName; +use pixi_config::TrustedHost; use std::error::Error; use std::{ fmt::{Debug, Display}, @@ -264,3 +265,17 @@ pub fn to_version_specifiers( .map_err(VersionSpecifiersError::PepVersionError)?, ) } + +/// Converts `TrustedHost` to `uv_configuration::TrustedHost` +pub fn to_uv_trusted_host( + trusted_host: &TrustedHost, +) -> Result { + match trusted_host { + TrustedHost::Wildcard => Ok(uv_configuration::TrustedHost::Wildcard), + TrustedHost::Host { scheme, host, port } => Ok(uv_configuration::TrustedHost::Host { + scheme: scheme.clone(), + host: host.to_string(), + port: port.clone(), + }), + } +} diff --git a/src/lock_file/resolve/uv_resolution_context.rs b/src/lock_file/resolve/uv_resolution_context.rs index 7fbbcb152..776155982 100644 --- a/src/lock_file/resolve/uv_resolution_context.rs +++ b/src/lock_file/resolve/uv_resolution_context.rs @@ -9,6 +9,7 @@ use uv_types::{HashStrategy, InFlight}; use crate::Project; use pixi_config::{self, get_cache_dir}; use pixi_consts::consts; +use pixi_uv_conversions::to_uv_trusted_host; /// Objects that are needed for resolutions which can be shared between different resolutions. #[derive(Clone)] @@ -58,7 +59,13 @@ impl UvResolutionContext { concurrency: Concurrency::default(), source_strategy: SourceStrategy::Disabled, capabilities: IndexCapabilities::default(), - allow_insecure_host: project.config().pypi_config.allow_insecure_host.clone(), + allow_insecure_host: project + .config() + .pypi_config + .allow_insecure_host + .iter() + .map(|host| to_uv_trusted_host(host).unwrap()) + .collect(), }) } } From d55a12c883316788335e5b5cbcf1d19c3ec25d9b Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 27 Nov 2024 13:52:40 +0800 Subject: [PATCH 06/14] fix pre-commit toml lint --- crates/pixi_uv_conversions/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pixi_uv_conversions/Cargo.toml b/crates/pixi_uv_conversions/Cargo.toml index 7a5d62c1f..aa5d48322 100644 --- a/crates/pixi_uv_conversions/Cargo.toml +++ b/crates/pixi_uv_conversions/Cargo.toml @@ -14,8 +14,8 @@ version = "0.1.0" dunce = { workspace = true } pep440_rs = { workspace = true } pep508_rs = { workspace = true } -pixi_manifest = { workspace = true } pixi_config = { workspace = true } +pixi_manifest = { workspace = true } rattler_lock = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } From 07afa444989c99019de6407fc554f30d10d1d01d Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 27 Nov 2024 13:58:41 +0800 Subject: [PATCH 07/14] fix clippy lint --- crates/pixi_uv_conversions/src/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pixi_uv_conversions/src/types.rs b/crates/pixi_uv_conversions/src/types.rs index cf30a35de..d010b0f81 100644 --- a/crates/pixi_uv_conversions/src/types.rs +++ b/crates/pixi_uv_conversions/src/types.rs @@ -275,7 +275,7 @@ pub fn to_uv_trusted_host( TrustedHost::Host { scheme, host, port } => Ok(uv_configuration::TrustedHost::Host { scheme: scheme.clone(), host: host.to_string(), - port: port.clone(), + port: *port, }), } } From 483ac5850fc8b03e34a9d53f6654995df1f09ec2 Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 27 Nov 2024 14:40:14 +0800 Subject: [PATCH 08/14] just parse from string --- Cargo.lock | 1 - crates/pixi_config/src/lib.rs | 12 +-------- crates/pixi_uv_conversions/Cargo.toml | 1 - crates/pixi_uv_conversions/src/types.rs | 15 ++++------- .../resolve/uv_resolution_context.rs | 25 +++++++++++++------ 5 files changed, 23 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e123625f3..5738fd4b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3479,7 +3479,6 @@ dependencies = [ "dunce", "pep440_rs", "pep508_rs", - "pixi_config", "pixi_manifest", "rattler_lock", "serde_json", diff --git a/crates/pixi_config/src/lib.rs b/crates/pixi_config/src/lib.rs index 523e099b4..289b67953 100644 --- a/crates/pixi_config/src/lib.rs +++ b/crates/pixi_config/src/lib.rs @@ -259,16 +259,6 @@ pub enum KeyringProvider { Subprocess, } -#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] -pub enum TrustedHost { - Wildcard, - Host { - scheme: Option, - host: String, - port: Option, - }, -} - #[derive(Clone, Debug, Deserialize, Serialize, Default)] #[serde(rename_all = "kebab-case")] pub struct PyPIConfig { @@ -287,7 +277,7 @@ pub struct PyPIConfig { /// Allow insecure connections to a host #[serde(default)] #[serde(skip_serializing_if = "Vec::is_empty")] - pub allow_insecure_host: Vec, + pub allow_insecure_host: Vec, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] diff --git a/crates/pixi_uv_conversions/Cargo.toml b/crates/pixi_uv_conversions/Cargo.toml index aa5d48322..a93999f8c 100644 --- a/crates/pixi_uv_conversions/Cargo.toml +++ b/crates/pixi_uv_conversions/Cargo.toml @@ -14,7 +14,6 @@ version = "0.1.0" dunce = { workspace = true } pep440_rs = { workspace = true } pep508_rs = { workspace = true } -pixi_config = { workspace = true } pixi_manifest = { workspace = true } rattler_lock = { workspace = true } serde_json = { workspace = true } diff --git a/crates/pixi_uv_conversions/src/types.rs b/crates/pixi_uv_conversions/src/types.rs index d010b0f81..6cf0fa4cb 100644 --- a/crates/pixi_uv_conversions/src/types.rs +++ b/crates/pixi_uv_conversions/src/types.rs @@ -1,7 +1,6 @@ // use uv_normalize::PackageName; // use pep508_rs::PackageName; -use pixi_config::TrustedHost; use std::error::Error; use std::{ fmt::{Debug, Display}, @@ -141,6 +140,9 @@ pub enum ConversionError { #[error(transparent)] InvalidVersion(#[from] VersionError), + + #[error(transparent)] + TrustedHostError(#[from] uv_configuration::TrustedHostError), } pub fn to_requirements<'req>( @@ -268,14 +270,7 @@ pub fn to_version_specifiers( /// Converts `TrustedHost` to `uv_configuration::TrustedHost` pub fn to_uv_trusted_host( - trusted_host: &TrustedHost, + trusted_host: &str, ) -> Result { - match trusted_host { - TrustedHost::Wildcard => Ok(uv_configuration::TrustedHost::Wildcard), - TrustedHost::Host { scheme, host, port } => Ok(uv_configuration::TrustedHost::Host { - scheme: scheme.clone(), - host: host.to_string(), - port: *port, - }), - } + Ok(uv_configuration::TrustedHost::from_str(&trusted_host)?) } diff --git a/src/lock_file/resolve/uv_resolution_context.rs b/src/lock_file/resolve/uv_resolution_context.rs index 776155982..0b0d8c59f 100644 --- a/src/lock_file/resolve/uv_resolution_context.rs +++ b/src/lock_file/resolve/uv_resolution_context.rs @@ -9,7 +9,7 @@ use uv_types::{HashStrategy, InFlight}; use crate::Project; use pixi_config::{self, get_cache_dir}; use pixi_consts::consts; -use pixi_uv_conversions::to_uv_trusted_host; +use pixi_uv_conversions::{to_uv_trusted_host, ConversionError}; /// Objects that are needed for resolutions which can be shared between different resolutions. #[derive(Clone)] @@ -49,6 +49,21 @@ impl UvResolutionContext { }; let in_flight = Arc::new(InFlight::default()); + let allow_insecure_host = project + .config() + .pypi_config + .allow_insecure_host + .iter() + .try_fold( + Vec::new(), + |mut hosts, host| -> Result, ConversionError> { + let parsed = to_uv_trusted_host(host)?; + hosts.push(parsed); + Ok(hosts) + }, + ) + .into_diagnostic() + .context("failed to parse trusted host")?; Ok(Self { cache, in_flight, @@ -59,13 +74,7 @@ impl UvResolutionContext { concurrency: Concurrency::default(), source_strategy: SourceStrategy::Disabled, capabilities: IndexCapabilities::default(), - allow_insecure_host: project - .config() - .pypi_config - .allow_insecure_host - .iter() - .map(|host| to_uv_trusted_host(host).unwrap()) - .collect(), + allow_insecure_host, }) } } From f889cfb9921bbbb129ca05a86c53263ed5755ef4 Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 27 Nov 2024 14:43:08 +0800 Subject: [PATCH 09/14] fix test --- crates/pixi_config/src/lib.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/crates/pixi_config/src/lib.rs b/crates/pixi_config/src/lib.rs index 289b67953..a081eb348 100644 --- a/crates/pixi_config/src/lib.rs +++ b/crates/pixi_config/src/lib.rs @@ -1241,14 +1241,7 @@ UNUSED = "unused" let (config, _) = Config::from_toml(toml).unwrap(); assert_eq!( config.pypi_config().allow_insecure_host, - vec![ - TrustedHost::Host { - scheme: Some("https".into()), - host: "localhost".into(), - port: Some(1234), - }, - TrustedHost::Wildcard, - ] + vec!["https://localhost:1234", "*",] ); } From 4a77dfc21300cb10f36aa7399d1c53a37610a6cd Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 27 Nov 2024 14:45:12 +0800 Subject: [PATCH 10/14] fix comment --- crates/pixi_uv_conversions/src/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pixi_uv_conversions/src/types.rs b/crates/pixi_uv_conversions/src/types.rs index 6cf0fa4cb..f72bcf7dd 100644 --- a/crates/pixi_uv_conversions/src/types.rs +++ b/crates/pixi_uv_conversions/src/types.rs @@ -268,7 +268,7 @@ pub fn to_version_specifiers( ) } -/// Converts `TrustedHost` to `uv_configuration::TrustedHost` +/// Converts trusted_host `string` to `uv_configuration::TrustedHost` pub fn to_uv_trusted_host( trusted_host: &str, ) -> Result { From 19c92c28e1b0fef7d311cd6facf896a35eac9a3d Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 27 Nov 2024 14:47:01 +0800 Subject: [PATCH 11/14] fix clippy --- crates/pixi_uv_conversions/src/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pixi_uv_conversions/src/types.rs b/crates/pixi_uv_conversions/src/types.rs index f72bcf7dd..26c6bd8e2 100644 --- a/crates/pixi_uv_conversions/src/types.rs +++ b/crates/pixi_uv_conversions/src/types.rs @@ -272,5 +272,5 @@ pub fn to_version_specifiers( pub fn to_uv_trusted_host( trusted_host: &str, ) -> Result { - Ok(uv_configuration::TrustedHost::from_str(&trusted_host)?) + Ok(uv_configuration::TrustedHost::from_str(trusted_host)?) } From 403af7260941af5f24148f9e02b13cd559eb3e3f Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Fri, 29 Nov 2024 10:40:28 +0800 Subject: [PATCH 12/14] fix --- crates/pixi_config/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/pixi_config/src/lib.rs b/crates/pixi_config/src/lib.rs index ce4da41b4..28ff4a9a5 100644 --- a/crates/pixi_config/src/lib.rs +++ b/crates/pixi_config/src/lib.rs @@ -1367,6 +1367,7 @@ UNUSED = "unused" config.pypi_config().allow_insecure_host, vec!["https://localhost:1234", "*",] ); + } fn test_default_config() { let config = Config::default(); From 8f4daeb0a8fb37f462aab7b5d8d3ab76ab84542b Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Fri, 29 Nov 2024 10:42:29 +0800 Subject: [PATCH 13/14] fix test --- crates/pixi_config/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/pixi_config/src/lib.rs b/crates/pixi_config/src/lib.rs index 28ff4a9a5..906be7a71 100644 --- a/crates/pixi_config/src/lib.rs +++ b/crates/pixi_config/src/lib.rs @@ -1369,6 +1369,7 @@ UNUSED = "unused" ); } + #[test] fn test_default_config() { let config = Config::default(); // This depends on the system so it's hard to test. From 64f05cb4ed142876729ef9db191402ca641916da Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Mon, 2 Dec 2024 08:58:43 +0100 Subject: [PATCH 14/14] fix: docs snippet conflict --- docs/reference/pixi_configuration.md | 9 --------- docs/source_files/pixi_config_tomls/main_config.toml | 2 ++ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/docs/reference/pixi_configuration.md b/docs/reference/pixi_configuration.md index 015b1c998..82ac16716 100644 --- a/docs/reference/pixi_configuration.md +++ b/docs/reference/pixi_configuration.md @@ -188,15 +188,6 @@ To setup a certain number of defaults for the usage of PyPI registries. You can - `allow-insecure-host`: Allow insecure connections to host. ```toml title="config.toml" -[pypi-config] -# Main index url -index-url = "https://pypi.org/simple" -# list of additional urls -extra-index-urls = ["https://pypi.org/simple2"] -# can be "subprocess" or "disabled" -keyring-provider = "subprocess" -# allow insecure connections to host -allow-insecure-host = ["localhost:8080"] --8<-- "docs/source_files/pixi_config_tomls/main_config.toml:pypi-config" ``` diff --git a/docs/source_files/pixi_config_tomls/main_config.toml b/docs/source_files/pixi_config_tomls/main_config.toml index ed30e677c..d1bac8af4 100644 --- a/docs/source_files/pixi_config_tomls/main_config.toml +++ b/docs/source_files/pixi_config_tomls/main_config.toml @@ -46,6 +46,8 @@ index-url = "https://pypi.org/simple" extra-index-urls = ["https://pypi.org/simple2"] # can be "subprocess" or "disabled" keyring-provider = "subprocess" +# allow insecure connections to host +allow-insecure-host = ["localhost:8080"] # --8<-- [end:pypi-config] # --8<-- [start:concurrency]