Skip to content

Commit 31a3ad9

Browse files
fix multiple versions of rustls (#1513)
Fixes: #1509
1 parent dbb3cb3 commit 31a3ad9

33 files changed

+140
-418
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ parquet = "57.1.0"
3131
# Web server and HTTP-related
3232
actix-cors = "0.7.0"
3333
actix-web-lab = "0.24.3"
34-
actix-web = { version = "4.9.0", features = ["rustls-0_22"] }
34+
actix-web = { version = "4.9.0", features = ["rustls-0_23"] }
3535
actix-web-httpauth = "0.8"
3636
actix-web-prometheus = { version = "0.1", default-features = false }
3737
actix-web-static-files = "4.0"
38-
http = "0.2.7"
38+
http = "1.0"
3939
http-auth-basic = "0.3.3"
4040
tonic = { version = "0.14.1", features = [
4141
"tls-aws-lc",
@@ -63,7 +63,7 @@ base64 = "0.22.0"
6363
cookie = "0.18.1"
6464
hex = "0.4"
6565
openid = { version = "0.18.3", default-features = false, features = ["rustls"] }
66-
rustls = "0.22.4"
66+
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
6767
rustls-pemfile = "2.1.2"
6868
sha2 = "0.10.8"
6969

@@ -147,13 +147,13 @@ once_cell = "1.20"
147147
rayon = "1.8"
148148
rand = "0.8.5"
149149
regex = "1.12.2"
150-
reqwest = { version = "0.11.27", default-features = false, features = [
150+
reqwest = { version = "0.12", default-features = false, features = [
151151
"rustls-tls",
152152
"json",
153153
"gzip",
154154
"brotli",
155155
"stream",
156-
] } # cannot update cause rustls is not latest `see rustls`
156+
] }
157157
semver = "1.0"
158158
static-files = "0.2"
159159
thiserror = "2.0"

src/alerts/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*
1717
*/
1818

19+
use actix_web::http::StatusCode;
1920
use actix_web::http::header::ContentType;
2021
use arrow_schema::{ArrowError, DataType, Schema};
2122
use async_trait::async_trait;
@@ -24,7 +25,6 @@ use datafusion::logical_expr::{LogicalPlan, Projection};
2425
use datafusion::prelude::Expr;
2526
use datafusion::sql::sqlparser::parser::ParserError;
2627
use derive_more::FromStrError;
27-
use http::StatusCode;
2828
use serde_json::{Error as SerdeError, Value as JsonValue};
2929
use std::collections::HashMap;
3030
use std::fmt::Debug;

src/correlation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
use std::collections::{HashMap, HashSet};
2020

21+
use actix_web::http::StatusCode;
2122
use actix_web::{Error, http::header::ContentType};
2223
use chrono::Utc;
2324
use datafusion::error::DataFusionError;
24-
use http::StatusCode;
2525
use itertools::Itertools;
2626
use once_cell::sync::Lazy;
2727
use relative_path::RelativePathBuf;
@@ -335,7 +335,7 @@ pub enum CorrelationError {
335335
}
336336

337337
impl actix_web::ResponseError for CorrelationError {
338-
fn status_code(&self) -> http::StatusCode {
338+
fn status_code(&self) -> StatusCode {
339339
match self {
340340
Self::ObjectStorage(_) => StatusCode::INTERNAL_SERVER_ERROR,
341341
Self::Serde(_) => StatusCode::BAD_REQUEST,

src/handlers/http/cluster/mod.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ use std::time::{Duration, Instant};
2626
use tokio::sync::{RwLock, Semaphore};
2727

2828
use actix_web::Responder;
29-
use actix_web::http::header::{self, HeaderMap};
29+
use actix_web::http::StatusCode;
30+
use actix_web::http::header::HeaderMap;
3031
use actix_web::web::Path;
3132
use bytes::Bytes;
3233
use chrono::Utc;
33-
use http::{StatusCode, header as http_header};
34+
use http::header;
3435
use itertools::Itertools;
3536
use serde::de::{DeserializeOwned, Error};
3637
use serde_json::error::Error as SerdeError;
@@ -367,10 +368,15 @@ pub async fn sync_streams_with_ingestors(
367368
body: Bytes,
368369
stream_name: &str,
369370
) -> Result<(), StreamError> {
370-
let mut reqwest_headers = http_header::HeaderMap::new();
371+
let mut reqwest_headers = reqwest::header::HeaderMap::new();
371372

372373
for (key, value) in headers.iter() {
373-
reqwest_headers.insert(key.clone(), value.clone());
374+
// Convert actix header name/value to reqwest header name/value
375+
if let Ok(name) = reqwest::header::HeaderName::from_bytes(key.as_str().as_bytes())
376+
&& let Ok(val) = reqwest::header::HeaderValue::from_bytes(value.as_bytes())
377+
{
378+
reqwest_headers.insert(name, val);
379+
}
374380
}
375381

376382
let body_clone = body.clone();

src/handlers/http/cluster/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use crate::{
2121
handlers::http::{base_path_without_preceding_slash, modal::NodeType},
2222
prism::logstream::PrismLogstreamError,
2323
};
24-
use actix_web::http::header;
2524
use chrono::{DateTime, Utc};
25+
use http::header;
2626
use serde::{Deserialize, Serialize};
2727
use tracing::error;
2828
use url::Url;

src/handlers/http/health_check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
use std::sync::Arc;
2020

21+
use actix_web::http::StatusCode;
2122
use actix_web::{
2223
HttpResponse,
2324
body::MessageBody,
@@ -26,7 +27,6 @@ use actix_web::{
2627
error::ErrorServiceUnavailable,
2728
middleware::Next,
2829
};
29-
use http::StatusCode;
3030
use once_cell::sync::Lazy;
3131
use tokio::{sync::Mutex, task::JoinSet};
3232
use tracing::{error, info};

src/handlers/http/ingest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
use std::collections::{HashMap, HashSet};
2020

21+
use actix_web::http::StatusCode;
2122
use actix_web::web::{self, Json, Path};
2223
use actix_web::{HttpRequest, HttpResponse, http::header::ContentType};
2324
use arrow_array::RecordBatch;
2425
use bytes::Bytes;
2526
use chrono::Utc;
26-
use http::StatusCode;
2727

2828
use crate::event::error::EventError;
2929
use crate::event::format::known_schema::{self, KNOWN_SCHEMA_LIST};
@@ -508,7 +508,7 @@ pub enum PostError {
508508
}
509509

510510
impl actix_web::ResponseError for PostError {
511-
fn status_code(&self) -> http::StatusCode {
511+
fn status_code(&self) -> StatusCode {
512512
use PostError::*;
513513
match self {
514514
SerdeError(_)

src/handlers/http/llm.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
*
1717
*/
1818

19+
use actix_web::http::StatusCode;
1920
use actix_web::{HttpResponse, Result, http::header::ContentType, web};
20-
use http::{StatusCode, header};
21+
use http::header;
2122
use itertools::Itertools;
2223
use reqwest;
2324
use serde_json::{Value, json};
@@ -146,7 +147,7 @@ pub enum LLMError {
146147
}
147148

148149
impl actix_web::ResponseError for LLMError {
149-
fn status_code(&self) -> http::StatusCode {
150+
fn status_code(&self) -> StatusCode {
150151
match self {
151152
Self::InvalidAPIKey => StatusCode::INTERNAL_SERVER_ERROR,
152153
Self::FailedRequest(_) => StatusCode::INTERNAL_SERVER_ERROR,

src/handlers/http/logstream.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@ fn classify_json_error(kind: serde_json::error::Category) -> StatusCode {
506506

507507
pub mod error {
508508

509+
use actix_web::http::StatusCode;
509510
use actix_web::http::header::ContentType;
510-
use http::StatusCode;
511511

512512
use crate::{
513513
hottier::HotTierError,
@@ -589,7 +589,7 @@ pub mod error {
589589
}
590590

591591
impl actix_web::ResponseError for StreamError {
592-
fn status_code(&self) -> http::StatusCode {
592+
fn status_code(&self) -> StatusCode {
593593
match self {
594594
StreamError::CreateStream(CreateStreamError::StreamNameValidation(_)) => {
595595
StatusCode::BAD_REQUEST
@@ -615,9 +615,10 @@ pub mod error {
615615
StreamError::InvalidRetentionConfig(_) => StatusCode::BAD_REQUEST,
616616
StreamError::SerdeError(_) => StatusCode::BAD_REQUEST,
617617
StreamError::Anyhow(_) => StatusCode::INTERNAL_SERVER_ERROR,
618-
StreamError::Network(err) => {
619-
err.status().unwrap_or(StatusCode::INTERNAL_SERVER_ERROR)
620-
}
618+
StreamError::Network(err) => err
619+
.status()
620+
.and_then(|s| StatusCode::from_u16(s.as_u16()).ok())
621+
.unwrap_or(StatusCode::INTERNAL_SERVER_ERROR),
621622
StreamError::HotTierNotEnabled(_) => StatusCode::FORBIDDEN,
622623
StreamError::HotTierValidation(_) => StatusCode::BAD_REQUEST,
623624
StreamError::HotTierError(_) => StatusCode::INTERNAL_SERVER_ERROR,

0 commit comments

Comments
 (0)