Skip to content

Commit 0f75f00

Browse files
committed
publish: Adjust trustpub_only error message
1 parent 6247ede commit 0f75f00

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/controllers/krate/publish.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pub async fn publish(app: AppState, req: Parts, body: Body) -> AppResult<Json<Go
222222
&& matches!(auth, AuthType::Regular(_))
223223
{
224224
return Err(forbidden(
225-
"You tried to publish with an API token but this crate requires trusted publishing.",
225+
"New versions of this crate can only be published using Trusted Publishing (see https://crates.io/docs/trusted-publishing).",
226226
));
227227
}
228228

src/tests/krate/publish/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async fn publish_with_token_rejected_when_trustpub_only() {
101101
let crate_to_publish = PublishBuilder::new("foo_trustpub_only", "1.0.0");
102102
let response = token.publish_crate(crate_to_publish).await;
103103
assert_snapshot!(response.status(), @"403 Forbidden");
104-
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"You tried to publish with an API token but this crate requires trusted publishing."}]}"#);
104+
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"New versions of this crate can only be published using Trusted Publishing (see https://crates.io/docs/trusted-publishing)."}]}"#);
105105

106106
assert_that!(app.stored_files().await, is_empty());
107107
assert_that!(app.emails().await, is_empty());

0 commit comments

Comments
 (0)