Skip to content

Commit e5b003a

Browse files
committed
Add SHA-1 algorithm option
1 parent a0afe52 commit e5b003a

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

thoth-api/migrations/20260429_v1.2.0/up.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CREATE TYPE public.checksum_algorithm AS ENUM (
22
'MD5',
3-
'SHA256'
3+
'SHA256',
4+
'SHA1'
45
);
56

67
ALTER TABLE public.location

thoth-api/src/graphql/model.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,7 @@ impl Location {
19211921
self.checksum.as_ref()
19221922
}
19231923

1924-
#[graphql(description = "Algorithm used to generate the checksum (MD5 or SHA-256)")]
1924+
#[graphql(description = "Algorithm used to generate the checksum (MD5, SHA-256 or SHA-1)")]
19251925
pub fn checksum_algorithm(&self) -> Option<&ChecksumAlgorithm> {
19261926
self.checksum_algorithm.as_ref()
19271927
}

thoth-api/src/model/file/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ pub enum ChecksumAlgorithm {
6464
Md5,
6565
#[cfg_attr(feature = "backend", db_rename = "SHA256")]
6666
Sha256,
67+
#[cfg_attr(feature = "backend", db_rename = "SHA1")]
68+
Sha1,
6769
}
6870

6971
#[cfg_attr(feature = "backend", derive(diesel::Queryable))]

0 commit comments

Comments
 (0)