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 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 Uncategorized
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 DommaA This user is from outside of this forum
    Achim DommaA This user is from outside of this forum
    Achim Domma
    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 returns: [...]

    Achim DommaA CetraC 2 Replies Last reply
    0
    • Achim DommaA Achim Domma

      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 returns: [...]

      Achim DommaA This user is from outside of this forum
      Achim DommaA This user is from outside of this forum
      Achim Domma
      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?

      AreskulJ mariusM silverpillS 3 Replies Last reply
      0
      • Achim DommaA Achim Domma

        [...]

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

        AreskulJ This user is from outside of this forum
        AreskulJ This user is from outside of this forum
        Areskul
        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 DommaA Achim Domma

          [...]

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

          mariusM This user is from outside of this forum
          mariusM This user is from outside of this forum
          marius
          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 DommaA 1 Reply Last reply
          2
          0
          • R AodeRelay shared this topic
            R ActivityRelay shared this topic
          • mariusM marius

            @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 DommaA This user is from outside of this forum
            Achim DommaA This user is from outside of this forum
            Achim Domma
            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 DommaA Achim Domma

              [...]

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

              silverpillS This user is from outside of this forum
              silverpillS This user is from outside of this forum
              silverpill
              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 DommaA 2 Replies Last reply
              2
              0
              • silverpillS silverpill

                @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 DommaA This user is from outside of this forum
                Achim DommaA This user is from outside of this forum
                Achim Domma
                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.

                silverpillS 1 Reply Last reply
                0
                • Achim DommaA Achim Domma

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

                  silverpillS This user is from outside of this forum
                  silverpillS This user is from outside of this forum
                  silverpill
                  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
                  2
                  0
                  • Achim DommaA Achim Domma

                    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 returns: [...]

                    CetraC This user is from outside of this forum
                    CetraC This user is from outside of this forum
                    Cetra
                    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
                    • silverpillS silverpill

                      @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 DommaA This user is from outside of this forum
                      Achim DommaA This user is from outside of this forum
                      Achim Domma
                      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
                      3
                      0
                      • R AodeRelay shared this topic
                      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