summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/tests/testsuite/registry_auth.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /src/tools/cargo/tests/testsuite/registry_auth.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/cargo/tests/testsuite/registry_auth.rs')
-rw-r--r--src/tools/cargo/tests/testsuite/registry_auth.rs23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/tools/cargo/tests/testsuite/registry_auth.rs b/src/tools/cargo/tests/testsuite/registry_auth.rs
index 4422c638a..df2bdf565 100644
--- a/src/tools/cargo/tests/testsuite/registry_auth.rs
+++ b/src/tools/cargo/tests/testsuite/registry_auth.rs
@@ -6,9 +6,12 @@ use cargo_test_support::{project, Execs, Project};
fn cargo(p: &Project, s: &str) -> Execs {
let mut e = p.cargo(s);
- e.masquerade_as_nightly_cargo(&["registry-auth", "credential-process"])
- .arg("-Zregistry-auth")
- .arg("-Zcredential-process");
+ e.masquerade_as_nightly_cargo(&["asymmetric-token"])
+ .arg("-Zasymmetric-token");
+ e.env(
+ "CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS",
+ "cargo:paseto cargo:token",
+ );
e
}
@@ -43,7 +46,7 @@ static SUCCESS_OUTPUT: &'static str = "\
";
#[cargo_test]
-fn requires_nightly() {
+fn requires_credential_provider() {
let _registry = RegistryBuilder::new()
.alternative()
.auth_required()
@@ -55,14 +58,14 @@ fn requires_nightly() {
.with_status(101)
.with_stderr(
r#"[UPDATING] `alternative` index
-[DOWNLOADING] crates ...
-error: failed to download from `[..]/dl/bar/0.0.1/download`
+error: failed to download `bar v0.0.1 (registry `alternative`)`
Caused by:
- failed to get successful HTTP response from `[..]` (127.0.0.1), got 401
- body:
- Unauthorized message from server.
-"#,
+ unable to get packages from source
+
+Caused by:
+ authenticated registries require a credential-provider to be configured
+ see https://doc.rust-lang.org/cargo/reference/registry-authentication.html for details"#,
)
.run();
}