Skip to content

Commit 2e49621

Browse files
committed
Merge branch 'release/v0.13.4'
2 parents fe27e58 + d6da329 commit 2e49621

16 files changed

Lines changed: 176 additions & 81 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
10+
## [[0.13.4]](https://github.com/thoth-pub/thoth/releases/tag/v0.13.4) - 2024-12-11
11+
### Added
12+
- [661](https://github.com/thoth-pub/thoth/pull/661) - Implement caching errors in export API
13+
914
## [[0.13.3]](https://github.com/thoth-pub/thoth/releases/tag/v0.13.3) - 2024-12-02
1015
### Changed
1116
- [660](https://github.com/thoth-pub/thoth/pull/660) - Upgrade rust to `1.83.0` in production `Dockerfile`

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth"
3-
version = "0.13.3"
3+
version = "0.13.4"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -15,11 +15,11 @@ maintenance = { status = "actively-developed" }
1515
members = ["thoth-api", "thoth-api-server", "thoth-app", "thoth-app-server", "thoth-client", "thoth-errors", "thoth-export-server"]
1616

1717
[dependencies]
18-
thoth-api = { version = "=0.13.3", path = "thoth-api", features = ["backend"] }
19-
thoth-api-server = { version = "=0.13.3", path = "thoth-api-server" }
20-
thoth-app-server = { version = "=0.13.3", path = "thoth-app-server" }
21-
thoth-errors = { version = "=0.13.3", path = "thoth-errors" }
22-
thoth-export-server = { version = "=0.13.3", path = "thoth-export-server" }
18+
thoth-api = { version = "=0.13.4", path = "thoth-api", features = ["backend"] }
19+
thoth-api-server = { version = "=0.13.4", path = "thoth-api-server" }
20+
thoth-app-server = { version = "=0.13.4", path = "thoth-app-server" }
21+
thoth-errors = { version = "=0.13.4", path = "thoth-errors" }
22+
thoth-export-server = { version = "=0.13.4", path = "thoth-export-server" }
2323
clap = { version = "4.5.21", features = ["cargo", "env"] }
2424
dialoguer = { version = "0.11.0", features = ["password"] }
2525
dotenv = "0.15.0"

thoth-api-server/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api-server"
3-
version = "0.13.3"
3+
version = "0.13.4"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -9,8 +9,8 @@ repository = "https://github.com/thoth-pub/thoth"
99
readme = "README.md"
1010

1111
[dependencies]
12-
thoth-api = { version = "=0.13.3", path = "../thoth-api", features = ["backend"] }
13-
thoth-errors = { version = "=0.13.3", path = "../thoth-errors" }
12+
thoth-api = { version = "=0.13.4", path = "../thoth-api", features = ["backend"] }
13+
thoth-errors = { version = "=0.13.4", path = "../thoth-errors" }
1414
actix-web = "4.9"
1515
actix-cors = "0.7.0"
1616
actix-http = "3.9.0"

thoth-api/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api"
3-
version = "0.13.3"
3+
version = "0.13.4"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -15,7 +15,7 @@ maintenance = { status = "actively-developed" }
1515
backend = ["diesel", "diesel-derive-enum", "diesel_migrations", "futures", "actix-web", "jsonwebtoken", "deadpool-redis"]
1616

1717
[dependencies]
18-
thoth-errors = { version = "=0.13.3", path = "../thoth-errors" }
18+
thoth-errors = { version = "=0.13.4", path = "../thoth-errors" }
1919
actix-web = { version = "4.9", optional = true }
2020
argon2rs = "0.2.5"
2121
isbn2 = "0.4.0"

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

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,13 @@ pub struct NewSubjectHistory {
123123
}
124124

125125
pub fn check_subject(subject_type: &SubjectType, code: &str) -> ThothResult<()> {
126-
let valid = match &subject_type {
127-
SubjectType::Bic => true,
128-
SubjectType::Bisac => true,
129-
SubjectType::Thema => THEMA_CODES.contains_key::<str>(code),
130-
SubjectType::Lcc => true,
131-
SubjectType::Custom => true,
132-
SubjectType::Keyword => true,
133-
};
134-
if valid {
135-
Ok(())
136-
} else {
137-
Err(ThothError::InvalidSubjectCode(
138-
code.to_string(),
139-
subject_type.to_string(),
140-
))
126+
if matches!(subject_type, SubjectType::Thema) && !THEMA_CODES.contains_key(code) {
127+
return Err(ThothError::InvalidSubjectCode {
128+
input: code.to_string(),
129+
subject_type: subject_type.to_string(),
130+
});
141131
}
132+
Ok(())
142133
}
143134

144135
impl Default for Subject {

thoth-api/src/redis.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ pub async fn get(pool: &RedisPool, key: &str) -> ThothResult<String> {
2626
con.get(key).await.map_err(Into::into)
2727
}
2828

29+
pub async fn del(pool: &RedisPool, key: &str) -> ThothResult<String> {
30+
let mut con = create_connection(pool).await?;
31+
con.del(key).await.map_err(Into::into)
32+
}
33+
2934
#[cfg(test)]
3035
mod tests {
3136
use super::*;

thoth-app-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-app-server"
3-
version = "0.13.3"
3+
version = "0.13.4"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"

thoth-app/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-app"
3-
version = "0.13.3"
3+
version = "0.13.4"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -29,8 +29,8 @@ semver = "1.0.23"
2929
serde = { version = "1.0", features = ["derive"] }
3030
serde_json = "1.0"
3131
uuid = { version = "1.11.0", features = ["serde", "v4", "js"] }
32-
thoth-api = { version = "=0.13.3", path = "../thoth-api" }
33-
thoth-errors = { version = "=0.13.3", path = "../thoth-errors" }
32+
thoth-api = { version = "=0.13.4", path = "../thoth-api" }
33+
thoth-errors = { version = "=0.13.4", path = "../thoth-errors" }
3434

3535
[build-dependencies]
3636
dotenv = "0.15.0"

thoth-client/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-client"
3-
version = "0.13.3"
3+
version = "0.13.4"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -10,8 +10,8 @@ readme = "README.md"
1010
build = "build.rs"
1111

1212
[dependencies]
13-
thoth-api = {version = "=0.13.3", path = "../thoth-api" }
14-
thoth-errors = {version = "=0.13.3", path = "../thoth-errors" }
13+
thoth-api = {version = "=0.13.4", path = "../thoth-api" }
14+
thoth-errors = {version = "=0.13.4", path = "../thoth-errors" }
1515
graphql_client = "0.14.0"
1616
chrono = { version = "0.4.38", features = ["serde"] }
1717
reqwest = { version = "0.12", features = ["json"] }
@@ -22,4 +22,4 @@ serde_json = "1.0"
2222
uuid = { version = "1.11.0", features = ["serde"] }
2323

2424
[build-dependencies]
25-
thoth-api = { version = "=0.13.3", path = "../thoth-api", features = ["backend"] }
25+
thoth-api = { version = "=0.13.4", path = "../thoth-api", features = ["backend"] }

0 commit comments

Comments
 (0)