aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/lib.rs b/src/lib.rs
deleted file mode 100644
index c335ae9..0000000
--- a/src/lib.rs
+++ /dev/null
@@ -1,35 +0,0 @@
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
23
24pub mod custom_filters;
25pub mod handlers;
26pub mod routes;
27pub mod schema;
28
29use lazy_static::lazy_static;
30use std::fs;
31
32lazy_static! {
33 static ref PRIVATE_KEY: String =
34 fs::read_to_string("secrets/gradecoin.pem").expect("error reading 'secrets/gradecoin.pem'");
35}