aboutsummaryrefslogtreecommitdiffstats
path: root/src/custom_filters.rs
Commit message (Collapse)AuthorAgeFilesLines
* [WIP] Spring cleaningYigit Sever2022-04-111-2/+3
|
* Give up on content lengthYigit Sever2021-04-161-3/+0
|
* [WIP] Initial implementation of user authYigit Sever2021-04-141-4/+4
| | | | | | There is a dance involved and everything Write down specs for RSA and AES, padding scheme, ugh.
* Add verbose error messagesYigit Sever2021-04-131-1/+1
| | | | | | | | | Not happy with the solution one bit but using error.rs at https://blog.logrocket.com/create-an-async-crud-web-service-in-rust-with-warp/ was not working Basically we just handcraft every single response on the spot, there is some repetition and it's ugly but need to move on
* HousekeepingYigit Sever2021-04-131-5/+13
| | | | | | 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-0/+4
|
* Implement proof-of-workYigit Sever2021-04-121-5/+3
| | | | | | | | 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-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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?
* Remove unused code from filtersYigit Sever2021-04-091-5/+0
|
* Implement Block GET/PUT with new schemaYigit Sever2021-04-071-3/+8
| | | | | | | | | | | | | | - `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/+21