summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorYigit Sever2021-04-11 21:39:18 +0300
committerYigit Sever2021-04-12 00:03:23 +0300
commit518a99a132707ba0e2572b24ca18f6b9606d7334 (patch)
treec7cbe183f088b286903389f58743b1e5688119c5 /src/main.rs
parent217398c52c68b3b73454d3e9f66c85b5a1638f3f (diff)
downloadgradecoin-518a99a132707ba0e2572b24ca18f6b9606d7334.tar.gz
gradecoin-518a99a132707ba0e2572b24ca18f6b9606d7334.tar.bz2
gradecoin-518a99a132707ba0e2572b24ca18f6b9606d7334.zip
Implement User handling and authentication
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?
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 7ef2597..373223c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,8 +1,8 @@
1use std::env; 1use std::env;
2use warp::Filter; 2use warp::Filter;
3 3
4mod custom_filters;
5mod handlers; 4mod handlers;
5mod custom_filters;
6mod routes; 6mod routes;
7mod schema; 7mod schema;
8// mod validators; 8// mod validators;