diff options
author | alpaylan | 2021-04-12 22:15:17 +0300 |
---|---|---|
committer | alpaylan | 2021-04-12 22:15:17 +0300 |
commit | 65bcc5ce455bdc298af3b9c4a30039afed047a4f (patch) | |
tree | 63fb58ba3762501ae872d518266cf9f7cc834976 /src/custom_filters.rs | |
parent | df484d87424674b88ccfa9392cfa9a75cc4abe48 (diff) | |
download | gradecoin-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.rs | 4 |
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 | ||
23 | pub 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> // |
25 | pub fn block_json_body() -> impl Filter<Extract = (Block,), Error = Rejection> + Clone { | 29 | pub fn block_json_body() -> impl Filter<Extract = (Block,), Error = Rejection> + Clone { |