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
7 Posts 4 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 1 Reply 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.

          1 Reply Last reply
          1
          • 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
            #5

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

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

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