Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
422 changes: 61 additions & 361 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ parquet = "57.1.0"
# Web server and HTTP-related
actix-cors = "0.7.0"
actix-web-lab = "0.24.3"
actix-web = { version = "4.9.0", features = ["rustls-0_22"] }
actix-web = { version = "4.9.0", features = ["rustls-0_23"] }
actix-web-httpauth = "0.8"
actix-web-prometheus = { version = "0.1", default-features = false }
actix-web-static-files = "4.0"
http = "0.2.7"
http = "1.0"
http-auth-basic = "0.3.3"
tonic = { version = "0.14.1", features = [
"tls-aws-lc",
Expand Down Expand Up @@ -63,7 +63,7 @@ base64 = "0.22.0"
cookie = "0.18.1"
hex = "0.4"
openid = { version = "0.18.3", default-features = false, features = ["rustls"] }
rustls = "0.22.4"
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
rustls-pemfile = "2.1.2"
sha2 = "0.10.8"

Expand Down Expand Up @@ -147,13 +147,13 @@ once_cell = "1.20"
rayon = "1.8"
rand = "0.8.5"
regex = "1.12.2"
reqwest = { version = "0.11.27", default-features = false, features = [
reqwest = { version = "0.12", default-features = false, features = [
"rustls-tls",
"json",
"gzip",
"brotli",
"stream",
] } # cannot update cause rustls is not latest `see rustls`
] }
semver = "1.0"
static-files = "0.2"
thiserror = "2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/alerts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*
*/

use actix_web::http::StatusCode;
use actix_web::http::header::ContentType;
use arrow_schema::{ArrowError, DataType, Schema};
use async_trait::async_trait;
Expand All @@ -24,7 +25,6 @@ use datafusion::logical_expr::{LogicalPlan, Projection};
use datafusion::prelude::Expr;
use datafusion::sql::sqlparser::parser::ParserError;
use derive_more::FromStrError;
use http::StatusCode;
use serde_json::{Error as SerdeError, Value as JsonValue};
use std::collections::HashMap;
use std::fmt::Debug;
Expand Down
4 changes: 2 additions & 2 deletions src/correlation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

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

use actix_web::http::StatusCode;
use actix_web::{Error, http::header::ContentType};
use chrono::Utc;
use datafusion::error::DataFusionError;
use http::StatusCode;
use itertools::Itertools;
use once_cell::sync::Lazy;
use relative_path::RelativePathBuf;
Expand Down Expand Up @@ -335,7 +335,7 @@ pub enum CorrelationError {
}

impl actix_web::ResponseError for CorrelationError {
fn status_code(&self) -> http::StatusCode {
fn status_code(&self) -> StatusCode {
match self {
Self::ObjectStorage(_) => StatusCode::INTERNAL_SERVER_ERROR,
Self::Serde(_) => StatusCode::BAD_REQUEST,
Expand Down
14 changes: 10 additions & 4 deletions src/handlers/http/cluster/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ use std::time::{Duration, Instant};
use tokio::sync::{RwLock, Semaphore};

use actix_web::Responder;
use actix_web::http::header::{self, HeaderMap};
use actix_web::http::StatusCode;
use actix_web::http::header::HeaderMap;
use actix_web::web::Path;
use bytes::Bytes;
use chrono::Utc;
use http::{StatusCode, header as http_header};
use http::header;
use itertools::Itertools;
use serde::de::{DeserializeOwned, Error};
use serde_json::error::Error as SerdeError;
Expand Down Expand Up @@ -367,10 +368,15 @@ pub async fn sync_streams_with_ingestors(
body: Bytes,
stream_name: &str,
) -> Result<(), StreamError> {
let mut reqwest_headers = http_header::HeaderMap::new();
let mut reqwest_headers = reqwest::header::HeaderMap::new();

for (key, value) in headers.iter() {
reqwest_headers.insert(key.clone(), value.clone());
// Convert actix header name/value to reqwest header name/value
if let Ok(name) = reqwest::header::HeaderName::from_bytes(key.as_str().as_bytes())
&& let Ok(val) = reqwest::header::HeaderValue::from_bytes(value.as_bytes())
{
reqwest_headers.insert(name, val);
}
}

let body_clone = body.clone();
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/http/cluster/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::{
handlers::http::{base_path_without_preceding_slash, modal::NodeType},
prism::logstream::PrismLogstreamError,
};
use actix_web::http::header;
use chrono::{DateTime, Utc};
use http::header;
use serde::{Deserialize, Serialize};
use tracing::error;
use url::Url;
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/http/health_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

use std::sync::Arc;

use actix_web::http::StatusCode;
use actix_web::{
HttpResponse,
body::MessageBody,
Expand All @@ -26,7 +27,6 @@ use actix_web::{
error::ErrorServiceUnavailable,
middleware::Next,
};
use http::StatusCode;
use once_cell::sync::Lazy;
use tokio::{sync::Mutex, task::JoinSet};
use tracing::{error, info};
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/http/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

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

use actix_web::http::StatusCode;
use actix_web::web::{self, Json, Path};
use actix_web::{HttpRequest, HttpResponse, http::header::ContentType};
use arrow_array::RecordBatch;
use bytes::Bytes;
use chrono::Utc;
use http::StatusCode;

use crate::event::error::EventError;
use crate::event::format::known_schema::{self, KNOWN_SCHEMA_LIST};
Expand Down Expand Up @@ -508,7 +508,7 @@ pub enum PostError {
}

impl actix_web::ResponseError for PostError {
fn status_code(&self) -> http::StatusCode {
fn status_code(&self) -> StatusCode {
use PostError::*;
match self {
SerdeError(_)
Expand Down
5 changes: 3 additions & 2 deletions src/handlers/http/llm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
*
*/

use actix_web::http::StatusCode;
use actix_web::{HttpResponse, Result, http::header::ContentType, web};
use http::{StatusCode, header};
use http::header;
use itertools::Itertools;
use reqwest;
use serde_json::{Value, json};
Expand Down Expand Up @@ -146,7 +147,7 @@ pub enum LLMError {
}

impl actix_web::ResponseError for LLMError {
fn status_code(&self) -> http::StatusCode {
fn status_code(&self) -> StatusCode {
match self {
Self::InvalidAPIKey => StatusCode::INTERNAL_SERVER_ERROR,
Self::FailedRequest(_) => StatusCode::INTERNAL_SERVER_ERROR,
Expand Down
11 changes: 6 additions & 5 deletions src/handlers/http/logstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ fn classify_json_error(kind: serde_json::error::Category) -> StatusCode {

pub mod error {

use actix_web::http::StatusCode;
use actix_web::http::header::ContentType;
use http::StatusCode;

use crate::{
hottier::HotTierError,
Expand Down Expand Up @@ -589,7 +589,7 @@ pub mod error {
}

impl actix_web::ResponseError for StreamError {
fn status_code(&self) -> http::StatusCode {
fn status_code(&self) -> StatusCode {
match self {
StreamError::CreateStream(CreateStreamError::StreamNameValidation(_)) => {
StatusCode::BAD_REQUEST
Expand All @@ -615,9 +615,10 @@ pub mod error {
StreamError::InvalidRetentionConfig(_) => StatusCode::BAD_REQUEST,
StreamError::SerdeError(_) => StatusCode::BAD_REQUEST,
StreamError::Anyhow(_) => StatusCode::INTERNAL_SERVER_ERROR,
StreamError::Network(err) => {
err.status().unwrap_or(StatusCode::INTERNAL_SERVER_ERROR)
}
StreamError::Network(err) => err
.status()
.and_then(|s| StatusCode::from_u16(s.as_u16()).ok())
.unwrap_or(StatusCode::INTERNAL_SERVER_ERROR),
StreamError::HotTierNotEnabled(_) => StatusCode::FORBIDDEN,
StreamError::HotTierValidation(_) => StatusCode::BAD_REQUEST,
StreamError::HotTierError(_) => StatusCode::INTERNAL_SERVER_ERROR,
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

use actix_cors::Cors;
use actix_web::Responder;
use actix_web::http::StatusCode;
use arrow_schema::Schema;
use cluster::get_node_info;
use http::StatusCode;
use modal::{NodeMetadata, NodeType};
use serde_json::Value;

Expand Down
2 changes: 1 addition & 1 deletion src/handlers/http/modal/ingest/ingestor_logstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

use std::fs;

use actix_web::http::StatusCode;
use actix_web::{
HttpRequest, Responder,
web::{Json, Path},
};
use bytes::Bytes;
use http::StatusCode;
use tracing::warn;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/http/modal/ingest/ingestor_rbac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

use std::collections::HashSet;

use actix_web::http::StatusCode;
use actix_web::{HttpResponse, web};
use http::StatusCode;

use crate::{
handlers::http::{
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/http/modal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub trait ParseableServer {
// Start the server with or without TLS
let srv = if let Some(config) = ssl {
http_server
.bind_rustls_0_22(&PARSEABLE.options.address, config)?
.bind_rustls_0_23(&PARSEABLE.options.address, config)?
.run()
} else {
http_server.bind(&PARSEABLE.options.address)?.run()
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/http/modal/query/querier_logstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
use core::str;
use std::{collections::HashMap, fs};

use actix_web::http::StatusCode;
use actix_web::{
HttpRequest, Responder,
web::{self, Path},
};
use bytes::Bytes;
use chrono::Utc;
use http::StatusCode;
use tokio::sync::Mutex;
use tracing::{error, warn};

Expand Down
6 changes: 5 additions & 1 deletion src/handlers/http/modal/ssl_acceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use std::{
fs::{self, File},
io::BufReader,
path::PathBuf,
sync::Arc,
};

use rustls::ServerConfig;
Expand All @@ -31,7 +32,10 @@ pub fn get_ssl_acceptor(
) -> anyhow::Result<Option<ServerConfig>> {
match (tls_cert, tls_key) {
(Some(cert), Some(key)) => {
let server_config = ServerConfig::builder().with_no_client_auth();
let provider = Arc::new(rustls::crypto::ring::default_provider());
let server_config = ServerConfig::builder_with_provider(provider)
.with_safe_default_protocol_versions()?
.with_no_client_auth();

let cert_file = &mut BufReader::new(File::open(cert)?);
let key_file = &mut BufReader::new(File::open(key)?);
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/http/modal/utils/ingest_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/

use actix_web::HttpRequest;
use actix_web::http::header::USER_AGENT;
use chrono::Utc;
use http::header::USER_AGENT;
use opentelemetry_proto::tonic::{
logs::v1::LogsData, metrics::v1::MetricsData, trace::v1::TracesData,
};
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/http/oidc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

use std::{collections::HashSet, sync::Arc};

use actix_web::http::StatusCode;
use actix_web::{
HttpRequest, HttpResponse,
cookie::{Cookie, SameSite, time},
http::header::{self, ContentType},
web,
};
use chrono::{Duration, TimeDelta};
use http::StatusCode;
use openid::{Bearer, Options, Token, Userinfo};
use regex::Regex;
use serde::Deserialize;
Expand Down Expand Up @@ -563,7 +563,7 @@ pub enum OIDCError {
}

impl actix_web::ResponseError for OIDCError {
fn status_code(&self) -> http::StatusCode {
fn status_code(&self) -> StatusCode {
match self {
Self::ObjectStorageError(_) => StatusCode::INTERNAL_SERVER_ERROR,
Self::Serde(_) => StatusCode::INTERNAL_SERVER_ERROR,
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/http/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use crate::metastore::MetastoreError;
use crate::option::Mode;
use crate::rbac::map::SessionKey;
use crate::utils::arrow::record_batches_to_json;
use actix_web::http::StatusCode;
use actix_web::http::header::ContentType;
use actix_web::web::{self, Json};
use actix_web::{Either, FromRequest, HttpRequest, HttpResponse, Responder};
Expand All @@ -34,7 +35,6 @@ use datafusion::sql::sqlparser::parser::ParserError;
use futures::stream::once;
use futures::{Stream, StreamExt, future};
use futures_util::Future;
use http::StatusCode;
use itertools::Itertools;
use serde::{Deserialize, Serialize};
use serde_json::{Value, json};
Expand Down Expand Up @@ -590,7 +590,7 @@ Description: {0}"#
}

impl actix_web::ResponseError for QueryError {
fn status_code(&self) -> http::StatusCode {
fn status_code(&self) -> StatusCode {
match self {
QueryError::Execute(_) | QueryError::JsonParse(_) => StatusCode::INTERNAL_SERVER_ERROR,
QueryError::MetastoreError(e) => e.status_code(),
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/http/rbac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ use crate::{
storage::ObjectStorageError,
validator::{self, error::UsernameValidationError},
};
use actix_web::http::StatusCode;
use actix_web::{
HttpResponse, Responder,
http::header::ContentType,
web::{self, Path},
};
use http::StatusCode;
use itertools::Itertools;
use serde::Serialize;
use serde_json::json;
Expand Down Expand Up @@ -416,7 +416,7 @@ pub enum RBACError {
}

impl actix_web::ResponseError for RBACError {
fn status_code(&self) -> http::StatusCode {
fn status_code(&self) -> StatusCode {
match self {
Self::UserExists(_) => StatusCode::BAD_REQUEST,
Self::UserDoesNotExist => StatusCode::NOT_FOUND,
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/http/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

use std::collections::HashSet;

use actix_web::http::StatusCode;
use actix_web::{
HttpResponse, Responder,
http::header::ContentType,
web::{self, Json},
};
use http::StatusCode;

use crate::{
parseable::PARSEABLE,
Expand Down Expand Up @@ -176,7 +176,7 @@ pub enum RoleError {
}

impl actix_web::ResponseError for RoleError {
fn status_code(&self) -> http::StatusCode {
fn status_code(&self) -> StatusCode {
match self {
Self::ObjectStorageError(_) => StatusCode::INTERNAL_SERVER_ERROR,
Self::RoleInUse => StatusCode::BAD_REQUEST,
Expand Down
Loading
Loading