Skip to content
  • 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 (Darkly)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Uncategorized
  3. I think the #ActivityPub client-to-server API is extremely important and underrated.

I think the #ActivityPub client-to-server API is extremely important and underrated.

Scheduled Pinned Locked Moved Uncategorized
activitypubfediverse
109 Posts 11 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.
  • Steve BateS Steve Bate

    @mariusor @smallcircles @evan No animosity here. However, I’m not sure how to explain it more clearly. I’m referring to C2S as described in chapter 6 of the ActivityPub specification (and the conformance profiles in Section 2.1). It sounded to me like you’re using a more general definition of “client”, which is fine, just different in significant ways (if it only dereferences and renders AP data).

    🫧 socialcoding..S This user is from outside of this forum
    🫧 socialcoding..S This user is from outside of this forum
    🫧 socialcoding..
    wrote last edited by
    #76

    @steve @mariusor @evan

    He he, language is hard. A case of terminology overload and clashing terms. Domain driven design has the clearly defined bounded context here which is the scope within which terms are valid. Forming a consistency boundary. These context lines are blurred in fediverse talk. 😅

    Evan ProdromouE 1 Reply Last reply
    0
    • mariusM marius

      @thisismissem I have just implemented that for the GoActivityPub servers and it's easier than it sounds.

      The only important step required is to convert the client authorization token (presumably an OAuth2 bearer token) to a valid actor and then further to a valid Private Key with which to sign the remote request. After that the only thing remaining is to pipe verbatim the received response to the client...

      @steve @smallcircles @evan

      Emelia 👸🏻T This user is from outside of this forum
      Emelia 👸🏻T This user is from outside of this forum
      Emelia 👸🏻
      wrote last edited by
      #77

      @mariusor @steve @smallcircles @evan well, your server *knows* it's access token to user mapping, so then you're just doing authorised fetch as that actor from server side

      mariusM 1 Reply Last reply
      2
      0
      • Ben Pate 🤘🏻B Ben Pate 🤘🏻

        @thisismissem @steve @mariusor @smallcircles @evan

        Just checking my memory.. this concept exists already, yes?

        https://www.w3.org/wiki/ActivityPub/Primer/proxyUrl_endpoint

        Are you just saying that the new API spec should include this? Or am I missing something?

        Emelia 👸🏻T This user is from outside of this forum
        Emelia 👸🏻T This user is from outside of this forum
        Emelia 👸🏻
        wrote last edited by
        #78

        @benpate @steve @mariusor @smallcircles @evan i'm not sure proxyUrl does what I'm thinking of here

        1 Reply Last reply
        1
        0
        • Evan ProdromouE Evan Prodromou

          @benpate @thisismissem @steve @mariusor @smallcircles

          Yes, proxyUrl already exists. There's a use case here:

          https://github.com/swicg/activitypub-api/issues/10

          The only other way I've seen this use case discussed is with client-side HTTP Signature keys. There's some kind of negotiation between the server and the client, and then the client can make requests to remote servers using HTTP Signature and a key it controls.

          Emelia 👸🏻T This user is from outside of this forum
          Emelia 👸🏻T This user is from outside of this forum
          Emelia 👸🏻
          wrote last edited by
          #79

          @evan @benpate @steve @mariusor @smallcircles my understanding of proxyUrl is that it's just fetching a remote object, but without forwarding authorization

          For many cases you want to forward the request as the authenticated user to the remote server, not doing the request anonymously

          mariusM 1 Reply Last reply
          0
          • Emelia 👸🏻T Emelia 👸🏻

            @mariusor @steve @smallcircles @evan well, your server *knows* it's access token to user mapping, so then you're just doing authorised fetch as that actor from server side

            mariusM This user is from outside of this forum
            mariusM This user is from outside of this forum
            marius
            wrote last edited by
            #80

            @thisismissem which is what proxyUrl is supposed to do, right?

            Did you mean it in a different way?

            @steve @smallcircles @evan

            1 Reply Last reply
            1
            0
            • Emelia 👸🏻T Emelia 👸🏻

              @evan @benpate @steve @mariusor @smallcircles my understanding of proxyUrl is that it's just fetching a remote object, but without forwarding authorization

              For many cases you want to forward the request as the authenticated user to the remote server, not doing the request anonymously

              mariusM This user is from outside of this forum
              mariusM This user is from outside of this forum
              marius
              wrote last edited by
              #81

              @thisismissem it's not explicitly saying to forward authorization, but to me that's implied from "require authentication":

              proxyUrl: Endpoint URI so this actor's clients may access remote ActivityStreams objects which require authentication to access

              https://w3c.github.io/activitypub/#proxyUrl

              @evan @benpate @steve @smallcircles

              Evan ProdromouE 1 Reply Last reply
              2
              0
              • 🫧 socialcoding..S 🫧 socialcoding..

                @evan @steve

                Rather than sharedInbox I was more thinking that by implementing the HTTP API and msg exchanges in a well-prescribed manner, these would effectively model an event bus conceptually. After which you can talk about it as a higher abstraction that exists, and not get lost in the reeds of the impl details anymore.

                Evan ProdromouE This user is from outside of this forum
                Evan ProdromouE This user is from outside of this forum
                Evan Prodromou
                wrote last edited by
                #82

                @smallcircles @steve sure. I am not a fan of the idea that AP is a message-passing system; it's a read-write API.

                🫧 socialcoding..S 1 Reply Last reply
                2
                0
                • Evan ProdromouE Evan Prodromou

                  @smallcircles @steve sure. I am not a fan of the idea that AP is a message-passing system; it's a read-write API.

                  🫧 socialcoding..S This user is from outside of this forum
                  🫧 socialcoding..S This user is from outside of this forum
                  🫧 socialcoding..
                  wrote last edited by
                  #83

                  @evan @steve

                  It is both, like in that diagram draft.. or at least could be considered such (the notes apply to Protosocial musings).

                  https://social.coop/@smallcircles/116099511464629495

                  🫧 socialcoding..S 1 Reply Last reply
                  0
                  • mariusM marius

                    @thisismissem it's not explicitly saying to forward authorization, but to me that's implied from "require authentication":

                    proxyUrl: Endpoint URI so this actor's clients may access remote ActivityStreams objects which require authentication to access

                    https://w3c.github.io/activitypub/#proxyUrl

                    @evan @benpate @steve @smallcircles

                    Evan ProdromouE This user is from outside of this forum
                    Evan ProdromouE This user is from outside of this forum
                    Evan Prodromou
                    wrote last edited by
                    #84

                    @mariusor I have implemented it requiring OAuth on one side and using HTTP Signature on the other. I think you need to use the user's authorization for private content or to respect personal blocks. It sucks for caching but ¯\_(ツ)_/¯

                    @thisismissem @benpate @steve @smallcircles

                    mariusM Ben Pate 🤘🏻B Emelia 👸🏻T 3 Replies Last reply
                    2
                    0
                    • Evan ProdromouE Evan Prodromou

                      @mariusor I have implemented it requiring OAuth on one side and using HTTP Signature on the other. I think you need to use the user's authorization for private content or to respect personal blocks. It sucks for caching but ¯\_(ツ)_/¯

                      @thisismissem @benpate @steve @smallcircles

                      mariusM This user is from outside of this forum
                      mariusM This user is from outside of this forum
                      marius
                      wrote last edited by
                      #85

                      @evan yes, that's how I did it too, only in my case the private key of the actor that is authorized by OAuth2 token is used to generate the signature for the proxy fetch. This makes it that servers that implement object ACLs based on the recipients list (which GoActivityPub servers are) are not serving 403s for fetches.

                      1 Reply Last reply
                      2
                      0
                      • Evan ProdromouE Evan Prodromou

                        @mariusor I have implemented it requiring OAuth on one side and using HTTP Signature on the other. I think you need to use the user's authorization for private content or to respect personal blocks. It sucks for caching but ¯\_(ツ)_/¯

                        @thisismissem @benpate @steve @smallcircles

                        Ben Pate 🤘🏻B This user is from outside of this forum
                        Ben Pate 🤘🏻B This user is from outside of this forum
                        Ben Pate 🤘🏻
                        wrote last edited by
                        #86

                        Yeah, this is how I'd expect it to work (with the possible addition of *also* allowing cookie auth on the client side)

                        But yeah. Locally authenticated user from my client -> my server, then HTTP signature from my server -> your server

                        @evan @mariusor @thisismissem @steve @smallcircles

                        Evan ProdromouE 1 Reply Last reply
                        2
                        0
                        • Sean TilleyD Sean Tilley

                          @evan@cosocial.ca Yeah, I mostly agree with this. It's just that the buy-in is a little bit of a chicken and egg problem. You need servers to adopt it, but you need a compelling first mover. Bonfire, maybe?

                          The spec definitely needs love, too. I think one of the harder things is building a timeline out of inbox activities. I feel like maybe a future version of the API could specify timelines somehow, whether it's an endpoint or some kind of basic query? Maybe there's even a way to implement alternative timelines at that level?

                          These are all just guesses on my part, but I feel like this could be a gateway to universal custom feeds.

                          Evan ProdromouE This user is from outside of this forum
                          Evan ProdromouE This user is from outside of this forum
                          Evan Prodromou
                          wrote last edited by
                          #87

                          @deadsuperhero so, it's a two-sided market -- clients and servers. The traditional mechanism is a "ratchet" -- build up one side, then build up the other, and then build up the first.

                          So, yes, servers first, then clients, then more servers, more clients, and so on back and forth.

                          1 Reply Last reply
                          1
                          0
                          • Ben Pate 🤘🏻B Ben Pate 🤘🏻

                            Yeah, this is how I'd expect it to work (with the possible addition of *also* allowing cookie auth on the client side)

                            But yeah. Locally authenticated user from my client -> my server, then HTTP signature from my server -> your server

                            @evan @mariusor @thisismissem @steve @smallcircles

                            Evan ProdromouE This user is from outside of this forum
                            Evan ProdromouE This user is from outside of this forum
                            Evan Prodromou
                            wrote last edited by
                            #88

                            @benpate

                            With all the standard warnings around proxies!

                            @mariusor @thisismissem @steve @smallcircles

                            1 Reply Last reply
                            2
                            0
                            • 🫧 socialcoding..S 🫧 socialcoding..

                              @steve @mariusor @evan

                              He he, language is hard. A case of terminology overload and clashing terms. Domain driven design has the clearly defined bounded context here which is the scope within which terms are valid. Forming a consistency boundary. These context lines are blurred in fediverse talk. 😅

                              Evan ProdromouE This user is from outside of this forum
                              Evan ProdromouE This user is from outside of this forum
                              Evan Prodromou
                              wrote last edited by
                              #89

                              @smallcircles @steve @mariusor

                              I think in particular the terms "publisher" and "consumer" from AS2 and "client" and "server" from AP don't always map cleanly, especially with HTTP POST requests.

                              When a client delivers an activity to the actor's outbox, the client is the publisher of that activity, and the server is the consumer.

                              Same when a sending server (publisher) delivers an activity to a receiving server (consumer).

                              1 Reply Last reply
                              2
                              0
                              • Evan ProdromouE Evan Prodromou

                                @mariusor I have implemented it requiring OAuth on one side and using HTTP Signature on the other. I think you need to use the user's authorization for private content or to respect personal blocks. It sucks for caching but ¯\_(ツ)_/¯

                                @thisismissem @benpate @steve @smallcircles

                                Emelia 👸🏻T This user is from outside of this forum
                                Emelia 👸🏻T This user is from outside of this forum
                                Emelia 👸🏻
                                wrote last edited by
                                #90

                                @evan @mariusor @benpate @steve @smallcircles yeah, it's the only way to do it.

                                But this infrastructure actually is what enables things like the AT Protocol "proxy through my PDS to the bluesky app view" or "proxy through my PDS to a custom feed generator" functionality.

                                That's how that all works.

                                1 Reply Last reply
                                2
                                0
                                • 🫧 socialcoding..S 🫧 socialcoding..

                                  @evan @steve

                                  It is both, like in that diagram draft.. or at least could be considered such (the notes apply to Protosocial musings).

                                  https://social.coop/@smallcircles/116099511464629495

                                  🫧 socialcoding..S This user is from outside of this forum
                                  🫧 socialcoding..S This user is from outside of this forum
                                  🫧 socialcoding..
                                  wrote last edited by
                                  #91

                                  @evan @steve

                                  Another issue: Unclear protocol layers.

                                  > I am not a fan of the idea that #ActivityPub is a message-passing system; it's a read-write API.

                                  I'm not sure what a "read-write API" is, really. It 's a fuzzy term, whereas message based systems have well-defined architecture patterns and a body of IT knowledge and practice to apply them in robust communication systems. A 'Message API' has a generic, consistent interface.

                                  The overarching goal of AS/AP should be empowerment of the Solution developer so they can directly focus on building use cases for their application or business domain. They should not have to think about any of the intrinsics of the protocol, like particular GETs and POSTs used to model protocol capabilities in the HTTP transport layer.

                                  Solution design then involves:

                                  0. Model the domain
                                  1. Data modeling, msg formats + validation
                                  2. Define actor msg exchange patterns
                                  3. Document design
                                  --
                                  4. Improve these steps. Add native protocol + tool support over time.

                                  Evan ProdromouE 1 Reply Last reply
                                  0
                                  • 🫧 socialcoding..S 🫧 socialcoding..

                                    @evan @steve

                                    Another issue: Unclear protocol layers.

                                    > I am not a fan of the idea that #ActivityPub is a message-passing system; it's a read-write API.

                                    I'm not sure what a "read-write API" is, really. It 's a fuzzy term, whereas message based systems have well-defined architecture patterns and a body of IT knowledge and practice to apply them in robust communication systems. A 'Message API' has a generic, consistent interface.

                                    The overarching goal of AS/AP should be empowerment of the Solution developer so they can directly focus on building use cases for their application or business domain. They should not have to think about any of the intrinsics of the protocol, like particular GETs and POSTs used to model protocol capabilities in the HTTP transport layer.

                                    Solution design then involves:

                                    0. Model the domain
                                    1. Data modeling, msg formats + validation
                                    2. Define actor msg exchange patterns
                                    3. Document design
                                    --
                                    4. Improve these steps. Add native protocol + tool support over time.

                                    Evan ProdromouE This user is from outside of this forum
                                    Evan ProdromouE This user is from outside of this forum
                                    Evan Prodromou
                                    wrote last edited by
                                    #92

                                    @smallcircles @steve it's ok if you haven't heard of a REST API. It's an API that uses HTTP for reading and writing data. Wikipedia has a good
                                    article about it:

                                    https://en.wikipedia.org/wiki/REST

                                    Evan ProdromouE 1 Reply Last reply
                                    1
                                    0
                                    • Evan ProdromouE Evan Prodromou

                                      @smallcircles @steve it's ok if you haven't heard of a REST API. It's an API that uses HTTP for reading and writing data. Wikipedia has a good
                                      article about it:

                                      https://en.wikipedia.org/wiki/REST

                                      Evan ProdromouE This user is from outside of this forum
                                      Evan ProdromouE This user is from outside of this forum
                                      Evan Prodromou
                                      wrote last edited by
                                      #93

                                      @smallcircles @steve one anti-pattern I dislike seeing in ActivityPub discussions is that only one interaction defined in the ActivityPub spec is valid: an HTTP POST to an actor's `inbox` for server-to-server interactions.

                                      We can use HTTP GET to fetch additional data about objects, actors and collections.

                                      Evan ProdromouE 1 Reply Last reply
                                      2
                                      0
                                      • Evan ProdromouE Evan Prodromou

                                        @smallcircles @steve one anti-pattern I dislike seeing in ActivityPub discussions is that only one interaction defined in the ActivityPub spec is valid: an HTTP POST to an actor's `inbox` for server-to-server interactions.

                                        We can use HTTP GET to fetch additional data about objects, actors and collections.

                                        Evan ProdromouE This user is from outside of this forum
                                        Evan ProdromouE This user is from outside of this forum
                                        Evan Prodromou
                                        wrote last edited by
                                        #94

                                        @smallcircles @steve So, I disagree that we have to exclusively adopt a message-passing paradigm for ActivityPub.

                                        EDIT: note that it's exclusive.

                                        Christine Lemmer-WebberC 1 Reply Last reply
                                        2
                                        0
                                        • Evan ProdromouE Evan Prodromou

                                          @smallcircles @steve So, I disagree that we have to exclusively adopt a message-passing paradigm for ActivityPub.

                                          EDIT: note that it's exclusive.

                                          Christine Lemmer-WebberC This user is from outside of this forum
                                          Christine Lemmer-WebberC This user is from outside of this forum
                                          Christine Lemmer-Webber
                                          wrote last edited by
                                          #95

                                          @evan @smallcircles @steve ActivityPub already is a message passing paradigm

                                          🫧 socialcoding..S Evan ProdromouE 2 Replies Last reply
                                          1
                                          0
                                          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
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups