freechat/server-api
shockrah 11251fe6d3 1. adding hmac_secret as a private lazy_static variable
This is only initialized once and is read only after the fact so it should be fine

2. Adding a Claim struct that all JWT's will use for their structure. A helpful .new() function is provided

3. AuthReason::ServerIssue(String) is a now a thing

Should help the auth module be more clear in what's  going on

4. fn get_jwt_json -> renamed from get_jwt to indicate we're getting something from json payload. Nothing more

5. async fn valid_jwt: Attempts to decode the given token, if successful it then looks if that user has given us an active jwt budget-session-key if (returns boolean)

6. wall_entry now returns an AuthReason without the sql wrapping, since thats db-lib's problem anyway

Also we're collecting all data upfront then verifying it as we go.

7. async fn login_get_jwt::ROUTE

On login_auth here we simply create a JWT for the user, store it in cache, then give it back to the user to use.
Tokens take a week to expire

8. Removed busted tests that weren't doing anything useful for the time being
2020-12-22 21:51:23 -08:00
..
client-tests showing options passed to routes in tests 2020-12-12 14:46:09 -08:00
db Tiny auth module for literally just redis and jwt things 2020-12-22 21:30:35 -08:00
migrations on delete cascade added to messages which hopefully makes channel deletion a bit better 2020-11-18 00:28:46 -08:00
scripts Script for generating a smiple hmac value 2020-12-22 21:28:57 -08:00
src 1. adding hmac_secret as a private lazy_static variable 2020-12-22 21:51:23 -08:00
.env sample .env now uses redis 2020-12-22 21:28:38 -08:00
.gitignore new build + test scripst for ci/cd pipelines 2020-10-21 19:36:47 -07:00
build.sh + Created testing func which is now super easily configurable 2020-11-21 19:05:02 -08:00
Cargo.lock sample .env now uses redis 2020-12-22 21:28:38 -08:00
Cargo.toml sample .env now uses redis 2020-12-22 21:28:38 -08:00
endpoints.md Basically a rewrite of previous docs but this one is super terse 2020-12-12 15:45:13 -08:00