Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • 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
We Distribute
  1. Home
  2. General Discussion
  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 General Discussion
activitypuboni
14 Posts 3 Posters 43 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.
  • mariusor@metalhead.clubM This user is from outside of this forum
    mariusor@metalhead.clubM This user is from outside of this forum
    mariusor@metalhead.club
    wrote last edited by
    #1

    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.

    mariusor@metalhead.clubM 1 Reply Last reply
    0
    • mariusor@metalhead.clubM mariusor@metalhead.club

      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.

      mariusor@metalhead.clubM This user is from outside of this forum
      mariusor@metalhead.clubM This user is from outside of this forum
      mariusor@metalhead.club
      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. 😞

      mariusor@metalhead.clubM 1 Reply Last reply
      0
      • mariusor@metalhead.clubM mariusor@metalhead.club

        :🎉 ... 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. 😞

        mariusor@metalhead.clubM This user is from outside of this forum
        mariusor@metalhead.clubM This user is from outside of this forum
        mariusor@metalhead.club
        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

        silverpill@mitra.socialS 1 Reply Last reply
        0
        • mariusor@metalhead.clubM mariusor@metalhead.club

          Ooops... mitra.social is down.

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

          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
          #4

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

          silverpill@mitra.socialS 1 Reply Last reply
          0
          • silverpill@mitra.socialS silverpill@mitra.social

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

            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
            #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?

            mariusor@metalhead.clubM 1 Reply Last reply
            0
            • silverpill@mitra.socialS silverpill@mitra.social

              @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?

              mariusor@metalhead.clubM This user is from outside of this forum
              mariusor@metalhead.clubM This user is from outside of this forum
              mariusor@metalhead.club
              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@mastodon.communick.comR silverpill@mitra.socialS 2 Replies Last reply
              0
              • mariusor@metalhead.clubM mariusor@metalhead.club

                @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@mastodon.communick.comR This user is from outside of this forum
                raphael@mastodon.communick.comR This user is from outside of this forum
                raphael@mastodon.communick.com
                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? 🙂

                mariusor@metalhead.clubM 1 Reply Last reply
                0
                • raphael@mastodon.communick.comR raphael@mastodon.communick.com

                  @mariusor @silverpill

                  > Django's C2S client

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

                  mariusor@metalhead.clubM This user is from outside of this forum
                  mariusor@metalhead.clubM This user is from outside of this forum
                  mariusor@metalhead.club
                  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@mastodon.communick.comR 1 Reply Last reply
                  0
                  • mariusor@metalhead.clubM mariusor@metalhead.club

                    @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@mastodon.communick.comR This user is from outside of this forum
                    raphael@mastodon.communick.comR This user is from outside of this forum
                    raphael@mastodon.communick.com
                    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.

                    mariusor@metalhead.clubM 1 Reply Last reply
                    0
                    • mariusor@metalhead.clubM mariusor@metalhead.club

                      @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..

                      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
                      #10

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

                      mariusor@metalhead.clubM 1 Reply Last reply
                      0
                      • raphael@mastodon.communick.comR raphael@mastodon.communick.com

                        @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.

                        mariusor@metalhead.clubM This user is from outside of this forum
                        mariusor@metalhead.clubM This user is from outside of this forum
                        mariusor@metalhead.club
                        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@mastodon.communick.comR 1 Reply Last reply
                        0
                        • silverpill@mitra.socialS silverpill@mitra.social

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

                          mariusor@metalhead.clubM This user is from outside of this forum
                          mariusor@metalhead.clubM This user is from outside of this forum
                          mariusor@metalhead.club
                          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
                          • mariusor@metalhead.clubM mariusor@metalhead.club

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

                            raphael@mastodon.communick.comR This user is from outside of this forum
                            raphael@mastodon.communick.comR This user is from outside of this forum
                            raphael@mastodon.communick.com
                            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.

                            mariusor@metalhead.clubM 1 Reply Last reply
                            0
                            • raphael@mastodon.communick.comR raphael@mastodon.communick.com

                              @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.

                              mariusor@metalhead.clubM This user is from outside of this forum
                              mariusor@metalhead.clubM This user is from outside of this forum
                              mariusor@metalhead.club
                              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
                              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