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'm thinking in adding #ONI proxyUrl support in the frontend.

I'm thinking in adding #ONI proxyUrl support in the frontend.

Scheduled Pinned Locked Moved Uncategorized
activitypuboni
14 Posts 3 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.
  • mariusM marius

    I'm thinking in adding #ONI proxyUrl support in the frontend.

    Currently if a request to a remote #ActivityPub object fails - either due to CORS, or because of authorized fetch - I just display a fallback link to it.

    I'm wondering if I can do a two step approach, if the request to the resource fails with 401-403 (for secure fetch) or 400 (for CORS failures) I try to redirect the request through the proxyUrl mechanism.

    Only if that fails too, I fallback to something else.

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

    :🎉 ... and done!

    Now I have the actors of remote instances (like mitra.social and mastodonapp.uk) loading properly in the inbox of ONI.

    I'm not proud of the JavaScript that does it, there must be an idiomatic way to chain fetch requests without the Promise in Promise spaghetti I just wrote. 😞

    mariusM 1 Reply Last reply
    1
    0
    • R AodeRelay shared this topic
    • mariusM marius

      :🎉 ... and done!

      Now I have the actors of remote instances (like mitra.social and mastodonapp.uk) loading properly in the inbox of ONI.

      I'm not proud of the JavaScript that does it, there must be an idiomatic way to chain fetch requests without the Promise in Promise spaghetti I just wrote. 😞

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

      Ooops... mitra.social is down.

      I hope it wasn't me that brought it down with my testing. :(( Sorry @silverpill pill@mitra.social

      silverpillS 1 Reply Last reply
      2
      0
      • R ActivityRelay shared this topic
      • mariusM marius

        Ooops... mitra.social is down.

        I hope it wasn't me that brought it down with my testing. :(( Sorry @silverpill pill@mitra.social

        silverpillS This user is from outside of this forum
        silverpillS This user is from outside of this forum
        silverpill
        wrote last edited by
        #4

        @mariusor No worries, I was deploying an update :]

        silverpillS 1 Reply Last reply
        0
        • silverpillS silverpill

          @mariusor No worries, I was deploying an update :]

          silverpillS This user is from outside of this forum
          silverpillS This user is from outside of this forum
          silverpill
          wrote last edited by
          #5

          @mariusor

          Now I have the actors of remote instances (like mitra.social and mastodonapp.uk) loading properly in the inbox of ONI.

          Are mitra.social actors special in some way?

          mariusM 1 Reply Last reply
          0
          • silverpillS silverpill

            @mariusor

            Now I have the actors of remote instances (like mitra.social and mastodonapp.uk) loading properly in the inbox of ONI.

            Are mitra.social actors special in some way?

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

            @silverpill when I fetch mitra actors from the browser with JavaScript fetch, it disallows them due to the server not allowing CORS pre-flight requests.

            When I was adding support for Django's C2S client, it became apparent that if we want objects be accessible form in browser clients, the servers need very relaxed CORS policies. I defaulted to accepting all https:// ... but I'm thinking about rules based on the actor's followers perhaps..

            Raphael LullisR silverpillS 2 Replies Last reply
            1
            0
            • mariusM marius

              @silverpill when I fetch mitra actors from the browser with JavaScript fetch, it disallows them due to the server not allowing CORS pre-flight requests.

              When I was adding support for Django's C2S client, it became apparent that if we want objects be accessible form in browser clients, the servers need very relaxed CORS policies. I defaulted to accepting all https:// ... but I'm thinking about rules based on the actor's followers perhaps..

              Raphael LullisR This user is from outside of this forum
              Raphael LullisR This user is from outside of this forum
              Raphael Lullis
              wrote last edited by
              #7

              @mariusor @silverpill

              > Django's C2S client

              Is this my client, my server, or something else entirely you are talking about? 🙂

              mariusM 1 Reply Last reply
              0
              • Raphael LullisR Raphael Lullis

                @mariusor @silverpill

                > Django's C2S client

                Is this my client, my server, or something else entirely you are talking about? 🙂

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

                @raphael @silverpill

                Django the person at social.coop who investigated client to server for a FOSDEM presentation.

                I didn't want to pull them into the discussion.

                Raphael LullisR 1 Reply Last reply
                0
                • mariusM marius

                  @raphael @silverpill

                  Django the person at social.coop who investigated client to server for a FOSDEM presentation.

                  I didn't want to pull them into the discussion.

                  Raphael LullisR This user is from outside of this forum
                  Raphael LullisR This user is from outside of this forum
                  Raphael Lullis
                  wrote last edited by
                  #9

                  @mariusor

                  Well, that's a remarkable coincidence. I'm doing work on a Django server that implements C2S, and the last couple of weeks I started working on a browser extension that acts as a AP client.

                  mariusM 1 Reply Last reply
                  0
                  • mariusM marius

                    @silverpill when I fetch mitra actors from the browser with JavaScript fetch, it disallows them due to the server not allowing CORS pre-flight requests.

                    When I was adding support for Django's C2S client, it became apparent that if we want objects be accessible form in browser clients, the servers need very relaxed CORS policies. I defaulted to accepting all https:// ... but I'm thinking about rules based on the actor's followers perhaps..

                    silverpillS This user is from outside of this forum
                    silverpillS This user is from outside of this forum
                    silverpill
                    wrote last edited by
                    #10

                    @mariusor Yes, mitra's CORS config is a bit weird. I plan to change it to a more permissive one in the future

                    mariusM 1 Reply Last reply
                    0
                    • Raphael LullisR Raphael Lullis

                      @mariusor

                      Well, that's a remarkable coincidence. I'm doing work on a Django server that implements C2S, and the last couple of weeks I started working on a browser extension that acts as a AP client.

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

                      @raphael if you want a server that's already has a good C2S implementation to test against, let me know.

                      Raphael LullisR 1 Reply Last reply
                      2
                      0
                      • silverpillS silverpill

                        @mariusor Yes, mitra's CORS config is a bit weird. I plan to change it to a more permissive one in the future

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

                        @silverpill can't wait... the good thing about my implementation of using proxyUrl from the frontend is that it only kicks in on failed requests, so it'll be transparent when you switch.

                        1 Reply Last reply
                        0
                        • mariusM marius

                          @raphael if you want a server that's already has a good C2S implementation to test against, let me know.

                          Raphael LullisR This user is from outside of this forum
                          Raphael LullisR This user is from outside of this forum
                          Raphael Lullis
                          wrote last edited by
                          #13

                          @mariusor

                          I've been woking on the client by testing against my DAT server: https://activitypub.mushroomlabs.com/tutorials/standalone/

                          But I'm definitely interested in testing against servers that implement OAuth in a different way.

                          mariusM 1 Reply Last reply
                          0
                          • Raphael LullisR Raphael Lullis

                            @mariusor

                            I've been woking on the client by testing against my DAT server: https://activitypub.mushroomlabs.com/tutorials/standalone/

                            But I'm definitely interested in testing against servers that implement OAuth in a different way.

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

                            @raphael both servers I built using GoActivityPub have support for Dynamic OAuth2 client creation (RFC7591 and RFC8414) and by using the Client ID Metadata Document draft if you plan to support one and/or the other.

                            1 Reply Last reply
                            2
                            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