Fix tagpolicy to also work with Update #354

Closed
ilja wants to merge 0 commits from ilja/akkoma:fix_tagpolicy_to_also_work_on_updates into develop
Contributor

Fixes #340

Objects who got updated would just pass the TagPolicy, undoing the moderation that was set in place for the Actor.
Now we check not only for Create activities, but also Update activities.

I checked which other MRF's checked explicitly on type Create using grep '"type" => "Create"' lib/pleroma/web/activity_pub/mrf/* and fixed those in a similar way.

The following from that list who have not been changed:

  • lib/pleroma/web/activity_pub/mrf/follow_bot_policy.ex
    • Not relevant for moderation
  • lib/pleroma/web/activity_pub/mrf/keyword_policy.ex
    • Already had a test for Update
  • lib/pleroma/web/activity_pub/mrf/object_age_policy.ex
    • In practice only relevant when fetching old objects (e.g. through Like or Announce). These are always wrapped in a Create.
  • lib/pleroma/web/activity_pub/mrf/reject_non_public.ex
    • We don't allow changing scope with Update, so probably not relevant here
Fixes https://akkoma.dev/AkkomaGang/akkoma/issues/340 Objects who got updated would just pass the TagPolicy, undoing the moderation that was set in place for the Actor. Now we check not only for Create activities, but also Update activities. I checked which other MRF's checked explicitly on type Create using `grep '"type" => "Create"' lib/pleroma/web/activity_pub/mrf/*` and fixed those in a similar way. The following from that list who have not been changed: * lib/pleroma/web/activity_pub/mrf/follow_bot_policy.ex * Not relevant for moderation * lib/pleroma/web/activity_pub/mrf/keyword_policy.ex * Already had a test for Update * lib/pleroma/web/activity_pub/mrf/object_age_policy.ex * In practice only relevant when fetching old objects (e.g. through Like or Announce). These are always wrapped in a Create. * lib/pleroma/web/activity_pub/mrf/reject_non_public.ex * We don't allow changing scope with Update, so probably not relevant here
ilja added 1 commit 2022-12-08 20:57:10 +00:00
ci/woodpecker/pr/woodpecker Pipeline is pending Details
ce517ff4e5
Fix tagpolicy to also work with Update
Objects who got updated would just pass the TagPolicy, undoing the moderation that was set in place for the Actor.
Now we check not only for Create activities, but also Update activities.
ilja added 1 commit 2022-12-08 22:23:01 +00:00
ci/woodpecker/pr/woodpecker Pipeline failed Details
1f863f0a36
Fix MRF policies to also work with Update
Objects who got updated would just pass through several of the MRF policies, undoing moderation in some situations.
In the relevant cases we now check not only for Create activities, but also Update activities.

I checked which ones checked explicitly on type Create using `grep '"type" => "Create"' lib/pleroma/web/activity_pub/mrf/*`.

The following from that list have not been changed:
* lib/pleroma/web/activity_pub/mrf/follow_bot_policy.ex
    * Not relevant for moderation
* lib/pleroma/web/activity_pub/mrf/keyword_policy.ex
    * Already had a test for Update
* lib/pleroma/web/activity_pub/mrf/object_age_policy.ex
    * In practice only relevant when fetching old objects (e.g. through Like or Announce). These are always wrapped in a Create.
* lib/pleroma/web/activity_pub/mrf/reject_non_public.ex
    * We don't allow changing scope with Update, so not relevant here

oops, i may have broken the PR by attempting to fix the lint by trying to rebase on develop

praise gitea (https://github.com/go-gitea/gitea/issues/18802)

this looks good though - i'm going to hit merge but i'm gonna have to do it via the cli hehe

oops, i may have broken the PR by attempting to fix the lint by trying to rebase on develop praise gitea (https://github.com/go-gitea/gitea/issues/18802) this looks good though - i'm going to hit merge but i'm gonna have to do it via the cli hehe

merged via cli - d5828f1c5e

merged via cli - https://akkoma.dev/AkkomaGang/akkoma/commit/d5828f1c5e54ca236e50ef7837bfba3d1e665854
floatingghost closed this pull request 2022-12-09 10:31:51 +00:00
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed

Pull request closed

Sign in to join this conversation.
No description provided.