Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActivityPub Video attributedTo field malformed #2704

Open
koehn opened this issue Apr 29, 2020 · 3 comments
Open

ActivityPub Video attributedTo field malformed #2704

koehn opened this issue Apr 29, 2020 · 3 comments
Labels
Component: Federation 🎡 Status: Blocked ✋ Somehow, somewhere *else*, something has gone very wrong. Until they fix it we're stuck. Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor

Comments

@koehn
Copy link

koehn commented Apr 29, 2020

What happened?
When fetching videos, the attributedTo looks like this:

  "attributedTo": [
    {
      "type": "Person",
      "id": "https://peertube.koehn.com/accounts/bkoehn"
    },
    {
      "type": "Group",
      "id": "https://peertube.koehn.com/video-channels/39ddd8e5-1938-410b-9d4d-6d64d79f82fa"
    }
  ],

I believe this is malformed; the objects in attributedTo should be either complete objects, Links, or ids. Honestly I'd be happy with just the author; this is how most ActivityPub applications handle it.

What do you expect to happen instead?

  "attributedTo": [
   "https://peertube.koehn.com/accounts/bkoehn",
   "https://peertube.koehn.com/video-channels/39ddd8e5-1938-410b-9d4d-6d64d79f82fa"
  ],

Steps to reproduce:

  1. curl -H 'Accept: application/ld+json' https://peertube.koehn.com/videos/watch/72fde0c4-933f-4148-aced-921f362c970d

Additional information

  • PeerTube version or URL: chocobozzz/peertube:production-buster

  • Browser name/version: n/a

  • NodeJS version: chocobozzz/peertube:production-buster

  • Link to browser console log if useful:

  • Link to server log if useful (journalctl or /var/www/peertube/storage/logs/):

@Chocobozzz Chocobozzz added Component: Federation 🎡 Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor labels Apr 30, 2020
@tcitworld
Copy link
Collaborator

What are complete objects? An AS object "needs" basically only type and id properties. That's the JSON-LD part, following what's at the URI behind id to have the full object is up to your implementation.
This form allows knowing right away what's the type of actors without an extra fetch. It may not be the best, but it's not malformed.
https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attributedto also shows a similar form.

@koehn
Copy link
Author

koehn commented Apr 30, 2020

What are complete objects? An AS object "needs" basically only type and id properties.

A fair question; I would define "complete" as including all the fields that your server has on the object; no different than if the object had been requested by its ID. "Partial" or "incomplete" in this context means that a subset of that information is included.

How is a client to know that a server only sends part of the object, and that they should request the information again to get the complete object? There’s no information there indicating that the object is incomplete.

My use case is a client that inter-operates with users on various servers; when trying to render an object from PeerTube it follows a typical algorithm: retrieve the attributedTo and resolve it to an object using a standard that works for literally every other Object reference: if it’s a string, assume it’s an ID and pull it, if it’s a Link, pull the href, if it’s a JSON object, believing that it is, in fact, the entire object, if it’s an array, repeat the preceding logic for each element of the array. But with PeerTube’s attributedTo this logic fails, because PeerTube sends a partial object.

I understand why you’re doing what you’re doing, but I think it would be better to send a Link object with an additional field indicating the actor type; that would allow clients that know they’re talking to a PeerTube server to look for that field and act accordingly, and clients that don’t know about PeerTube would know that they’d have to pull the href to actually get the object.

@Chocobozzz
Copy link
Owner

Chocobozzz commented Jun 5, 2023

Hello,

We should handle attributedTo: string[] with fccda97
In the future, we'll be able to add a federation breaking change by correctly send the attributedTo field

@Chocobozzz Chocobozzz added the Status: Blocked ✋ Somehow, somewhere *else*, something has gone very wrong. Until they fix it we're stuck. label Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Federation 🎡 Status: Blocked ✋ Somehow, somewhere *else*, something has gone very wrong. Until they fix it we're stuck. Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor
Projects
None yet
Development

No branches or pull requests

3 participants