diff options
| author | Yigit Sever | 2021-04-13 04:05:44 +0300 |
|---|---|---|
| committer | Yigit Sever | 2021-04-13 04:05:49 +0300 |
| commit | 17d73bb73f4396c22ca24c3839a5449f5e28b4e5 (patch) | |
| tree | 06b90d76e40101b462f2ddcfa89c768d78279ed6 /src/lib.rs | |
| parent | 0cc703bc74539f123d57d2d392eaf6b99eca26e7 (diff) | |
| download | gradecoin-17d73bb73f4396c22ca24c3839a5449f5e28b4e5.tar.gz gradecoin-17d73bb73f4396c22ca24c3839a5449f5e28b4e5.tar.bz2 gradecoin-17d73bb73f4396c22ca24c3839a5449f5e28b4e5.zip | |
Housekeeping
Moved tests out of routes.rs into their own file
Learned how to use lib.rs, now we have cargo doc support as well
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 34 |
1 files changed, 26 insertions, 8 deletions
| @@ -1,9 +1,27 @@ | |||
| 1 | pub mod schema; | 1 | //! # Gradecoin |
| 2 | //! | ||
| 3 | //! ## Services | ||
| 4 | //! ### /register | ||
| 5 | //! - Student creates their own 2048 bit RSA `keypair` | ||
| 6 | //! - Downloads `Gradecoin`'s Public Key from Moodle | ||
| 7 | //! - Encrypts their JSON wrapped `Public Key` and `Student ID` using Gradecoin's Public Key | ||
| 8 | //! - Their public key is now in our Db under [`schema::User::public_key`] and can be used to sign their JWT's during requests | ||
| 9 | //! | ||
| 10 | //! ### /transaction | ||
| 11 | //! - offer a [`schema::Transaction`] - POST request | ||
| 12 | //! - The request should have `Authorization` | ||
| 13 | //! - The request header should be signed by the Public Key of the `by` field in the transaction | ||
| 14 | //! - fetch the list of `Transaction`s - GET request | ||
| 15 | //! | ||
| 16 | //! ### /block | ||
| 17 | //! - offer a [`schema::Block`] - POST request | ||
| 18 | //! - The request should have `Authorization` | ||
| 19 | //! - The [`schema::Block::transaction_list`] of the block should be a subset of [`schema::Db::pending_transactions`] | ||
| 20 | //! - fetch the last accepted [`schema::Block`] - GET request | ||
| 21 | //! | ||
| 22 | //! `Authorization`: The request header should have Bearer JWT.Token signed with Student Public Key | ||
| 2 | 23 | ||
| 3 | pub use schema::create_database; | 24 | pub mod custom_filters; |
| 4 | pub use schema::AuthRequest; | 25 | pub mod handlers; |
| 5 | pub use schema::Block; | 26 | pub mod routes; |
| 6 | pub use schema::Db; | 27 | pub mod schema; |
| 7 | pub use schema::MetuId; | ||
| 8 | pub use schema::Transaction; | ||
| 9 | pub use schema::User; | ||
