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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ diesel_migrations = { version = "=2.3.0", features = ["postgres"] }
dotenvy = "=0.15.7"
flate2 = "=1.1.4"
futures-util = "=0.3.31"
generic-array = "=0.14.7" # see https://github.com/RustCrypto/traits/issues/2036
generic-array = "=0.14.9" # see https://github.com/RustCrypto/traits/issues/2036
hex = "=0.4.3"
http = "=1.3.1"
hyper = { version = "=1.7.0", features = ["client", "http1"] }
Expand Down
2 changes: 2 additions & 0 deletions crates/crates_io_database/src/utils/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ impl HashedToken {
}

pub fn hash(plaintext: &str) -> Vec<u8> {
#[expect(deprecated)]
Sha256::digest(plaintext.as_bytes()).as_slice().to_vec()
}
}
Expand Down Expand Up @@ -98,6 +99,7 @@ mod tests {
use googletest::prelude::*;

#[test]
#[expect(deprecated)]
fn test_generated_and_parse() {
let token = PlainToken::generate();
assert_that!(token.expose_secret(), starts_with(TOKEN_PREFIX));
Expand Down
1 change: 1 addition & 0 deletions crates/crates_io_trustpub/src/access_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ mod tests {
}

#[test]
#[expect(deprecated)]
fn test_sha256() {
let token = AccessToken(SecretString::from(EXAMPLE_TOKEN));
let hash = token.sha256();
Expand Down
1 change: 1 addition & 0 deletions src/controllers/github/secret_scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ async fn alert_revoke_token(
let hashed_token = token.sha256();

// Delete the token and return crate_ids for notifications
#[expect(deprecated)]
let crate_ids = diesel::delete(trustpub_tokens::table)
.filter(trustpub_tokens::hashed_token.eq(hashed_token.as_slice()))
.returning(trustpub_tokens::crate_ids)
Expand Down
1 change: 1 addition & 0 deletions src/controllers/krate/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ pub async fn publish(app: AppState, req: Parts, body: Body) -> AppResult<Json<Go

let hashed_token = trustpub_token.sha256();

#[expect(deprecated)]
let (crate_ids, trustpub_data): (Vec<Option<i32>>, Option<TrustpubData>) =
trustpub_tokens::table
.filter(trustpub_tokens::hashed_token.eq(hashed_token.as_slice()))
Expand Down
1 change: 1 addition & 0 deletions src/controllers/trustpub/tokens/exchange/github_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ async fn test_happy_path() -> anyhow::Result<()> {

let mut conn = client.app().db_conn().await;

#[expect(deprecated)]
let tokens = trustpub_tokens::table
.filter(trustpub_tokens::hashed_token.eq(hashed_token.as_slice()))
.select((trustpub_tokens::id, trustpub_tokens::crate_ids))
Expand Down
1 change: 1 addition & 0 deletions src/controllers/trustpub/tokens/exchange/gitlab_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ async fn test_happy_path() -> anyhow::Result<()> {

let mut conn = client.app().db_conn().await;

#[expect(deprecated)]
let tokens = trustpub_tokens::table
.filter(trustpub_tokens::hashed_token.eq(hashed_token.as_slice()))
.select((trustpub_tokens::id, trustpub_tokens::crate_ids))
Expand Down
1 change: 1 addition & 0 deletions src/controllers/trustpub/tokens/revoke/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub async fn revoke_trustpub_token(app: AppState, auth: AuthHeader) -> AppResult

let mut conn = app.db_write().await?;

#[expect(deprecated)]
diesel::delete(trustpub_tokens::table)
.filter(trustpub_tokens::hashed_token.eq(hashed_token.as_slice()))
.execute(&mut conn)
Expand Down
1 change: 1 addition & 0 deletions src/controllers/trustpub/tokens/revoke/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fn generate_token() -> (String, Output<Sha256>) {
(token.finalize().expose_secret().to_string(), token.sha256())
}

#[expect(deprecated)]
async fn new_token(conn: &mut AsyncPgConnection, crate_id: i32) -> QueryResult<String> {
let (token, hashed_token) = generate_token();

Expand Down
1 change: 1 addition & 0 deletions src/tests/krate/publish/trustpub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ fn generate_token() -> (String, Output<Sha256>) {
(token.finalize().expose_secret().to_string(), token.sha256())
}

#[expect(deprecated)]
async fn new_token(conn: &mut AsyncPgConnection, crate_id: i32) -> QueryResult<String> {
let (token, hashed_token) = generate_token();

Expand Down
2 changes: 2 additions & 0 deletions src/util/gh_token_encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub struct GitHubTokenEncryption {
cipher: Aes256Gcm,
}

#[expect(deprecated)]
impl GitHubTokenEncryption {
/// Creates a new [GitHubTokenEncryption] instance with the provided cipher
pub fn new(cipher: Aes256Gcm) -> Self {
Expand Down Expand Up @@ -91,6 +92,7 @@ impl GitHubTokenEncryption {
}

#[cfg(test)]
#[expect(deprecated)]
mod tests {
use super::*;
use aes_gcm::{Key, KeyInit};
Expand Down