Skip to content

Commit 8e74213

Browse files
authored
Bump crates to current latest release (#170)
Arrow Schema now derives serde and removes explicit to_json method. This broke api at few places which are fixed by directly depending on arrow_schema crate with serde feature enabled, calls to_json is replaced by to_string method from serde_json according to usage. actix_web_httpauth crate requires a different function signature for validator which is fixed as well.
1 parent 3b2fa3c commit 8e74213

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

server/Cargo.toml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
[package]
22
name = "parseable"
33
version = "0.0.5"
4-
authors = [
5-
"Parseable Team <[email protected]>",
6-
]
4+
authors = ["Parseable Team <[email protected]>"]
75
edition = "2021"
86
categories = ["olap", "logging", "analytics-store"]
97

108
[dependencies]
11-
actix-web-httpauth = "0.6"
9+
actix-web-httpauth = "0.8"
1210
actix-web = { version = "4.1", features = ["rustls"] }
1311
actix-cors = "0.6"
1412
actix-files = "0.6.1"
1513
anyhow = { version = "1.0.43", features = ["backtrace"] }
14+
arrow-schema = { version = "24.0.0", features = ["serde"] }
1615
async-trait = "0.1"
1716
aws-sdk-s3 = "0.19"
1817
aws-smithy-async = { version = "0.49.0", features = ["rt-tokio"] }
1918
bytes = "1"
2019
chrono = "0.4.19"
2120
chrono-humanize = "0.2.2"
2221
clap = { version = "4.0.8", features = ["derive", "env"] }
23-
crossterm = "0.23.2"
24-
datafusion = "11.0"
25-
object_store = { version = "0.4", features=["aws"] }
22+
crossterm = "0.25"
23+
datafusion = "13.0"
24+
object_store = { version = "0.5.1", features = ["aws"] }
2625
derive_more = "0.99.17"
2726
env_logger = "0.9.0"
2827
futures = "0.3"
@@ -41,11 +40,14 @@ semver = "1.0.14"
4140
serde = "^1.0.8"
4241
serde_derive = "^1.0.8"
4342
serde_json = "^1.0.8"
44-
sysinfo = "0.20.5"
43+
sysinfo = "0.26.4"
4544
thiserror = "1"
4645
thread-priority = "0.9.2"
4746
tokio-stream = "0.1.8"
48-
tokio = { version = "1.13.1", default-features = false, features=["sync", "macros"] }
47+
tokio = { version = "1.13.1", default-features = false, features = [
48+
"sync",
49+
"macros",
50+
] }
4951
clokwerk = "0.4.0-rc1"
5052
actix-web-static-files = "4.0"
5153
static-files = "0.2.1"
@@ -54,9 +56,9 @@ ureq = { version = "2.5.0", features = ["json"] }
5456

5557
[build-dependencies]
5658
static-files = "0.2.1"
57-
cargo_toml = "0.11.5"
59+
cargo_toml = "0.12.4"
5860
ureq = "2.5.0"
59-
sha1_smol = { version = "1.0.0", features=["std"] }
61+
sha1_smol = { version = "1.0.0", features = ["std"] }
6062
vergen = { version = "7.4.2", features = ["build", "git"] }
6163
zip = { git = "https://github.com/zip-rs/zip" }
6264

server/src/handlers/logstream.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ pub async fn schema(req: HttpRequest) -> HttpResponse {
9494
match metadata::STREAM_INFO.schema(&stream_name) {
9595
Ok(schema) => response::ServerResponse {
9696
msg: schema
97-
.map(|schema| schema.to_json().to_string())
97+
.map(|ref schema| {
98+
serde_json::to_string(schema).expect("schema can be converted to json")
99+
})
98100
.unwrap_or_default(),
99101
code: StatusCode::OK,
100102
}
@@ -106,8 +108,8 @@ pub async fn schema(req: HttpRequest) -> HttpResponse {
106108
code: StatusCode::BAD_REQUEST,
107109
}
108110
.to_http(),
109-
Ok(Some(schema)) => response::ServerResponse {
110-
msg: serde_json::from_value(schema.to_json()).unwrap(),
111+
Ok(Some(ref schema)) => response::ServerResponse {
112+
msg: serde_json::to_string(schema).unwrap(),
111113
code: StatusCode::OK,
112114
}
113115
.to_http(),

server/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,14 @@ fn run_local_sync() -> (JoinHandle<()>, oneshot::Receiver<()>, oneshot::Sender<(
248248
async fn validator(
249249
req: ServiceRequest,
250250
credentials: BasicAuth,
251-
) -> Result<ServiceRequest, actix_web::Error> {
251+
) -> Result<ServiceRequest, (actix_web::Error, ServiceRequest)> {
252252
if credentials.user_id().trim() == CONFIG.parseable.username
253253
&& credentials.password().unwrap().trim() == CONFIG.parseable.password
254254
{
255255
return Ok(req);
256256
}
257257

258-
Err(actix_web::error::ErrorUnauthorized("Unauthorized"))
258+
Err((actix_web::error::ErrorUnauthorized("Unauthorized"), req))
259259
}
260260

261261
async fn run_http() -> anyhow::Result<()> {

0 commit comments

Comments
 (0)