From b06cbd69fc2a7544f6f62c20cbdfb30bda194101 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Tue, 13 Apr 2021 04:05:44 +0300 Subject: 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 --- src/lib.rs | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index aed4591..6e51899 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,9 +1,27 @@ -pub mod schema; +//! # Gradecoin +//! +//! ## Services +//! ### /register +//! - Student creates their own 2048 bit RSA `keypair` +//! - Downloads `Gradecoin`'s Public Key from Moodle +//! - Encrypts their JSON wrapped `Public Key` and `Student ID` using Gradecoin's Public Key +//! - Their public key is now in our Db under [`schema::User::public_key`] and can be used to sign their JWT's during requests +//! +//! ### /transaction +//! - offer a [`schema::Transaction`] - POST request +//! - The request should have `Authorization` +//! - The request header should be signed by the Public Key of the `by` field in the transaction +//! - fetch the list of `Transaction`s - GET request +//! +//! ### /block +//! - offer a [`schema::Block`] - POST request +//! - The request should have `Authorization` +//! - The [`schema::Block::transaction_list`] of the block should be a subset of [`schema::Db::pending_transactions`] +//! - fetch the last accepted [`schema::Block`] - GET request +//! +//! `Authorization`: The request header should have Bearer JWT.Token signed with Student Public Key -pub use schema::create_database; -pub use schema::AuthRequest; -pub use schema::Block; -pub use schema::Db; -pub use schema::MetuId; -pub use schema::Transaction; -pub use schema::User; +pub mod custom_filters; +pub mod handlers; +pub mod routes; +pub mod schema; -- cgit v1.2.3-70-g09d2