From e466f25ecfa356137523ee597b9fc6ab0da5df22 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 14 Apr 2021 03:27:27 +0300 Subject: [WIP] Initial implementation of user auth There is a dance involved and everything Write down specs for RSA and AES, padding scheme, ugh. --- src/custom_filters.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/custom_filters.rs') diff --git a/src/custom_filters.rs b/src/custom_filters.rs index ae8a56c..299cd8d 100644 --- a/src/custom_filters.rs +++ b/src/custom_filters.rs @@ -1,5 +1,5 @@ /// Functions that extracts Structs to be used in warp routines -use crate::schema::{AuthRequest, Block, Db, Transaction}; +use crate::schema::{Block, Db, InitialAuthRequest, Transaction}; use std::convert::Infallible; use warp::{Filter, Rejection}; @@ -8,12 +8,12 @@ pub fn with_db(db: Db) -> impl Filter + Clo warp::any().map(move || db.clone()) } -/// Extracts an `AuthRequest` JSON body from the request +/// Extracts an `InitialAuthRequest` JSON body from the request /// Accepts only JSON encoded `AuthRequest` body and rejects big payloads /// // TODO: find a good limit for this, (=e2482057; 8 char String + rsa pem) <11-04-21, yigit> // -pub fn auth_request_json_body() -> impl Filter + Clone -{ +pub fn auth_request_json_body( +) -> impl Filter + Clone { warp::body::content_length_limit(1024 * 32).and(warp::body::json()) } -- cgit v1.2.3-70-g09d2