diff options
| author | alpaylan | 2021-04-12 22:15:17 +0300 |
|---|---|---|
| committer | alpaylan | 2021-04-12 22:15:17 +0300 |
| commit | aa169ad1b3c277859f01413a945ea2d6f1375615 (patch) | |
| tree | 402042bce17641759fa28e5c9a7219025caefcbb /src/custom_filters.rs | |
| parent | 87e690420cb61efc172e82a29c38b479fc734247 (diff) | |
| download | gradecoin-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.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 { |
