Add more checks in inbox, plus some refactoring #76

Merged
dessalines merged 6 commits from more-inbox-permissions into main 1 year ago
nutomic commented 1 year ago
Owner

This is just a bit of high-level stuff. In the next step, I will have to call check_is_apub_id_valid() on every apub id that is coming in through an activity.

Note that some federation tests are currently failing.

Edit: Fixed all federation tests.

This is just a bit of high-level stuff. In the next step, I will have to call `check_is_apub_id_valid()` on every apub id that is coming in through an activity. Note that some federation tests are currently failing. Edit: Fixed all federation tests.
nutomic changed title from WIP: Add more checks in inbox, plus some refactoring to Add more checks in inbox, plus some refactoring 1 year ago
Poster
Owner

Ready for review. Note the commit message for the Claims::decode commit. Not sure if there is anything else thats worth extracting in the API.

Ready for review. Note the commit message for the Claims::decode commit. Not sure if there is anything else thats worth extracting in the API.
dessalines reviewed 1 year ago
};
let user_id = claims.id;
let user = get_user_from_jwt(&data.auth, pool).await?;
Poster
Owner

Def a lot easier.

Def a lot easier.
dessalines reviewed 1 year ago
let user = blocking(pool, move |conn| User_::read(conn, user_id)).await??;
// Check for a site ban
if user.banned {
return Err(APIError::err("site_ban").into());
Poster
Owner

Ah I see. Checking for a site ban here.

Yeah I forget which actions I allowed for those who were banned before, but they probably weren't important. And its probably best to block all actions bc it could potentially be spam anyway.

Ah I see. Checking for a site ban here. Yeah I forget which actions I allowed for those who were banned before, but they probably weren't important. And its probably best to block all actions bc it could potentially be spam anyway.
Owner

Looks good, and all the tests passed.

Looks good, and all the tests passed.
dessalines merged commit 76cd6ac6bc into main 1 year ago
The pull request has been merged as 76cd6ac6bc.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.