From 116af4059f43eb3986b54fee080af9f67c247472 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Tue, 13 Apr 2021 04:51:19 +0300 Subject: Require authorization for Block POST Not tested because it's impossible to follow without verbose error messages, failing 1 test --- src/routes.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/routes.rs') diff --git a/src/routes.rs b/src/routes.rs index e4bdee4..0fb61c4 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -10,7 +10,7 @@ pub fn consensus_routes(db: Db) -> impl Filter impl Filter + Clone { +pub fn auth_block_propose(db: Db) -> impl Filter + Clone { warp::path!("block") .and(warp::post()) .and(custom_filters::block_json_body()) + .and(custom_filters::auth_header()) .and(custom_filters::with_db(db)) - .and_then(handlers::propose_block) + .and_then(handlers::auth_propose_block) } -- cgit v1.2.3-70-g09d2