diff --git a/Cargo.lock b/Cargo.lock index b6bb41e755..f3a7fc09bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2044,16 +2044,9 @@ dependencies = [ name = "http_server_common" version = "0.0.1" dependencies = [ - "actix 0.10.0", "actix-cors", - "actix-files", "actix-http 2.2.0", - "actix-multipart", - "actix-rt 2.4.0", - "actix-service 1.0.6", - "actix-utils 3.0.0", "actix-web 3.3.2", - "actix-web-actors 3.0.0", "anyhow", "base64 0.13.0", "bcrypt", @@ -2070,7 +2063,6 @@ dependencies = [ "hostname", "hyper 0.13.10", "infer", - "jwt", "limitation", "log", "lru_time_cache", @@ -2827,6 +2819,7 @@ dependencies = [ "hex", "hmac 0.10.1", "hostname", + "http_server_common", "hyper 0.13.10", "jwt", "lazy_static", diff --git a/app/http_server_common/Cargo.toml b/app/http_server_common/Cargo.toml index 88c14d9ca3..400c6497de 100644 --- a/app/http_server_common/Cargo.toml +++ b/app/http_server_common/Cargo.toml @@ -69,19 +69,25 @@ subprocess = "0.2.6" tempdir = "0.3.7" # Web -actix = "0.10" -#actix-web = "3" -actix-web-actors = "3" - +#actix = "0.12.0" actix-cors = "0.5.4" -actix-files= "0.5" -actix-http = "2.2.0" -actix-multipart = "0.3.0" # TODO: Ready for 0.4 upgrade -actix-rt = "2.2.0" -actix-service = "1.0.6" -actix-utils = "3.0.0" -actix-web = "3.3.2" -jwt = "0.13.0" +#actix-files= "0.5" +actix-http = "*" +#actix-multipart = "0.3.0" # TODO: Ready for 0.4 upgrade +#actix-rt = "2.2.0" +#actix-service = "1.0.6" +#actix-utils = "3.0.0" +actix-web = "*" +#actix-web-actors = "3" +#jwt = "0.13.0" + + +#actix-http-old = { package = "actix-http", version = "2.2.0", optional = true } +#actix-web-old = { package = "actix-web", version = "3.3.2", optional = true } +#actix-http-new = { package = "actix-http", version = "3.0.0-beta.11", optional = true } +#actix-web-new = { package = "actix-web", version = "4.0.0-beta.10", optional = true } + + # NB: Hyper is just for HTTP client use in jobs. I'd use Actix client, but I need tokio runtime # NB: Furthermore, the Tokio runtime is old, so I have to use an older Hyper. @@ -106,3 +112,7 @@ pulldown-cmark = "0.8.0" [build-dependencies] # NB: Only using diesel for migrations support diesel = { version = "1.4.6", features = ["mysql"] } + +#[features] +#actix-old = ["actix-http-old", "actix-web-old"] +#actix-new = ["actix-http-new", "actix-web-new"] diff --git a/app/http_server_common/src/lib.rs b/app/http_server_common/src/lib.rs index 61a42e6bcb..91c231f521 100644 --- a/app/http_server_common/src/lib.rs +++ b/app/http_server_common/src/lib.rs @@ -2,6 +2,8 @@ //! Common HTTP Server components //! +#[macro_use] extern crate serde_derive; + pub mod cors; pub mod endpoints; pub mod response; \ No newline at end of file diff --git a/app/http_server_common/src/response/serialize_as_json_error.rs b/app/http_server_common/src/response/serialize_as_json_error.rs index 7a36a6d595..beb6d25a25 100644 --- a/app/http_server_common/src/response/serialize_as_json_error.rs +++ b/app/http_server_common/src/response/serialize_as_json_error.rs @@ -1,8 +1,8 @@ +use actix_http::ResponseError; use actix_http::http::{StatusCode, header}; use actix_web::HttpResponse; -use serde::Serialize; -use actix_http::ResponseError; use actix_web::dev::HttpResponseBuilder; +use serde::Serialize; /// Turn error responses into JSON HTTP responses pub fn serialize_as_json_error( diff --git a/app/obs_gateway/Cargo.toml b/app/obs_gateway/Cargo.toml index 103b64da24..3a9500509c 100644 --- a/app/obs_gateway/Cargo.toml +++ b/app/obs_gateway/Cargo.toml @@ -17,7 +17,7 @@ path = "src/main.rs" # Internal config = { path = "../config" } container_common = { path = "../container_common" } -#http_server_common = { path = "../http_server_common" } +http_server_common = { path = "../http_server_common" } # External anyhow = "1.0.40"