Presenting Activitypub-Rust crate

Activitypub is decentralized social networking protocol recommended by the W3C. It provides a client to server API for creating, updating and deleting content, as well as a federated server to server API for delivering notifications and content. As part of the work on Lemmy, we have implemented some high-level abstractions for handling the server-to-server protocol in Rust. These abstractions are now available as a standalone library.

The main features are:

  • Data structures for federation are defined by the user, not the library. This gives you maximal flexibility, and lets you accept only messages which your code can handle. Others are rejected automatically during deserialization.
  • ObjectId type, wraps the id url and allows for type safe fetching of objects, both from database and HTTP
  • Queue for activity sending, handles HTTP signatures, retry with exponential backoff, all in background workers
  • Inbox for receiving activities, verifies HTTP signatures, performs other basic checks and helps with routing
  • Generic error type (unfortunately this was necessary)
  • various helpers for verification, (de)serialization, context etc

Documentation is currently lacking. If you want to get started with the library, best look at the example.

The code has already been used in production as part of Lemmy for a long time, without any notable problems. However, ergonomics are lacking and need to be improved. There are also many additional features which would be worth implementing. See the project readme for details. Contributions and suggestions are very much welcome!

You can find the project here:

https://github.com/LemmyNet/activitypub-federation-rust

https://crates.io/crates/activitypub-federation

@AgreeableLandscape
admin
link
fedilink
61M

Hell yeah!!

Thank you. This will really help people who like rust to learn about activitypub. It’s a hard topic to understand.

@pancake
link
fedilink
41M

This is great!

IngrownMink4
link
fedilink
31M

Nice :)

Kromonos
link
fedilink
8
edit-2
17d

deleted by creator

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

  • 0 users online
  • 10 users / day
  • 32 users / week
  • 63 users / month
  • 202 users / 6 months
  • 1.41K subscribers
  • 409 Posts
  • 2.92K Comments
  • Modlog