Normalise JSON-LD compacted public addressing #675
No reviewers
Labels
No labels
approved, awaiting change
bug
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs docs
needs tests
not a bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#675
Loading…
Reference in a new issue
No description provided.
Delete branch "Oneric:fedfix-public-ld"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes federation with bovine and implements the note from https://www.w3.org/TR/activitypub/#public-addressing explicitly pointing out all three forms are valid and equivalent.
It’s necessary to insert this normalisation early, even before the other
fix_addressing_*
calls, else the object will be rejected before it gets far enough. Since I’m not sure which AP data types can all contain addressing lists, the most reliable way seemed to be inserting JSON-LD normalisation as an earlier step before the pre-existinghandle_incoming
.To correctly get lists instead of bianreis etc, this also required moving some addressing fixes to this earlier step.
If there’s a more targeted way to integrate this without code duplication, let me know.
See #670 for more details.
Note: i only have a local, non-federating test instance, so this change was only ever tested with
mix test
To retroactively normalise already received objects and activities, the following query can be used (tested by manually editing some activities):
OR without temporary functions
Fixes #670
f8696d1204
tofd4cc5b17d
fd4cc5b17d
to73a531a2d0
Applied
mix format
(sorry forgot before) which led to more lines being re-indented from thedef handle_incoming
→defp handle_incoming_normalised
rename. Probably best to review with whitespace changes hidden to have less clutter73a531a2d0
to505e498b1a
seems sensible, just one cleanup you could do to remove hardcoded values
@ -76,0 +71,4 @@
defp normalise_addressing_public_list(map, all_fields)
defp normalise_addressing_public_list(%{} = map, [field | fields]) do
full_uri = "https://www.w3.org/ns/activitystreams#Public"
you can get this from Pleroma.Constants
https://akkoma.dev/AkkomaGang/akkoma/src/branch/develop/lib/pleroma/constants.ex#L8
fixed and rebased
505e498b1a
tob0a46c1e2e
merge conflict fixed and merged via
828158ef49
Pull request closed