Skip to content

Prevent undeclared public network access #15368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/cargo_add/add_toolchain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/cargo_add/dev_existing_path_base/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = project_root.join("primary");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/cargo_add/merge_activated_features/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/testsuite/cargo_add/path_base/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = project_root.join("primary");
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/cargo_add/path_base_inferred_name/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = project_root.join("primary");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = project_root.join("primary");
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/cargo_add/path_base_unstable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = project_root.join("primary");
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/cargo_add/unknown_inherited_feature/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cargo_test_support::Project;

#[cargo_test]
fn case() {
cargo_test_support::registry::init();
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
use cargo_test_support::prelude::*;
use cargo_test_support::{file, registry::RegistryBuilder};

use super::init_registry_without_token;

#[cargo_test]
fn case() {
init_registry_without_token();
let _ = RegistryBuilder::new()
.alternative()
.no_configure_token()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
use cargo_test_support::prelude::*;
use cargo_test_support::{file, registry::RegistryBuilder};

use super::init_registry_without_token;

#[cargo_test]
fn case() {
init_registry_without_token();
let _ = RegistryBuilder::new()
.alternative()
.no_configure_token()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ use cargo_test_support::prelude::*;
use cargo_test_support::{compare::assert_ui, registry::RegistryBuilder, Project};
use cargo_test_support::{current_dir, file};

use super::init_registry_without_token;

#[cargo_test]
fn case() {
init_registry_without_token();
let _ = RegistryBuilder::new()
.alternative()
.no_configure_token()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions tests/testsuite/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6065,6 +6065,7 @@ src/main.rs

#[cargo_test]
fn workspace_with_local_deps_index_mismatch() {
registry::init();
let alt_reg = registry::RegistryBuilder::new()
.http_api()
.http_index()
Expand Down Expand Up @@ -6123,12 +6124,12 @@ fn workspace_with_local_deps_index_mismatch() {
[PACKAGING] level2 v0.0.1 ([ROOT]/foo/level2)
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[PACKAGING] level1 v0.0.1 ([ROOT]/foo/level1)
[UPDATING] crates.io index
[UPDATING] `dummy-registry` index
[ERROR] failed to prepare local package for uploading

Caused by:
no matching package named `level2` found
location searched: crates.io index
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
required by package `level1 v0.0.1 ([ROOT]/foo/level1)`

"#]])
Expand Down