aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes.rs
Commit message (Collapse)AuthorAgeFilesLines
* Handle empty url_prefixnecrashter2022-04-231-8/+14
|
* Handle url_prefix in networknecrashter2022-04-231-6/+10
|
* Support for multiple configs/routesnecrashter2022-04-231-7/+4
|
* Remove 404 supportYigit Sever2022-04-171-2/+0
|
* Add 404 supportYigit Sever2022-04-171-1/+3
|
* Improve commentsYigit Sever2022-04-171-5/+1
|
* [WIP] Spring cleaningYigit Sever2022-04-111-4/+4
|
* Rename functions and move checksYigit Sever2021-04-171-2/+2
| | | | Proposals are authenticated, no need to parrot
* Add existing user get supportYigit Sever2021-04-161-0/+9
|
* Listen to clippyYigit Sever2021-04-151-1/+1
|
* Add static serving supportYigit Sever2021-04-151-3/+8
|
* [WIP] Add template supportYigit Sever2021-04-151-2/+4
|
* Refactor authorized propose functionsYigit Sever2021-04-131-2/+2
| | | | | | | | | | | | | | They were getting spaghetti so; new function: handlers::authorize_proposer(), handles the jwt stuff, NOT async and _may_ cause trouble down the road but then again the stuff it does used to be (repeated) in the functions so how bad can it be If else chains were getting unwieldy; https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html so now everything is returning early, might make verbose error handling easier
* Require authorization for Block POSTYigit Sever2021-04-131-3/+4
| | | | | Not tested because it's impossible to follow without verbose error messages, failing 1 test
* HousekeepingYigit Sever2021-04-131-377/+3
| | | | | | Moved tests out of routes.rs into their own file Learned how to use lib.rs, now we have cargo doc support as well
* implement user authentication using jwtalpaylan2021-04-121-11/+121
|
* Implement proof-of-workYigit Sever2021-04-121-10/+70
| | | | | | | | Using blacke2s: https://docs.rs/blake2/0.9.1/blake2/ Using this guy's hash checker https://gist.github.com/gkbrk/2e4835e3a17b3fb6e1e7 blacke2s with 5 bits 0 can mine a block between 20 seconds to 359 during my tests, hope it'll be fun
* Implement User handling and authenticationYigit Sever2021-04-121-7/+73
| | | | | | | | | | | | | | | | | | | | | | | | New struct: User, corresponds to a student Blocks and users are persistent (written to a text file) PostgreSQL would've been overkill, we have 30 students AuthRequest is the representation for incoming register requests and User is the inner representation Students who are enrolled to the class are hardcoded, only they can register new accounts There are two new tests, one checks if a priviliged (=enrolled) user can create an account and the other checks if a unpriviliged one cannot There are quick verbose error messages that I'm not married to, might move on to something better honestly There's nothing stopping a malicious user to pre-register everyone with mock public keys and effectively lock everyone out, what's a good secret we can use?
* Add test TODO items to routesYigit Sever2021-04-091-0/+4
|
* Add routes testsYigit Sever2021-04-091-0/+148
|
* Remove old routes testsYigit Sever2021-04-091-276/+0
|
* Remove unused code from routesYigit Sever2021-04-091-59/+4
| | | | Original repo here: https://github.com/blurbyte/restful-rust
* Implement Block GET/PUT with new schemaYigit Sever2021-04-071-5/+25
| | | | | | | | | | | | | | - `Arc`+`Mutex` is replaced by `parking_lot::RwLock,` decoupled Read+Write and ability to upgrade read locks into write locks if needed - Schema has changed, `Db` is now a struct that implements `new()` to return a new instance of itself, pros/cons listed in code but tl;dr blockchain and pending transactions are separate now - `custom_filters` now supports extracting Block json and Transaction json in separate functions too - /block GET and PUT implemented, `Blocks` currently have one check (transactions appear in pending transaction) - debug is working after something, dunno how I fixed it
* Initial commitYigit Sever2021-04-071-0/+359