diff options
Diffstat (limited to 'src/routes.rs')
-rw-r--r-- | src/routes.rs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/routes.rs b/src/routes.rs index e2e068a..871fd9c 100644 --- a/src/routes.rs +++ b/src/routes.rs | |||
@@ -44,28 +44,24 @@ pub fn transaction_propose(db: Db) -> impl Filter<Extract = impl Reply, Error = | |||
44 | pub fn authenticated_transaction_propose( | 44 | pub fn authenticated_transaction_propose( |
45 | db: Db, | 45 | db: Db, |
46 | ) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { | 46 | ) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { |
47 | // // TODO: you might have to restore this | ||
48 | // // what we're trying to do is knowing which public key to use to decode the jwt in the | ||
49 | // // header of the request, we will either request it through a header (ugly, ugh) or get it | ||
50 | // // from json (then how do we chain these ugh) or we can just validate/check (move the | ||
51 | // // header/jwt logic to propose_transaction but that doesn't feel right either | ||
52 | // // good luck <10-04-21, yigit> // | ||
53 | |||
47 | warp::path("transaction") | 54 | warp::path("transaction") |
48 | .and(warp::path::end()) | 55 | .and(warp::path::end()) |
49 | .and(warp::post()) | 56 | .and(warp::post()) |
50 | .and(custom_filters::transaction_json_body()) // returns transaction | 57 | .and(custom_filters::transaction_json_body()) // returns transaction |
51 | .map(|t: Transaction| { | 58 | .map(|t: Transaction| { |
59 | // what do these do? | ||
52 | with_auth(db.clone(), t) | 60 | with_auth(db.clone(), t) |
53 | }) | 61 | }) |
54 | .and(custom_filters::transaction_json_body()) // returns transaction | 62 | .and(custom_filters::transaction_json_body()) // returns transaction |
55 | .and(custom_filters::with_db(db)) // wraps db | 63 | .and(custom_filters::with_db(db)) // wraps db |
56 | .and_then(handlers::propose_authenticated_transaction) // uses db, transaction and authenticated | 64 | .and_then(handlers::propose_authenticated_transaction) // uses db, transaction and authenticated |
57 | |||
58 | // .and(custom_filters::transaction_json_body()) | ||
59 | // // TODO: you might have to restore this | ||
60 | // // what we're trying to do is knowing which public key to use to decode the jwt in the | ||
61 | // // header of the request, we will either request it through a header (ugly, ugh) or get it | ||
62 | // // from json (then how do we chain these ugh) or we can just validate/check (move the | ||
63 | // // header/jwt logic to propose_transaction but that doesn't feel right either | ||
64 | // // good luck <10-04-21, yigit> // | ||
65 | // .map(|t: Transaction| with_auth(db.clone(), t)) | ||
66 | // .and(custom_filters::transaction_json_body()) | ||
67 | // .and(custom_filters::with_db(db)) | ||
68 | // .and_then(handlers::propose_transaction) | ||
69 | } | 65 | } |
70 | 66 | ||
71 | /// POST /block warp route | 67 | /// POST /block warp route |