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
commitaa169ad1b3c277859f01413a945ea2d6f1375615 (patch)
tree402042bce17641759fa28e5c9a7219025caefcbb /src/custom_filters.rs
parent87e690420cb61efc172e82a29c38b479fc734247 (diff)
downloadgradecoin-aa169ad1b3c277859f01413a945ea2d6f1375615.tar.gz
gradecoin-aa169ad1b3c277859f01413a945ea2d6f1375615.tar.bz2
gradecoin-aa169ad1b3c277859f01413a945ea2d6f1375615.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 {