This makes the parameter follow the naming convention of badge_*
* badges.id field now uses BIGINT's as intended
* Typo in sql where 'badges' was incorrectly set to 'perms' -_-
! Test bot is once again a massive disaster but at least it scales well /shrug
Should probably refactor test bot to be moar straight forward or something idk
+ Also adding some spacing eye candy to make sure we can read things easily
It should be noted that /badge/update needs some more planning so 1 more commit
is justified for it as some consideration must be taken for how individual badge
permissions are going to be handled
The badges_id field has proved to bubble up some issues with updating deep structures
Basically this just means that feature branches for deep features like this are a good idea
! Issue: RTC feature flag was working fine but without the feature flag `Row`'s had no pickup
This meant correct responses were slipping into previously unreachable sections of code
This patch has not yet been tested but will be in the coming patches
Sumamary: we're just doing a regular delete on the neighbor's table based off
the url field
The cases that actually matter should be covered now so I'm confident with this
endpoint's behavior
! A preliminary db::neighbors::get is done to cover the 404 case
Basically if a bad url is used in the request we should 404 the update as there
won't be anything relevant to update
This also "fixes" the /neighbor/update route conveniently enough, which had much
better behavior than expected before.
- Remvoing some fluff from debugging
! This route needs way more testing as its currently failing the prelim test listed right now
! Some more misc changes in testing/mod.rs that aren't imporant at all to anyone
It's just an extra comment
This chage is basically required due to the ridiculuous number of parameters that needed to be passed.
Also more POC for showing how serde_json's result type can be used to safely parse http bodies
unwrap had a chance to panic where as the unwrap_or now defaults to an empty
Bytes object which lets the code after it fail with an HTTP 400. This is preferrable
to a 500 error as there really is no error, just bad/unpollable input from the
end user.
* claim.rng is now seeded from 16 bytes
+ passing Member to auth::login_get_jwt
* Better error loggin on jwt::insert call
+ Moar meta config-caching fixes
Basically lazy static sucks and we have to start accessing meta::basic_config
though a proxy function which forces the initialization on startup
! We should probably init this prior to listening for connections to avoid connection issues
+ New /neighbors/list endpoint which has already passed required checks
Lazy static initialization still allocates once per run so the above is jank but fine(mostly)
[] Should probably come up with a cleaner way of passing this data around
The above is very low on the priority list of things to do
+ Now injecting permisions + id via the claim structure which is passed to the
route dispatcher
! For now this is unused further down the decision tree however I'm going to sprinkle
in its incorporation as it lets us avoid string conversions which is p nice
! wat - because have to do maintain permissions on a per request level we have
to do this check for permissions at what is basically every level, this does
mean we have to hit the database for a lot of routes however there is a check
that requests go through in order to avoid hitting the database whenever possible
+ rng field in claims now has real purpose
It's purpose is to act as a validator field in the jwt table. By verifying rng
fields we no longer have to store whole jwt's
+ Adding some more invite status checks
+ Adding a verbose invite usage check for sanity reasons
- Removing run-api-tests script as it now goes into the /scripts/ directory
+ Adding the wss-hmac setup from the command line arg
It was literally just 1 if statement that I forgot to write in
This is really just for testing purposes since the files tend to be in
awkward to reach path
- Removing if args.len == 0 check
Basically cannon-fodder tbh
* Auth now reads hmac path from environment var
! All of the above is added for the wss hmac as well
+ Adding command line flag [-W/--wss-hmac] to specify wss-hmac file path
Secret value given to user was literally the encrypted secret because I forgot
to rebind it
- removing dev key lmaoooo
These are generated super easily and this key doesn't actually go to anything
so its really not a problem, although it is annoying that its there
This is really only for check if a particular channel exists for /messages/recent's backend
* Flattening db-lib::Message::last_n
SHould make code more readable as it now has a more linear flow
* api::Messages::recent_messages now 404's when a channel that doesn't exist is request
Better matching against return types so we're not throwing away errors
This just entails swapping the if let for a match statement
* db-lib::Message::send has more updated docs on what variants of Response it returns
* api::messages::send_message has better error logging now and more relevant comments
+ Adding new flags to sample .env file
+ Wrapper script run-api-tests.sh which does as its called
- Removing build.sh in favor of run-api-tests.sh
Makefile takes care of building, and apitests are ran with special script anyway
This api method is made for clients to easily say "give me the n[1,100] latest
messages in some channel
This commit contains code that is largely untested but contains some base code
such that I can correct issues in the next _tested_ commit
! Start taking public user params like this in the JWT to reduce on network hits
It's cheap and reliable enough but the idea just now came to me so do that at some point
+ New notify driver function which does the network magic we need
+ Adding event emitters for the following events
"delete-channel"
"create-channel"
"update-nick"
+ Server claims are now also generated per request so this could get some benefit from caching the jwt
One idea is to cache a jwt for a temporary amount of time
+ event! macro also lets us generate json payloads more easily
! Still requiring this module to built under an optional feature however that should be done easily
+ Rtc server takes in new-message correctly but with basically no ux/auth for now
This should be fine as we can layer on security afterwards with no issue