From c0d0f98d1f16b3752cb242528104dd045015f5f8 Mon Sep 17 00:00:00 2001 From: Bat Date: Sun, 9 Sep 2018 10:27:03 +0100 Subject: [PATCH] Update rocket_csrf and enable protection again --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- src/main.rs | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 176e6c8d..31279f0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1464,7 +1464,7 @@ dependencies = [ "rocket 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", "rocket_codegen 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", "rocket_contrib 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", - "rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?rev=6fc55d26f91f057a20e89ece71d4443e797e7d21)", + "rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?rev=90a4aeca839c7de914bf10e5cd1288a8054a069a)", "rocket_i18n 0.1.1 (git+https://github.com/BaptisteGelez/rocket_i18n?rev=75a3bfd7b847324c078a355a7f101f8241a9f59b)", "rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.77 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1828,7 +1828,7 @@ dependencies = [ [[package]] name = "rocket_csrf" version = "0.1.0" -source = "git+https://github.com/fdb-hiroshima/rocket_csrf?rev=6fc55d26f91f057a20e89ece71d4443e797e7d21#6fc55d26f91f057a20e89ece71d4443e797e7d21" +source = "git+https://github.com/fdb-hiroshima/rocket_csrf?rev=90a4aeca839c7de914bf10e5cd1288a8054a069a#90a4aeca839c7de914bf10e5cd1288a8054a069a" dependencies = [ "csrf 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2912,7 +2912,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rocket_codegen 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)" = "" "checksum rocket_codegen_next 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)" = "" "checksum rocket_contrib 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)" = "" -"checksum rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?rev=6fc55d26f91f057a20e89ece71d4443e797e7d21)" = "" +"checksum rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?rev=90a4aeca839c7de914bf10e5cd1288a8054a069a)" = "" "checksum rocket_http 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)" = "" "checksum rocket_i18n 0.1.1 (git+https://github.com/BaptisteGelez/rocket_i18n?rev=75a3bfd7b847324c078a355a7f101f8241a9f59b)" = "" "checksum rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d127299b02abda51634f14025aec43ae87a7aa7a95202b6a868ec852607d1451" diff --git a/Cargo.toml b/Cargo.toml index 712fb30f..fc5c8a69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ rev = "55459db7732b9a240826a5c120c650f87e3372ce" [dependencies.rocket_csrf] git = "https://github.com/fdb-hiroshima/rocket_csrf" -rev = "6fc55d26f91f057a20e89ece71d4443e797e7d21" +rev = "90a4aeca839c7de914bf10e5cd1288a8054a069a" [dependencies.rocket_i18n] git = "https://github.com/BaptisteGelez/rocket_i18n" diff --git a/src/main.rs b/src/main.rs index f71c77c0..f4fcd5eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -145,13 +145,13 @@ fn main() { rocket_i18n::tera(&mut engines.tera); })) .attach(rocket_i18n::I18n::new("plume")) - // .attach(CsrfFairingBuilder::new() - // .set_default_target("/csrf-violation?target=".to_owned(), rocket::http::Method::Post) - // .add_exceptions(vec![ - // ("/inbox".to_owned(), "/inbox".to_owned(), rocket::http::Method::Post), - // ("/@//inbox".to_owned(), "/@//inbox".to_owned(), rocket::http::Method::Post), - // ("/~//".to_owned(), "/~//".to_owned(), rocket::http::Method::Post), - // ]) - // .finalize().unwrap()) + .attach(CsrfFairingBuilder::new() + .set_default_target("/csrf-violation?target=".to_owned(), rocket::http::Method::Post) + .add_exceptions(vec![ + ("/inbox".to_owned(), "/inbox".to_owned(), rocket::http::Method::Post), + ("/@//inbox".to_owned(), "/@//inbox".to_owned(), rocket::http::Method::Post), + ("/~//".to_owned(), "/~//".to_owned(), rocket::http::Method::Post), + ]) + .finalize().unwrap()) .launch(); }