Switch to Trolley for Modrinth Payments (#727)

* most of trolley

* Switch to trolley for payments

* run prepare

* fix clippy

* fix more

* Fix most tests + bitflags

* Update src/auth/flows.rs

Co-authored-by: Jackson Kruger <jak.kruger@gmail.com>

* Finish trolley

* run prep for merge

* Update src/queue/payouts.rs

Co-authored-by: Jackson Kruger <jak.kruger@gmail.com>

---------

Co-authored-by: Jackson Kruger <jak.kruger@gmail.com>
This commit is contained in:
Geometrically
2023-10-11 15:55:01 -07:00
committed by GitHub
parent f1ff88f452
commit 07ecd13554
41 changed files with 1719 additions and 1461 deletions

View File

@@ -70,24 +70,6 @@ async fn user_scopes() {
.await
.unwrap();
// User payout info writing
let failure_write_user_payout = Scopes::all() ^ Scopes::PAYOUTS_WRITE; // Failure case should include USER_WRITE
let write_user_payout = Scopes::USER_WRITE | Scopes::PAYOUTS_WRITE;
let req_gen = || {
TestRequest::patch().uri("/v2/user/user").set_json(json!( {
"payout_data": {
"payout_wallet": "paypal",
"payout_wallet_type": "email",
"payout_address": "test@modrinth.com"
}
}))
};
ScopeTest::new(&test_env)
.with_failure_scopes(failure_write_user_payout)
.test(req_gen, write_user_payout)
.await
.unwrap();
// User deletion
// (The failure is first, and this is the last test for this test function, we can delete it and use the same PAT for both tests)
let delete_user = Scopes::USER_DELETE;