From c706a553eaab28da0aa6773bb66be332d09281ec Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 15 May 2024 10:36:10 +0200 Subject: [PATCH] Remove/replace references to the "crawler policy" We only have a data access policy at https://crates.io/data-access, which has replaced the `#crawler` part of `/policies`. --- app/templates/data-access.hbs | 3 +-- src/middleware/block_traffic.rs | 8 +++----- ...ver__block_traffic_via_arbitrary_header_and_value.snap | 4 ++-- .../snapshots/all__server__block_traffic_via_ip.snap | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/templates/data-access.hbs b/app/templates/data-access.hbs index 99a208669c..e996d51f1e 100644 --- a/app/templates/data-access.hbs +++ b/app/templates/data-access.hbs @@ -65,8 +65,7 @@ the Cargo Web API. Should you be unable to use one of the previous options, you are welcome to - use the crates.io API provided you abide by the same limits as - the crawling policy. In summary: + use the crates.io API provided you abide by the following limits:

    diff --git a/src/middleware/block_traffic.rs b/src/middleware/block_traffic.rs index df450b1e9f..2a80969a5a 100644 --- a/src/middleware/block_traffic.rs +++ b/src/middleware/block_traffic.rs @@ -72,11 +72,9 @@ fn rejection_response_from(state: &AppState, headers: &HeaderMap) -> Response { let body = format!( "We are unable to process your request at this time. \ - This usually means that you are in violation of our crawler \ - policy (https://{domain_name}/policies#crawlers). \ - Please open an issue at https://github.com/rust-lang/crates.io \ - or email help@crates.io \ - and provide the request id {request_id}" + This usually means that you are in violation of our API data access \ + policy (https://{domain_name}/data-access). \ + Please email help@crates.io and provide the request id {request_id}" ); (StatusCode::FORBIDDEN, body).into_response() diff --git a/src/tests/snapshots/all__server__block_traffic_via_arbitrary_header_and_value.snap b/src/tests/snapshots/all__server__block_traffic_via_arbitrary_header_and_value.snap index afe1846504..65a24fbe14 100644 --- a/src/tests/snapshots/all__server__block_traffic_via_arbitrary_header_and_value.snap +++ b/src/tests/snapshots/all__server__block_traffic_via_arbitrary_header_and_value.snap @@ -1,11 +1,11 @@ --- source: src/tests/server.rs -expression: resp.into_json() +expression: resp.json() --- { "errors": [ { - "detail": "We are unable to process your request at this time. This usually means that you are in violation of our crawler policy (https://crates.io/policies#crawlers). Please open an issue at https://github.com/rust-lang/crates.io or email help@crates.io and provide the request id abcd" + "detail": "We are unable to process your request at this time. This usually means that you are in violation of our API data access policy (https://crates.io/data-access). Please email help@crates.io and provide the request id abcd" } ] } diff --git a/src/tests/snapshots/all__server__block_traffic_via_ip.snap b/src/tests/snapshots/all__server__block_traffic_via_ip.snap index 3c5c58e6a0..d1c160e1a6 100644 --- a/src/tests/snapshots/all__server__block_traffic_via_ip.snap +++ b/src/tests/snapshots/all__server__block_traffic_via_ip.snap @@ -1,11 +1,11 @@ --- source: src/tests/server.rs -expression: resp.into_json() +expression: resp.json() --- { "errors": [ { - "detail": "We are unable to process your request at this time. This usually means that you are in violation of our crawler policy (https://crates.io/policies#crawlers). Please open an issue at https://github.com/rust-lang/crates.io or email help@crates.io and provide the request id " + "detail": "We are unable to process your request at this time. This usually means that you are in violation of our API data access policy (https://crates.io/data-access). Please email help@crates.io and provide the request id " } ] }