activitypub: Do block checks more globally #299

Closed
norm wants to merge 4 commits from better-blocking into main
Owner

This should prevent objects from blocked instances from slipping through because of missed checks elsewhere.

Supersedes #298.

Changelog: Fixed

This should prevent objects from blocked instances from slipping through because of missed checks elsewhere. Supersedes https://akkoma.dev/FoundKeyGang/FoundKey/pulls/298. Changelog: Fixed
norm added 2 commits 2022-12-24 17:03:21 +00:00
activitypub: perform block check in performOneActivity
Some checks failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline failed
ci/woodpecker/pr/test Pipeline failed
3275ef3293
norm added the
fix
label 2022-12-24 17:07:46 +00:00
Johann150 reviewed 2022-12-24 20:10:01 +00:00
@ -38,6 +40,9 @@ export async function performActivity(actor: CacheableRemoteUser, activity: IObj
async function performOneActivity(actor: CacheableRemoteUser, activity: IObject, resolver: Resolver): Promise<void> {
if (actor.isSuspended) return;
const host = extractDbHost(getApId(activity));
Owner

The same may apply here, although I'm not sure if there can be transient activities at "root level"?

The same may apply here, although I'm not sure if there can be transient activities at "root level"?
norm marked this conversation as resolved
@ -50,3 +50,4 @@
throw new Error('resolvee is null (or undefined)');
}
const host = extractDbHost(typeof value === 'string' ? value : getApId(value));
Owner

Transient activities may not have an id. If getApId cannot determine an id it will throw an error. Because the resolver should be able to handle transient activities as well we might want to catch that error here.

Transient activities may not have an `id`. If `getApId` cannot determine an id it will throw an error. Because the resolver should be able to handle transient activities as well we might want to catch that error here.
norm marked this conversation as resolved
norm added 1 commit 2022-12-24 20:29:51 +00:00
check if activity has an id before doing block check
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline failed
ci/woodpecker/pr/test Pipeline failed
eaffa5c3b4
Johann150 added 1 commit 2022-12-24 23:02:16 +00:00
activitypub: block check for resolving collections
Some checks failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline failed
ci/woodpecker/pr/test Pipeline failed
34365732cd
Johann150 approved these changes 2022-12-24 23:02:46 +00:00
Author
Owner

merged in 09bc3cf95a

merged in 09bc3cf95a40dbe320d752cc41ff4b65d9adb41b
norm closed this pull request 2022-12-24 23:59:42 +00:00
norm deleted branch better-blocking 2022-12-24 23:59:46 +00:00
Some checks failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline failed
ci/woodpecker/pr/test Pipeline failed

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
feature
fix
upkeep
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#299
No description provided.