Skip to content
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

fedi wiki

  1. Home
  2. ActivityPub Protocol
  3. Boundaries between AP and AS2, and between AS2 and non-AS2

Boundaries between AP and AS2, and between AS2 and non-AS2

Scheduled Pinned Locked Moved ActivityPub Protocol
13 Posts 5 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • silverpill@mitra.socialS silverpill@mitra.social

    The inherent assumption is that any id will have an AS2 representation, but this isn't a valid assumption, because non-AS2 resources exist on the Web (and in fact vastly outnumber AS2 resources).

    Every id value is expected to be an identifier of an ActivityPub object. When it resolves to something else, like an HTML document, we conclude that the identifier is not valid.

    Fediverse != Web

    Hong Minhee, who develops the Fedify library, indicated that overriding the term definition of "href" to be a literal string instead of a URI reference was intended to avoid dereferencing ids that don't have AS2 representations.

    @hongminhee So, Fedify returns a string and delegates the decision to the user?

    Sounds reasonable. By default, hrefs do not point to ActivityPub objects.

    hongminhee@hollo.socialH This user is from outside of this forum
    hongminhee@hollo.socialH This user is from outside of this forum
    hongminhee@hollo.social
    wrote last edited by
    #4

    @silverpill

    So, Fedify returns a string and delegates the decision to the user?

    Yes, more accurately, it returns a URL object which is a scalar value.

    @trwnh @protocol

    1 Reply Last reply
    0
    • trwnh@socialhub.activitypub.rocksT trwnh@socialhub.activitypub.rocks

      Also available at:

      • https://lists.w3.org/Archives/Public/public-swicg/2026May/0017.html
      • https://lists.w3.org/Archives/Public/public-socialweb/2026May/0002.html

      Context:

      • https://github.com/w3c/activitystreams/issues/595
      • https://lists.w3.org/Archives/Public/public-swicg/2026May/0015.html
      • https://lists.w3.org/Archives/Public/public-socialweb/2026May/0001.html

      In earlier discussion regarding how people expect a Link to work, it seems to me like we uncovered a sort of X-Y issue. Hong Minhee, who develops the Fedify library, indicated that overriding the term definition of "href" to be a literal string instead of a URI reference was intended to avoid dereferencing ids that don't have AS2 representations. The inherent assumption is that any id will have an AS2 representation, but this isn't a valid assumption, because non-AS2 resources exist on the Web (and in fact vastly outnumber AS2 resources).

      Across the specification documents for AS2-Core, AS2-Vocab, and AP, the only remotely relevant language I could find was in AP Section 3.2 "Retrieving objects":

      The HTTP GET method may be dereferenced against an object's id property to retrieve the activity. Servers MAY use HTTP content negotiation as defined in [RFC7231] to select the type of data to return in response to a request, but MUST present the ActivityStreams object representation in response to application/ld+json; profile="https://www.w3.org/ns/activitystreams", and SHOULD also present the ActivityStreams representation in response to application/activity+json as well. The client MUST specify an Accept header with the application/ld+json; profile="https://www.w3.org/ns/activitystreams" media type in order to retrieve the activity. Servers MAY implement other behavior for requests which do not comply with the above requirement

      From this, we can see that there is no explicit requirement for every id in an AS2 document to be dereferenceable with an AS2 representation. At most, we can say that ActivityPub requires "clients" to use an Accept header, and "servers" MUST/SHOULD present the AS2 representation when they see this Accept header. But publishers of AS2 documents or AP activities are not required to only use ids of resources necessarily bearing an AS2 representation. I don't think this is something we can feasibly require, either, as doing so effectively amounts to forking the Web.

      Recently, I filed some issues against AS2 regarding these uncertainties:

      • https://github.com/w3c/activitystreams/issues/718 notes that AS2 documents don't have a default processing model, although we could define one or more such processing models.
      • https://github.com/w3c/activitystreams/issues/724 notes that fetching additional information is left unspecified -- for https: ids we can gather that the HTTPS protocol can be used to issue an HTTP GET, as described in AP Section 3.2. But it might make a lot of sense to recommend that AS2 documents are relatively self-contained, and that publishers should include enough useful information without requiring consumers to fetch additional information. However, it might be useful or necessary to fetch additional information (similar to how many HTML browsers will also fetch rel=stylesheet links on behalf of their users).
      • https://github.com/w3c/activitystreams/issues/726 notes that content negotiation can affect the returned representation that you might try to fetch per issue 724. Neither JSON-LD nor the World Wide Web require referenced resources to have any particular/specific Content-Type, and so if AS2 or AP is to place such a requirement, then it's unclear where it would be placed or how it would be made feasible.

      Previously, https://w3id.org/fep/e232 proposed "object links" as a potential way to reduce this ambiguity, under the assumption that a Link.mediaType could not only hint that a representation existed for a certain Content-Type, but that you could (or should?) also use this hint with an Accept header in order to obtain that representation with a specific Content-Type.

      https://datatracker.ietf.org/doc/html/rfc8288 notes several times that attributes of links are only hints -- they do not guarantee a representation exists, and they do not tell you whether content negotiation is needed.

      Therefore, I would like to expand my previous question, and invite further discussion about the larger issue. It's not simply about whether anyone uses (or doesn't use) the as:Link class anymore; there is a much more fundamental issue about how any link is expected to be used, even (or especially) direct linked data references as are present everywhere in an AS2 document.

      trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
      trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
      trwnh@socialhub.activitypub.rocks
      wrote last edited by
      #5

      Originally posted at:

      • https://lists.w3.org/Archives/Public/public-swicg/2026May/0019.html
      • https://lists.w3.org/Archives/Public/public-socialweb/2026May/0004.html

      In the default https: instantiation, ActivityPub says objects have ids and may be dereferenced with a specific Accept header. It does not say that all ids are objects in this way, however. Properties can have JSON string values that are ids; are those necessarily AP objects? Do they necessarily dereference to AS2 documents or representations?

      If we say yes and conclude all ids referenced by ActivityPub objects MUST also be ActivityPub objects, then this entails the following:

      • (1) Not all AS2 documents are AP objects, because they can refer to non-AP objects.
      • (2) AP publishers and consumers cannot be sure whether they are working with an AP object or an AS2 document, because all AP objects are serialized as AS2 documents, and you can't tell which AS2 documents are also AP objects, but per (1) some AS2 documents are non-AP.
      • (3) AP is a fork of the Web, because it cannot be used to talk about anything on the Web unless it has an AS2 representation that is an AP object.

      These all seem like contentious things to say!

      If we say no and conclude that some ids referenced by ActivityPub objects might not be ActivityPub objects, then we can maintain that AP is compatible with the Web, and it's just a way to publish activities as AS2 documents. Less things break fundamentally, at the cost of uncertainty.

      But if there's uncertainty, then we can try to clarify it. That's what this thread is asking -- is there a way to be more explicitly clear about the boundaries of an AS2 document?

      We can try to do this in a few ways:

      • Publishers author reasonably complete AS2 documents that already contain the information needed to process them, without loading any linked resources. Consumers MAY browse those links like any web browser, but they can't expect AS2 in every case.
      • Publishers might annotate certain ids as having AS2 representations; consumers check for this before loading more information.
      • A processing model for AS2 defines that all linked resources expected to be dereferenced are marked up as a special form of reified as:Link. Perhaps with a certain link rel or mediaType, consumers can know which links to more safely load. AS2 processors wishing to comvert AS2 documents to JSON-LD or vice-versa need to reify or unreify any as:Link as appropriate.

      In practice, that might end up being the difference between this:

      {"actor": "https://alice.example/#alice"}

      And this:

      {"actor": {"type": "Person", "url": {"href": "https://alice.example/#alice"}}}

      You could even do this:

      { "actor": { "id": "https://alice.example/", "type": "Person", "url": [{ "href": "https://alice.example/#alice", "mediaType": "application/activity+json", "rel": "self" }, { "href": "https://alice.example/#alice", "mediaType": "text/html", "rel": "self" }] }}

      But this leaves two follow-up questions:

      • What is the link context of an as:Link? Can it be assumed to be the current AS2 document, or the current node? This matters for the rel=self link. https://github.com/w3c/activitystreams/issues/665
      • How can we bridge the gap from mediaType being a "hint" to being an indication that content negotiation is required and that it should be used with an Accept header? https://github.com/w3c/activitystreams/issues/726
      1 Reply Last reply
      0
      • stevebate@socialhub.activitypub.rocksS stevebate@socialhub.activitypub.rocks
        trwnh:

        fundamental issue about how any link is expected to be used, even (or especially) direct linked data references as are present everywhere in an AS2 document

        It difficult to answer because there are different mental models of AS2:

        • JSON documents (constrained to look like JSON-LD, but not actually meant to be JSON-LD)
        • JSON-LD serialization of RDF subgraphs (for communication, storage and other purposes).
        • Some kind of HTML-ish/WWW document
        • …

        If AS2 is serialized RDF then a “link” is an edge in the RDF graph. A JSON-LD “direct link” just means the RDF object was not embedded in a specific subgraph serialization. Note that, even if the RDF object is embedded in the serialization, there’s still a link when the representation is deserialized back to RDF.

        I agree that an AS2 link, in this RDF sense, is not required to refer to resources with a specific media type. In other words, they are not required to only reference AS2 documents.

        (Side note: from this perspective, as:Link is a reified “link” or relationship. The as:Link objects’s href property should be an @id, because it’s a reference to a resource. See also: When use a literal for a URI in Linked Data)

        If AS2 is considered to be plain JSON, then the meaning of “link” becomes relatively muddled for me. It’s even more muddled if one interprets AS2 as HTML rather than Linked Data. Note that AS2 can be used in ways that have no relationship to the HTML/HTTP Web. Although the AS2 spec describes as:Link as being closely related to the concepts in RFC5988, “closely related” means “somewhat different”. However, the differences are not clearly described so this just leads to more confusion IMO.

        trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
        trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
        trwnh@socialhub.activitypub.rocks
        wrote last edited by
        #6
        stevebate:

        there are different mental models of AS2 If AS2 is considered to be plain JSON, then the meaning of “link” becomes relatively muddled for me

        Yeah -- even for people who understand the difference between a direct link and an indirect/reified Link, there's still uncertainty about when you would want to use one or the other. "You can describe properties of the link/reference" is something that makes sense in the abstract but it depends on a processing model to make sense in practice. as:Link feels like it's largely unused in AS2 documents across the fediverse; most links are direct links by way of using AS2 properties with non-embedded objects. (For example, when "actor" and "object" are JSON strings instead of as:Link nodes.)

        silverpill:

        Every id value is expected to be an identifier of an ActivityPub object. When it resolves to something else, like an HTML document, we conclude that the identifier is not valid.

        • Do you expect every AS2 document to be an ActivityPub object?
        • Do you dereference every id to make sure of what it resolves to?
        • If some id doesn't have an AS2 representation, do you:
          • ...discard the entire activity?
          • ...discard that particular statement?
          • ...process the statement as-is without further information?
        silverpill:

        Fediverse != Web

        One can certainly claim this (and they might not be fully incorrect per se), but then it leads to asking if AP == AS2 == Fediverse, or if AP == Web != Fediverse != AS2. At least in theory, AP and AS2 are intended to be Web specifications published by the W3C under the Social Web WG.

        silverpill:

        By default, hrefs do not point to ActivityPub objects.

        Would you then say something like this?

        • If an id is the "href" of a Link, then it can have representations not including AS2.
        • Otherwise, an id (SHOULD? MUST? MAY? is expected to without being required to?) have an AS2 representation.

        We currently don't require this, and there is no processing model defined for AS2 documents. AP implies a partial processing model that includes retrieving objects via their id, but this is only for AP, and it only applies when the id is an object id. So you could read it as applying to this:

        { "actor": {"id": "https://alice.example/#alice", "type": "Person"}}

        But maybe not this (unless you somehow infer this is an Object, which by default can't be done while the range of "actor" is Object | Link):

        { "actor": "https://alice.example/#alice"}

        And maybe not this either (unless you assume the "href" is an object):

        { "actor": { "url": { "href": "https://alice.example/#alice" } }}
        stevebate@socialhub.activitypub.rocksS silverpill@socialhub.activitypub.rocksS 2 Replies Last reply
        0
        • trwnh@socialhub.activitypub.rocksT trwnh@socialhub.activitypub.rocks
          stevebate:

          there are different mental models of AS2 If AS2 is considered to be plain JSON, then the meaning of “link” becomes relatively muddled for me

          Yeah -- even for people who understand the difference between a direct link and an indirect/reified Link, there's still uncertainty about when you would want to use one or the other. "You can describe properties of the link/reference" is something that makes sense in the abstract but it depends on a processing model to make sense in practice. as:Link feels like it's largely unused in AS2 documents across the fediverse; most links are direct links by way of using AS2 properties with non-embedded objects. (For example, when "actor" and "object" are JSON strings instead of as:Link nodes.)

          silverpill:

          Every id value is expected to be an identifier of an ActivityPub object. When it resolves to something else, like an HTML document, we conclude that the identifier is not valid.

          • Do you expect every AS2 document to be an ActivityPub object?
          • Do you dereference every id to make sure of what it resolves to?
          • If some id doesn't have an AS2 representation, do you:
            • ...discard the entire activity?
            • ...discard that particular statement?
            • ...process the statement as-is without further information?
          silverpill:

          Fediverse != Web

          One can certainly claim this (and they might not be fully incorrect per se), but then it leads to asking if AP == AS2 == Fediverse, or if AP == Web != Fediverse != AS2. At least in theory, AP and AS2 are intended to be Web specifications published by the W3C under the Social Web WG.

          silverpill:

          By default, hrefs do not point to ActivityPub objects.

          Would you then say something like this?

          • If an id is the "href" of a Link, then it can have representations not including AS2.
          • Otherwise, an id (SHOULD? MUST? MAY? is expected to without being required to?) have an AS2 representation.

          We currently don't require this, and there is no processing model defined for AS2 documents. AP implies a partial processing model that includes retrieving objects via their id, but this is only for AP, and it only applies when the id is an object id. So you could read it as applying to this:

          { "actor": {"id": "https://alice.example/#alice", "type": "Person"}}

          But maybe not this (unless you somehow infer this is an Object, which by default can't be done while the range of "actor" is Object | Link):

          { "actor": "https://alice.example/#alice"}

          And maybe not this either (unless you assume the "href" is an object):

          { "actor": { "url": { "href": "https://alice.example/#alice" } }}
          stevebate@socialhub.activitypub.rocksS This user is from outside of this forum
          stevebate@socialhub.activitypub.rocksS This user is from outside of this forum
          stevebate@socialhub.activitypub.rocks
          wrote last edited by
          #7
          trwnh:

          At least in theory, AP and AS2 are intended to be Web protocols published by the W3C under the Social Web WG.

          I don’t believe that AS2 is, or was intended to be, a protocol. The spec describes the goal was to…

          provide a JSON-based syntax that is sufficient to express metadata about activities in a rich, human-friendly but machine-processable and extensible manner. This can include constructing natural-language descriptions or visual representations about the activity, associating actionable information with various types of objects, communicating or recording activity logs, or delegation of potential actions to other applications.

          For me, syntax != protocol.

          trwnh:

          there is no processing model defined for AS2 documents.

          Although it’s impossible to know without defining “processing model”, I think this is a dubious claim. There’s the JSON-LD processing model and, in a Linked Data context, there’s the RDF processing model. It’s very possible that those models are not sufficient for Fediverse/AP purposes, but that’s a different claim than that there’s processing model at all.

          EDIT: Just saw this in the AS2 spec:

          this specification does not define a normative processing model that constrains how applications make use of the format, the distinction about whether an Activity statement is to be interpreted as a passive notification or as an imperative command can vary across implementations.

          So, if by “processing model”, you mean “application processing model”, then I understand the original claim. However, I wouldn’t expect AS2 to define application-specific processing models.

          Also, what do you mean by “boundaries” in this discussion. I can’t determine if you are asking about what objects should be embedded or not in AS2 serializations (the “boundary” of a serialized subgraph that’s then published using AP) or is “boundary” the links between AS2 objects and/or other resources. Or both? Or something else?

          trwnh@socialhub.activitypub.rocksT 1 Reply Last reply
          0
          • trwnh@socialhub.activitypub.rocksT trwnh@socialhub.activitypub.rocks
            stevebate:

            there are different mental models of AS2 If AS2 is considered to be plain JSON, then the meaning of “link” becomes relatively muddled for me

            Yeah -- even for people who understand the difference between a direct link and an indirect/reified Link, there's still uncertainty about when you would want to use one or the other. "You can describe properties of the link/reference" is something that makes sense in the abstract but it depends on a processing model to make sense in practice. as:Link feels like it's largely unused in AS2 documents across the fediverse; most links are direct links by way of using AS2 properties with non-embedded objects. (For example, when "actor" and "object" are JSON strings instead of as:Link nodes.)

            silverpill:

            Every id value is expected to be an identifier of an ActivityPub object. When it resolves to something else, like an HTML document, we conclude that the identifier is not valid.

            • Do you expect every AS2 document to be an ActivityPub object?
            • Do you dereference every id to make sure of what it resolves to?
            • If some id doesn't have an AS2 representation, do you:
              • ...discard the entire activity?
              • ...discard that particular statement?
              • ...process the statement as-is without further information?
            silverpill:

            Fediverse != Web

            One can certainly claim this (and they might not be fully incorrect per se), but then it leads to asking if AP == AS2 == Fediverse, or if AP == Web != Fediverse != AS2. At least in theory, AP and AS2 are intended to be Web specifications published by the W3C under the Social Web WG.

            silverpill:

            By default, hrefs do not point to ActivityPub objects.

            Would you then say something like this?

            • If an id is the "href" of a Link, then it can have representations not including AS2.
            • Otherwise, an id (SHOULD? MUST? MAY? is expected to without being required to?) have an AS2 representation.

            We currently don't require this, and there is no processing model defined for AS2 documents. AP implies a partial processing model that includes retrieving objects via their id, but this is only for AP, and it only applies when the id is an object id. So you could read it as applying to this:

            { "actor": {"id": "https://alice.example/#alice", "type": "Person"}}

            But maybe not this (unless you somehow infer this is an Object, which by default can't be done while the range of "actor" is Object | Link):

            { "actor": "https://alice.example/#alice"}

            And maybe not this either (unless you assume the "href" is an object):

            { "actor": { "url": { "href": "https://alice.example/#alice" } }}
            silverpill@socialhub.activitypub.rocksS This user is from outside of this forum
            silverpill@socialhub.activitypub.rocksS This user is from outside of this forum
            silverpill@socialhub.activitypub.rocks
            wrote last edited by
            #8
            trwnh:

            Do you expect every AS2 document to be an ActivityPub object?

            Yes. I don't think of AP and AS2 as separate things, and in my view, any contradictions between the two are specification bugs.

            trwnh:

            Do you dereference every id to make sure of what it resolves to?

            No, that would be impractical. I resolve id values only when an object needs to be authenticated (for example, when it is not signed). I resolve id-ish values (such as inReplyTo) only when that is required by application logic.

            trwnh:

            If some id doesn’t have an AS2 representation, do you:

            • …discard the entire activity?
            • …discard that particular statement?
            • …process the statement as-is without further information?

            In most cases, the entire activity is discarded. An activity is not very useful if you can't authenticate it or resolve its actor. But sometimes only a particular statement is discarded.

            trwnh:

            Would you then say something like this?

            • If an id is the “href” of a Link, then it can have representations not including AS2.
            • Otherwise, an id (SHOULD? MUST? MAY? is expected to without being required to?) have an AS2 representation.

            How href can be an id? What I mean is that in JSON-verse, href is not considered an id-ish property. FEP-e232 is an exception to this rule.

            trwnh@socialhub.activitypub.rocksT 1 Reply Last reply
            0
            • stevebate@socialhub.activitypub.rocksS stevebate@socialhub.activitypub.rocks
              trwnh:

              At least in theory, AP and AS2 are intended to be Web protocols published by the W3C under the Social Web WG.

              I don’t believe that AS2 is, or was intended to be, a protocol. The spec describes the goal was to…

              provide a JSON-based syntax that is sufficient to express metadata about activities in a rich, human-friendly but machine-processable and extensible manner. This can include constructing natural-language descriptions or visual representations about the activity, associating actionable information with various types of objects, communicating or recording activity logs, or delegation of potential actions to other applications.

              For me, syntax != protocol.

              trwnh:

              there is no processing model defined for AS2 documents.

              Although it’s impossible to know without defining “processing model”, I think this is a dubious claim. There’s the JSON-LD processing model and, in a Linked Data context, there’s the RDF processing model. It’s very possible that those models are not sufficient for Fediverse/AP purposes, but that’s a different claim than that there’s processing model at all.

              EDIT: Just saw this in the AS2 spec:

              this specification does not define a normative processing model that constrains how applications make use of the format, the distinction about whether an Activity statement is to be interpreted as a passive notification or as an imperative command can vary across implementations.

              So, if by “processing model”, you mean “application processing model”, then I understand the original claim. However, I wouldn’t expect AS2 to define application-specific processing models.

              Also, what do you mean by “boundaries” in this discussion. I can’t determine if you are asking about what objects should be embedded or not in AS2 serializations (the “boundary” of a serialized subgraph that’s then published using AP) or is “boundary” the links between AS2 objects and/or other resources. Or both? Or something else?

              trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
              trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
              trwnh@socialhub.activitypub.rocks
              wrote last edited by
              #9
              stevebate:

              syntax != protocol.

              Sorry, the sentence was initially about AP only, but I later added a mention of AS2 and forgot to change "protocols" to "specifications". Post edited.

              stevebate:

              without defining “processing model”, I think this is a dubious claim EDIT: Just saw this in the AS2 spec

              Yes, "processing model" here means "what do I do with an AS2 document"; "how do I process an AS2 document". Right now, the AS2 document format only provides semantics. (I think AS2 could be profiled to include processing concerns/constraints, but that isn't inherently part of AS2 by default.)

              stevebate:

              what do you mean by “boundaries” in this discussion. I can’t determine if you are asking about what objects should be embedded or not in AS2 serializations (the “boundary” of a serialized subgraph that’s then published using AP) or is “boundary” the links between AS2 objects and/or other resources. Or both? Or something else?

              All of the above? Boundaries between the concepts, mainly. For someone adopting or adhering to AS2 but not AP, there are some considerations or requirements that are part of AP but not part of AS2. And in AP, there is an implicit expectation in "Retrieving objects" that objects can be retrieved as AS2 representations, as well as an expectation that some/most objects have an "id" property, but no explicit requirement that you can only talk about resources with an AS2 representation. For example:

              { "actor": "https://alice.example/#alice", "type": "Announce", "object": "https://apnews.com/article/reading-math-test-scores-education-scorecard-7fa4111ad0de934f664ebb984e830d13"}

              Or:

              { "type": "Person", "icon": "https://alice.example/icon.png"}

              These could be considered "invalid", because and might not have AS2 representations. But those links could still be browsed by an HTTPS agent.

              On the other hand, you can imagine some software discarding the entire Announce activity unless both alice.example and apnews.com serve those resources bearing an AS2 representation, while I'd argue they shouldn't be discarded; that is a minimal Announce activity that could still be processed. In AS2 terms, you are conveying the information; in AP terms, there isn't enough information to modify a shares collection unless you maintain your own shadow collection (using a local dataset or graph source), so it becomes a no-op (and simply bears AS2 information). You could render the AS2 information like so:

              https://alice.example/#alice shared https://apnews.com/article/reading-math-test-scores-education-scorecard-7fa4111ad0de934f664ebb984e830d13.

              Then insert that as a line-item in an activity stream or feed of some sort, whatever.

              In the icon case, someone reading the range of "icon" as Image | Link might infer that is an as:Image or a as:Link, but since AS2 documents can't have a Link as the top-level JSON object, it should be an as:Image. They dereference and are surprised to find something that isn't an AS2 document whose top-level object is an Image; instead, they find a PNG document. Consequently, the avatar or whatever gets rendered as an error square.

              1 Reply Last reply
              0
              • silverpill@socialhub.activitypub.rocksS silverpill@socialhub.activitypub.rocks
                trwnh:

                Do you expect every AS2 document to be an ActivityPub object?

                Yes. I don't think of AP and AS2 as separate things, and in my view, any contradictions between the two are specification bugs.

                trwnh:

                Do you dereference every id to make sure of what it resolves to?

                No, that would be impractical. I resolve id values only when an object needs to be authenticated (for example, when it is not signed). I resolve id-ish values (such as inReplyTo) only when that is required by application logic.

                trwnh:

                If some id doesn’t have an AS2 representation, do you:

                • …discard the entire activity?
                • …discard that particular statement?
                • …process the statement as-is without further information?

                In most cases, the entire activity is discarded. An activity is not very useful if you can't authenticate it or resolve its actor. But sometimes only a particular statement is discarded.

                trwnh:

                Would you then say something like this?

                • If an id is the “href” of a Link, then it can have representations not including AS2.
                • Otherwise, an id (SHOULD? MUST? MAY? is expected to without being required to?) have an AS2 representation.

                How href can be an id? What I mean is that in JSON-verse, href is not considered an id-ish property. FEP-e232 is an exception to this rule.

                trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
                trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
                trwnh@socialhub.activitypub.rocks
                wrote last edited by
                #10
                silverpill:

                I resolve id-ish values (such as inReplyTo) only when that is required by application logic.

                silverpill:

                What I mean is that in JSON-verse, href is not considered an id-ish property. FEP-e232 is an exception to this rule.

                I'm mainly talking about what you call "id-ish" -- when a property has a value that is a JSON string interpreted as a reference (@type: @id in the context).

                It sounds like you don't try to fetch those unless needed, which is good; I'm still not sure what your criteria for "needed" would be, though.

                So for example, with a document like this:

                { "inReplyTo": "https://apnews.com/article/reading-math-test-scores-education-scorecard-7fa4111ad0de934f664ebb984e830d13"}

                I imagine you would attempt to fetch the replied-to resource, fail to find an AS2 representation, and treat the currently-processing object as having a broken reply link (even if there are non-AS2 representations for the replied-to resource).

                With a document like this:

                { "type": "Article", "url": { "href": "https://apnews.com/article/reading-math-test-scores-education-scorecard-7fa4111ad0de934f664ebb984e830d13" }}

                I imagine you would leave it up to the user whether they want to follow that link or not.

                And for a document like this:

                { "tag": { "href": "https://apnews.com/article/reading-math-test-scores-education-scorecard-7fa4111ad0de934f664ebb984e830d13", "mediaType": "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"" }}

                I imagine you would take that as a hint to fetch the "href" with Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams", but if you instead encountered this document:

                { "tag": { "href": "https://apnews.com/article/reading-math-test-scores-education-scorecard-7fa4111ad0de934f664ebb984e830d13" }}

                Then I imagine you'd go back to letting the user decide whether to fetch it... or possibly ignore it, or possibly some other application-specific thing.

                silverpill@socialhub.activitypub.rocksS 1 Reply Last reply
                0
                • trwnh@socialhub.activitypub.rocksT trwnh@socialhub.activitypub.rocks
                  silverpill:

                  I resolve id-ish values (such as inReplyTo) only when that is required by application logic.

                  silverpill:

                  What I mean is that in JSON-verse, href is not considered an id-ish property. FEP-e232 is an exception to this rule.

                  I'm mainly talking about what you call "id-ish" -- when a property has a value that is a JSON string interpreted as a reference (@type: @id in the context).

                  It sounds like you don't try to fetch those unless needed, which is good; I'm still not sure what your criteria for "needed" would be, though.

                  So for example, with a document like this:

                  { "inReplyTo": "https://apnews.com/article/reading-math-test-scores-education-scorecard-7fa4111ad0de934f664ebb984e830d13"}

                  I imagine you would attempt to fetch the replied-to resource, fail to find an AS2 representation, and treat the currently-processing object as having a broken reply link (even if there are non-AS2 representations for the replied-to resource).

                  With a document like this:

                  { "type": "Article", "url": { "href": "https://apnews.com/article/reading-math-test-scores-education-scorecard-7fa4111ad0de934f664ebb984e830d13" }}

                  I imagine you would leave it up to the user whether they want to follow that link or not.

                  And for a document like this:

                  { "tag": { "href": "https://apnews.com/article/reading-math-test-scores-education-scorecard-7fa4111ad0de934f664ebb984e830d13", "mediaType": "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"" }}

                  I imagine you would take that as a hint to fetch the "href" with Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams", but if you instead encountered this document:

                  { "tag": { "href": "https://apnews.com/article/reading-math-test-scores-education-scorecard-7fa4111ad0de934f664ebb984e830d13" }}

                  Then I imagine you'd go back to letting the user decide whether to fetch it... or possibly ignore it, or possibly some other application-specific thing.

                  silverpill@socialhub.activitypub.rocksS This user is from outside of this forum
                  silverpill@socialhub.activitypub.rocksS This user is from outside of this forum
                  silverpill@socialhub.activitypub.rocks
                  wrote last edited by
                  #11

                  This is probably how things would work if I were to develop a high-level library similar to Fedify.

                  But I built APx, a low-level library. It is only aware of several special properties, such as id (which is used to authenticate fetched objects) and proof (which is used to verify FEP-8b32 signatures). The user decides what to do with other properties.

                  Mitra, on the other hand, attempts to follow inReplyTo and FEP-e232 references when it processes an object, but only because it cares about "posts". There are no general rules for id-ish properties and hrefs.

                  trwnh@socialhub.activitypub.rocksT 1 Reply Last reply
                  0
                  • silverpill@socialhub.activitypub.rocksS silverpill@socialhub.activitypub.rocks

                    This is probably how things would work if I were to develop a high-level library similar to Fedify.

                    But I built APx, a low-level library. It is only aware of several special properties, such as id (which is used to authenticate fetched objects) and proof (which is used to verify FEP-8b32 signatures). The user decides what to do with other properties.

                    Mitra, on the other hand, attempts to follow inReplyTo and FEP-e232 references when it processes an object, but only because it cares about "posts". There are no general rules for id-ish properties and hrefs.

                    trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
                    trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
                    trwnh@socialhub.activitypub.rocks
                    wrote last edited by
                    #12

                    But do you distinguish between "id" as a property vs an id as a property's value? Do you authenticate one but not the other? And if there isn't an AS2 representation do you conclude it's not authentic somehow?

                    silverpill@mitra.socialS 1 Reply Last reply
                    0
                    • trwnh@socialhub.activitypub.rocksT trwnh@socialhub.activitypub.rocks

                      But do you distinguish between "id" as a property vs an id as a property's value? Do you authenticate one but not the other? And if there isn't an AS2 representation do you conclude it's not authentic somehow?

                      silverpill@mitra.socialS This user is from outside of this forum
                      silverpill@mitra.socialS This user is from outside of this forum
                      silverpill@mitra.social
                      wrote last edited by
                      #13

                      But do you distinguish between "id" as a property vs an id as a property's value? Do you authenticate one but not the other?

                      I don't understand the question. An object is being authenticated, not its id. I mean this procedure described in FEP-fe34:

                      https://codeberg.org/fediverse/fep/src/branch/main/fep/fe34/fep-fe34.md#fetching-from-an-origin

                      And if there isn't an AS2 representation do you conclude it's not authentic somehow?

                      Non-AS(AP) representation would not be a part of protocol. It is neither authentic nor unauthentic, it is an external resource.

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      Powered by NodeBB Contributors
                      • First post
                        Last post