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
* add_neighbor now takes a moved Neighbor param instead of the fields individually
This should make it a easier for both front & backend to parse what's happening.
It also let's us leveraege serde_json a bit more
! put /neighbor/update is failing due to a failure to parse the body correctly on thebackend
Further investigation is required
+ Kinda minor but I'm also adding the ability to `put` things now
+ Also an if statement to avoid failing on checkf for NoneType responses
diesel still requires this however the --database-url flag is there to alleviate this issue
+ make test now cleans up fake png images from the cwd
This is more for comfort reall
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.
It should be noted at this point we're considering url's as the "primary key"
even though its kinda weird to use them that way.
Even though a varchar primary key doesn't really scale well I'm considering it
fine for now as the neighbors table is controlled by admins(by hand) and hopefully
won't need to scale.
These are baseline tests however a new /neighbor/remove & /neighbor/edit route should be edited before I call this done on the roadmap.
Also some more intense testing around these current routes is required.
Mostly because the expectation that JSON is being sent to us in /neighbor/add
It could be worth the effort to send this data as json in the body
! Currently parameters are sent via the query string is in line with how most routes behave
For this route is just feels weird dealing with al the issues with json in the query string
* Hopefully fixing pipeline script
Cargo kept trying to rebuild everything so hopefully the new change
forces a usage of artifacts that _should_ be there
+ More error handling in case shit goes wrong
Basically handling more cases where some initial test could result in the whole
script exiting with code(1)
Not really that big of a deal since most tests after _that_ point will fail anyway
but the fix has revealed issues in the auth code magically so I'm keeping up with the new idea
that initial tests should have every resultant case validated to avoid weird behavior
> good code results in good results
who would have guessed
* 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
This dep was already there but just being used (as we're using serde). Now we can use it at the db layer which makes neighbor struct creation easier
* Cargo locks are being updated to reflect new dependancy changes
These changes actually reduce the dependancy count overall
+ Adding a very simple table to hold all the neighbors that an instance may want to reference
At some point we may want to support vanity join urls and this would be a good place to reference those
There would also need to be a way for admins to add/edit/remove vanity urls but that's for another patch
Was basically pointless since it's literally just two commands
! full-mock-test job now has scripts/run-api-tests.sh as its source code
This makes it way easier to debug the pipeline when things go wrong as there's
lots of _different_ things going on in that script.
While the script itself is still there it is completely deprecated and safe to remove
at this point
! PAIN Peko
Dependancies might be fucked because gitlab-runner doesn't use deps at all and frankly
I'm completely over doing this stupid patch. Next is decentralized features which is way
more fun to do so if it breaks I'll fix it but its likely an issue with artifacts
* Removing export command from cargo-unit-test job
This was causing the job to fail so the env vars have been moved to live under
the ci file's job-level variables key
* Also I've updated the docker image that this pipeline uses as it didn't have node
and pip installed for some reason
Link to relevant docker image: https://hub.docker.com/r/shockrah/fc-pipeline
* Increasing expries_in flags to be 30 minutes from 15
+ Adding build-keys job which builds hmac keys
+ build-rtc-server: simple build job
* Moving cargo-test-json-api (unit tests) to the bottom with the other tests
! full-mock-tests are now implemented so its time to watch them fail horribly
+ Adding new bootstrapping script for Docker testing pipeline
This build-database script is what is going to setup things like our tables for us
so that we can actually run our test queries
! Basically turning off the ci right now since its going through some large breaking changes
It's going to be broken for a while so there's no point in running it into
a wall of predictable failures
+ 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