Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 59592b3f authored by Pierre Jarriges's avatar Pierre Jarriges
Browse files

Merge branch 'dev' into 'master'

dockerfile up to bulleye-slim tag && fix secure cookie

See merge request kuadrado-software/kuadrado-website!38
parents 59e8442e bbd29ec7
No related branches found
No related tags found
1 merge request!13Dev
...@@ -1283,6 +1283,7 @@ dependencies = [ ...@@ -1283,6 +1283,7 @@ dependencies = [
"rustls 0.18.1", "rustls 0.18.1",
"serde", "serde",
"serde_json", "serde_json",
"time 0.2.27",
"tokio", "tokio",
"wither", "wither",
] ]
......
...@@ -2,23 +2,24 @@ ...@@ -2,23 +2,24 @@
name = "kuadrado_server" name = "kuadrado_server"
version = "2.0.2" version = "2.0.2"
authors = ["Pierre Jarriges <pierre.jarriges@tutanota.com>"] authors = ["Pierre Jarriges <pierre.jarriges@tutanota.com>"]
edition = "2018" edition = "2021"
license-file = "LICENSE" license-file = "LICENSE"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
actix-web = { version = "3", features=["rustls"] } actix-web = { version = "3", features = ["rustls"] }
actix-web-middleware-redirect-https = "3.0.1" actix-web-middleware-redirect-https = "3.0.1"
rustls="0.18.1" rustls = "0.18.1"
actix-files="0.5" actix-files = "0.5"
futures="0.3.17" futures = "0.3.17"
serde="1" serde = "1"
serde_json="1" serde_json = "1"
wither="0.9" wither = "0.9"
magic-crypt="3.1.9" magic-crypt = "3.1.9"
env_logger="0.9" env_logger = "0.9"
chrono="0.4" chrono = "0.4"
rand="0.8" rand = "0.8"
dotenv="0.15" dotenv = "0.15"
tokio = { version = "0.2", features = ["full"] } time = "0.2.7"
\ No newline at end of file tokio = { version = "0.2", features = ["full"] }
FROM kuadsoft/rust-openssl:latest as builder FROM kuadsoft/rust-openssl:bullseye-slim as builder
WORKDIR /usr/src/kuadrado_server WORKDIR /usr/src/kuadrado_server
COPY ./Cargo.toml ./Cargo.toml COPY ./Cargo.toml ./Cargo.toml
...@@ -6,6 +6,6 @@ COPY ./Cargo.lock ./Cargo.lock ...@@ -6,6 +6,6 @@ COPY ./Cargo.lock ./Cargo.lock
COPY ./src ./src COPY ./src ./src
RUN cargo install --locked --path . RUN cargo install --locked --path .
FROM kuadsoft/debian-openssl:buster-slim FROM kuadsoft/debian-openssl:bullseye-slim
COPY --from=builder /usr/local/cargo/bin/kuadrado_server /usr/local/bin/kuadrado_server COPY --from=builder /usr/local/cargo/bin/kuadrado_server /usr/local/bin/kuadrado_server
CMD ["kuadrado_server"] CMD ["kuadrado_server"]
\ No newline at end of file
FROM kuadsoft/rust-openssl:latest FROM kuadsoft/rust-openssl:bullseye-slim
WORKDIR /usr/src/kuadrado_server WORKDIR /usr/src/kuadrado_server
COPY ./Cargo.toml ./Cargo.toml COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock COPY ./Cargo.lock ./Cargo.lock
......
...@@ -8,14 +8,15 @@ use wither::{bson::doc, prelude::Model}; ...@@ -8,14 +8,15 @@ use wither::{bson::doc, prelude::Model};
/// Returns a Secure actix_web::http::Cookie. /// Returns a Secure actix_web::http::Cookie.
pub fn get_auth_cookie(name: &'static str, value: String) -> Cookie<'static> { pub fn get_auth_cookie(name: &'static str, value: String) -> Cookie<'static> {
Cookie::build(name, value) Cookie::build(name, value)
.secure(true) .path("/")
.http_only(true) .http_only(true)
.max_age(time::Duration::days(7))
.same_site(SameSite::Strict) .same_site(SameSite::Strict)
.path("/") .secure(true)
.finish() .finish()
} }
/// This is not a real middleware as it is meant to be executed only after having processed the request and not before. /// This is not an actual middleware as it is meant to be executed in the endpoint service to perform a simple verification.
/// It must be registered in the actix App instance with app_data. /// It must be registered in the actix App instance with app_data.
/// ``` /// ```
/// App::new() /// App::new()
......
...@@ -133,7 +133,6 @@ impl ViewResourceManager { ...@@ -133,7 +133,6 @@ impl ViewResourceManager {
} else { } else {
return HttpResponse::Ok() return HttpResponse::Ok()
.content_type("text/html") .content_type("text/html")
.cookie(auth_cookie.unwrap())
.body(&res.string_contents); .body(&res.string_contents);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment