Skip to content
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
2 changes: 1 addition & 1 deletion app/templates/crate/delete.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import LoadingSpinner from 'crates-io/components/loading-spinner';
<li>
<ol>
<li>the crate only has a single owner, <em>and</em></li>
<li>the crate has been downloaded less than 500 times for each month it has been published.</li>
<li>the crate has been downloaded less than 1000 times for each month it has been published.</li>
</ol>
</li>
</ol>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/policies/index.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ import TextContent from 'crates-io/components/text-content';
to a malicious user could have a significant impact for any existing users of your crate.</p>

<p>Crate owners can delete their crates under certain conditions: the crate has been published for less than 72
hours, or the crate only has a single owner, the crate has been downloaded less than 500 times for each month it
hours, or the crate only has a single owner, the crate has been downloaded less than 1000 times for each month it
has been published, and the crate is not depended upon by any other crate on crates.io. If these conditions are
not met, the crate will not be deleted. In exceptional cases crate owners may contact
<a href='mailto:[email protected]'>the crates.io team</a>
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/krate/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use minijinja::context;
use serde::Deserialize;
use tracing::error;

const DOWNLOADS_PER_MONTH_LIMIT: u64 = 500;
const DOWNLOADS_PER_MONTH_LIMIT: u64 = 1000;
const AVAILABLE_AFTER: TimeDelta = TimeDelta::hours(24);

#[derive(Debug, Deserialize, FromRequestParts, utoipa::IntoParams)]
Expand All @@ -45,7 +45,7 @@ impl DeleteQueryParams {
///
/// The crate can only be deleted by the owner of the crate, and only if the
/// crate has been published for less than 72 hours, or if the crate has a
/// single owner, has been downloaded less than 500 times for each month it has
/// single owner, has been downloaded less than 1000 times for each month it has
/// been published, and is not depended upon by any other crate on crates.io.
#[utoipa::path(
delete,
Expand Down Expand Up @@ -467,7 +467,7 @@ mod tests {

let response = delete_crate(&user, "foo").await;
assert_snapshot!(response.status(), @"422 Unprocessable Entity");
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"only crates with less than 500 downloads per month can be deleted after 72 hours"}]}"#);
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"only crates with less than 1000 downloads per month can be deleted after 72 hours"}]}"#);

assert_crate_exists(&anon, "foo", true).await;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2048,7 +2048,7 @@ expression: response.json()
},
"/api/v1/crates/{name}": {
"delete": {
"description": "The crate is immediately deleted from the database, and with a small delay\nfrom the git and sparse index, and the crate file storage.\n\nThe crate can only be deleted by the owner of the crate, and only if the\ncrate has been published for less than 72 hours, or if the crate has a\nsingle owner, has been downloaded less than 500 times for each month it has\nbeen published, and is not depended upon by any other crate on crates.io.",
"description": "The crate is immediately deleted from the database, and with a small delay\nfrom the git and sparse index, and the crate file storage.\n\nThe crate can only be deleted by the owner of the crate, and only if the\ncrate has been published for less than 72 hours, or if the crate has a\nsingle owner, has been downloaded less than 1000 times for each month it has\nbeen published, and is not depended upon by any other crate on crates.io.",
"operationId": "delete_crate",
"parameters": [
{
Expand Down
Loading