aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/endpoint_handlers.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-13 19:17:19 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-13 19:17:19 -0700
commite63e21495c5e63f9fce3a0204f178d104c46124e (patch)
treee80e76c4a0b64dd97959e63a375d012d58e4d4df /rust/src/endpoint_handlers.rs
parent5c3156b10f05bd68530dd1fb2c502764b8397cb1 (diff)
downloadfatcat-e63e21495c5e63f9fce3a0204f178d104c46124e.tar.gz
fatcat-e63e21495c5e63f9fce3a0204f178d104c46124e.zip
rust: fill in missing extid checkers
Diffstat (limited to 'rust/src/endpoint_handlers.rs')
-rw-r--r--rust/src/endpoint_handlers.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/rust/src/endpoint_handlers.rs b/rust/src/endpoint_handlers.rs
index ab3b81ce..a19d33f9 100644
--- a/rust/src/endpoint_handlers.rs
+++ b/rust/src/endpoint_handlers.rs
@@ -301,7 +301,7 @@ impl Server {
.first(conn)?
}
(None, None, Some(isbn13), None, None, None, None, None, None, None) => {
- // TODO: check_isbn13(isbn13)?;
+ check_isbn13(isbn13)?;
let (rev, ident, _extid): (ReleaseRevRow, ReleaseIdentRow, ReleaseExtidRow) =
release_rev::table
.inner_join(release_ident::table)
@@ -332,7 +332,7 @@ impl Server {
.first(conn)?
}
(None, None, None, None, None, Some(core), None, None, None, None) => {
- // TODO: check_core_id(core)?;
+ check_core_id(core)?;
release_ident::table
.inner_join(release_rev::table)
.filter(release_rev::core_id.eq(core))
@@ -341,7 +341,9 @@ impl Server {
.first(conn)?
}
(None, None, None, None, None, None, Some(arxiv), None, None, None) => {
- // TODO: check_arxiv_id(arxiv_id)?;
+ // TODO: this allows only lookup by full, versioned arxiv identifier. Probably also
+ // want to allow lookup by "work" style identifier?
+ check_arxiv_id(arxiv)?;
let (rev, ident, _extid): (ReleaseRevRow, ReleaseIdentRow, ReleaseExtidRow) =
release_rev::table
.inner_join(release_ident::table)
@@ -354,7 +356,7 @@ impl Server {
(ident, rev)
}
(None, None, None, None, None, None, None, Some(jstor), None, None) => {
- // TODO: check_jstor_id(jstor_id)?;
+ check_jstor_id(jstor)?;
let (rev, ident, _extid): (ReleaseRevRow, ReleaseIdentRow, ReleaseExtidRow) =
release_rev::table
.inner_join(release_ident::table)
@@ -367,7 +369,7 @@ impl Server {
(ident, rev)
}
(None, None, None, None, None, None, None, None, Some(ark), None) => {
- // TODO: check_ark_id(ark_id)?;
+ check_ark_id(ark)?;
let (rev, ident, _extid): (ReleaseRevRow, ReleaseIdentRow, ReleaseExtidRow) =
release_rev::table
.inner_join(release_ident::table)
@@ -380,7 +382,7 @@ impl Server {
(ident, rev)
}
(None, None, None, None, None, None, None, None, None, Some(mag)) => {
- // TODO: check_mag_id(mag_id)?;
+ check_mag_id(mag)?;
let (rev, ident, _extid): (ReleaseRevRow, ReleaseIdentRow, ReleaseExtidRow) =
release_rev::table
.inner_join(release_ident::table)