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.
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: [...]
-
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: [...]
[...]
{
"@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?
-
[...]
{
"@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?
@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" ? -
[...]
{
"@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?
@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.
-
R AodeRelay shared this topicR ActivityRelay shared this topic
-
@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.
@mariusor That looks great! Thanks for the hint, I'll have a closer look.
-
[...]
{
"@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?
@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 beapplication/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 I don't know about Mastodon, but here are some general tips:
- Your actor is served with content-type
application/json, but it should beapplication/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.@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 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.
@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) -
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 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!
-
@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 beapplication/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.@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.

-
R AodeRelay shared this topic