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 (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. General Discussion
  3. I try to implement an #activitypub server in #Rust, have problems talking to #mastodon and would appreciate some help.

I try to implement an #activitypub server in #Rust, have problems talking to #mastodon and would appreciate some help.

Scheduled Pinned Locked Moved General Discussion
activitypubrustmastodon
10 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.
  • achim@social.saarlandA This user is from outside of this forum
    achim@social.saarlandA This user is from outside of this forum
    achim@social.saarland
    wrote last edited by
    #1

    I try to implement an #activitypub server in #Rust, have problems talking to #mastodon and would appreciate some help.

    I try to send a follow action to Mastodon. The request is - as far as I can tell - signed according to https://docs.joinmastodon.org/spec/security/

    The "keyId" of the signatrue is "https://pub.saar.social/user/achim/key". Mastodon calls this url as expected and my server returnst: [...]

    achim@social.saarlandA cetra3@mastodon.socialC 2 Replies Last reply
    1
    0
    • tag-activitypub@relay.fedi.buzzT tag-activitypub@relay.fedi.buzz shared this topic
    • achim@social.saarlandA achim@social.saarland

      I try to implement an #activitypub server in #Rust, have problems talking to #mastodon and would appreciate some help.

      I try to send a follow action to Mastodon. The request is - as far as I can tell - signed according to https://docs.joinmastodon.org/spec/security/

      The "keyId" of the signatrue is "https://pub.saar.social/user/achim/key". Mastodon calls this url as expected and my server returnst: [...]

      achim@social.saarlandA This user is from outside of this forum
      achim@social.saarlandA This user is from outside of this forum
      achim@social.saarland
      wrote last edited by
      #2

      [...]

      {
      "@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1"],
      "id":"https://pub.saar.social/user/achim/key",
      "type":"Key",
      "publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMIIBI[...]IDAQAB\n-----END PUBLIC KEY-----\n",
      "owner":"https://pub.saar.social/user/achim"
      }

      But my follow http call gets this back from Mastodon:

      {"error":"Unable to fetch key JSON at https://pub.saar.social/user/achim/key"}

      Can somebody give me a hint how to figure out what the problem is?

      jean_dupont@mastodon.socialJ mariusor@metalhead.clubM silverpill@mitra.socialS 3 Replies Last reply
      0
      • achim@social.saarlandA achim@social.saarland

        [...]

        {
        "@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1"],
        "id":"https://pub.saar.social/user/achim/key",
        "type":"Key",
        "publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMIIBI[...]IDAQAB\n-----END PUBLIC KEY-----\n",
        "owner":"https://pub.saar.social/user/achim"
        }

        But my follow http call gets this back from Mastodon:

        {"error":"Unable to fetch key JSON at https://pub.saar.social/user/achim/key"}

        Can somebody give me a hint how to figure out what the problem is?

        jean_dupont@mastodon.socialJ This user is from outside of this forum
        jean_dupont@mastodon.socialJ This user is from outside of this forum
        jean_dupont@mastodon.social
        wrote last edited by
        #3

        @achim
        Silly question but I tend to forget it every time I haven't done http requests for a while:
        Did you set your request header "Content-Type: application/json" ?

        1 Reply Last reply
        0
        • achim@social.saarlandA achim@social.saarland

          [...]

          {
          "@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1"],
          "id":"https://pub.saar.social/user/achim/key",
          "type":"Key",
          "publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMIIBI[...]IDAQAB\n-----END PUBLIC KEY-----\n",
          "owner":"https://pub.saar.social/user/achim"
          }

          But my follow http call gets this back from Mastodon:

          {"error":"Unable to fetch key JSON at https://pub.saar.social/user/achim/key"}

          Can somebody give me a hint how to figure out what the problem is?

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

          @achim you can try to debug with https://activitypub.academy

          It can display the activity exchanges that happen between the test account you create there and your instance.

          achim@social.saarlandA 1 Reply Last reply
          1
          • mariusor@metalhead.clubM mariusor@metalhead.club

            @achim you can try to debug with https://activitypub.academy

            It can display the activity exchanges that happen between the test account you create there and your instance.

            achim@social.saarlandA This user is from outside of this forum
            achim@social.saarlandA This user is from outside of this forum
            achim@social.saarland
            wrote last edited by
            #5

            @mariusor That looks great! Thanks for the hint, I'll have a closer look.

            1 Reply Last reply
            0
            • achim@social.saarlandA achim@social.saarland

              [...]

              {
              "@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1"],
              "id":"https://pub.saar.social/user/achim/key",
              "type":"Key",
              "publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMIIBI[...]IDAQAB\n-----END PUBLIC KEY-----\n",
              "owner":"https://pub.saar.social/user/achim"
              }

              But my follow http call gets this back from Mastodon:

              {"error":"Unable to fetch key JSON at https://pub.saar.social/user/achim/key"}

              Can somebody give me a hint how to figure out what the problem is?

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

              @achim I don't know about Mastodon, but here are some general tips:

              - Your actor is served with content-type application/json, but it should be application/ld+json; profile="https://www.w3.org/ns/activitystreams"
              - It's better to embed the key in your actor document and identify it with a fragment ID. This is more widely supported than standalone keys.

              achim@social.saarlandA 2 Replies Last reply
              0
              • silverpill@mitra.socialS silverpill@mitra.social

                @achim I don't know about Mastodon, but here are some general tips:

                - Your actor is served with content-type application/json, but it should be application/ld+json; profile="https://www.w3.org/ns/activitystreams"
                - It's better to embed the key in your actor document and identify it with a fragment ID. This is more widely supported than standalone keys.

                achim@social.saarlandA This user is from outside of this forum
                achim@social.saarlandA This user is from outside of this forum
                achim@social.saarland
                wrote last edited by
                #7

                @silverpill Thanks! Mitra looks very interesting. I'll have a look and will probably pop up in your Matrix channel. I was not aware that there is a maintained ActivityPub project in Rust.

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

                  @silverpill Thanks! Mitra looks very interesting. I'll have a look and will probably pop up in your Matrix channel. I was not aware that there is a maintained ActivityPub project in Rust.

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

                  @achim Lemmy is also in Rust! And there are two Rust libraries:

                  - https://docs.rs/activitypub_federation/latest/activitypub_federation/ (from Lemmy devs)
                  - https://docs.rs/apx_sdk/latest/apx_sdk/ (this one is developed by me)

                  1 Reply Last reply
                  0
                  • achim@social.saarlandA achim@social.saarland

                    I try to implement an #activitypub server in #Rust, have problems talking to #mastodon and would appreciate some help.

                    I try to send a follow action to Mastodon. The request is - as far as I can tell - signed according to https://docs.joinmastodon.org/spec/security/

                    The "keyId" of the signatrue is "https://pub.saar.social/user/achim/key". Mastodon calls this url as expected and my server returnst: [...]

                    cetra3@mastodon.socialC This user is from outside of this forum
                    cetra3@mastodon.socialC This user is from outside of this forum
                    cetra3@mastodon.social
                    wrote last edited by
                    #9

                    @achim I have managed to get Federation working with divedb, which is open source: https://github.com/cetra3/divedb. I used the activitypub_federation crate to get it working. Might be worthwhile having a look!

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

                      @achim I don't know about Mastodon, but here are some general tips:

                      - Your actor is served with content-type application/json, but it should be application/ld+json; profile="https://www.w3.org/ns/activitystreams"
                      - It's better to embed the key in your actor document and identify it with a fragment ID. This is more widely supported than standalone keys.

                      achim@social.saarlandA This user is from outside of this forum
                      achim@social.saarlandA This user is from outside of this forum
                      achim@social.saarland
                      wrote last edited by
                      #10

                      @silverpill Thanks for the hint. This was part of the problem. So I made progress and am now fixing the other things I messed up. 😉

                      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