Should make it more dsecriptive with really weird input and prevent even more confusing 500 responses to the client
+ db-lib::Channels::add now also potentially returns this new RestrictedInput variant
* Refactored serde facing puller functions to be more clear
- Removing incorrect commentary
* Changed login handler to start using mysql based api
! Further refactoring in the previous to be more readable
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
+ Helper function to clearly encrypt generated secrets
+ New test for auth::valid_secret as a sanity check
! routes::is_open is no longer retarded and behaves as expected
! I should note that there are two things which are incomplete
1. channel deletion with linked messages
2. Invites module has not been refactored BUT behaves beautifully in all tests so far so i cba
Also is a lot more straight forward to use as it basically return Response::Success and Other in case of issue
Member::update_perms now a thing which is again pasted from previously working code and uses Result<_, _> return types so we can ? everywhere
$ Using ? is basically a try so latency should be reduced in this method
src/channels.rs/ : simple log of sql error to stderr
main.rs : swapped secret and name parameters as they were backwards somehow (tfw cant type)
src/messages.sr : more clerical shit(mispelled parameter name) and logging sql to stderr