aboutsummaryrefslogtreecommitdiffstats
path: root/src/custom_filters.rs
diff options
context:
space:
mode:
authoralpaylan2021-04-12 22:15:17 +0300
committeralpaylan2021-04-12 22:15:17 +0300
commit65bcc5ce455bdc298af3b9c4a30039afed047a4f (patch)
tree63fb58ba3762501ae872d518266cf9f7cc834976 /src/custom_filters.rs
parentdf484d87424674b88ccfa9392cfa9a75cc4abe48 (diff)
downloadgradecoin-65bcc5ce455bdc298af3b9c4a30039afed047a4f.tar.gz
gradecoin-65bcc5ce455bdc298af3b9c4a30039afed047a4f.tar.bz2
gradecoin-65bcc5ce455bdc298af3b9c4a30039afed047a4f.zip
implement user authentication using jwt
Diffstat (limited to 'src/custom_filters.rs')
-rw-r--r--src/custom_filters.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/custom_filters.rs b/src/custom_filters.rs
index 315ba4a..f93f572 100644
--- a/src/custom_filters.rs
+++ b/src/custom_filters.rs
@@ -20,6 +20,10 @@ pub fn transaction_json_body() -> impl Filter<Extract = (Transaction,), Error =
20 warp::body::content_length_limit(1024 * 32).and(warp::body::json()) 20 warp::body::content_length_limit(1024 * 32).and(warp::body::json())
21} 21}
22 22
23pub fn auth_header() -> impl Filter<Extract = (String,), Error = Rejection> + Clone {
24 warp::header::header::<String>("Authorization")
25}
26
23// Accept only json encoded Block body and reject big payloads 27// Accept only json encoded Block body and reject big payloads
24// TODO: find a good limit for this <11-04-21, yigit> // 28// TODO: find a good limit for this <11-04-21, yigit> //
25pub fn block_json_body() -> impl Filter<Extract = (Block,), Error = Rejection> + Clone { 29pub fn block_json_body() -> impl Filter<Extract = (Block,), Error = Rejection> + Clone {