@fediforum@mastodon.social

Adapting Client APIs to Different Fediverse Platforms

/2024-09/session/5-c/

Convener: Manton Reece (@manton@manton.org)

Participants who chose to record their names here:

Proposal: https://codeberg.org/fediverse/fep/src/branch/main/fep/eb22/fep-eb22.md

Notes

Mastodon API has much tech debt and design aspects not necessarily appropriate for other use cases.

ActivityPub Client-to-Server (C2S) spec should be updated with the common use cases, such as timeline display.

Features missing from C2S:

Note that C2S spec requires use of OAuth 2. This is limiting and should be updated. GNAP eliminates the client registration problem.

Chicken and egg problem of no use of C2S. Mastodon itself does not implement C2S. Mastodon API therefore is the de facto C2S standard.

Only way for Mastodon to get C2S added is for an advocate of it to propose it to the core team, get blessed, and then do the work itself.

WordPress has limited resources allocated to the ActivityPub work, so would need something external for WordPress’s plugin to get it added.

Micropub and Microsub specs as well might work. Also few apps using it.

Threads has its own private, proprietary API. It’s limited to functions that would not replace the Threads app.

As a starting point someone could build an app that uses C2S and also the server-side part of it, which would be well-suited to a single-developer effort. Hard to justify because there is no other apps and no servers available in app store.

Decentralized Web Node https://identity.foundation/decentralized-web-node/spec/

GNAP is also the intended replacement for OAuth 2.0 and eliminates the client registration problem.

Keycloak: Open Source Identity and Access Management https://www.keycloak.org/

WebFinger: simple discovery for the web https://webfinger.net/

OpenID Connect https://openid.net/developers/how-connect-works/

ActivityPub book by Evan Prodromou https://www.oreilly.com/library/view/activitypub/9781098162733/

Mastodon Supported types: Note, Question, Article, Page, Image, Audio, Video, Event

Per docs: “The transformer uses content if available, or name if not, in order to generate status text. The url will be appended. The summary property will be used as the CW text. The icon will be used as a thumbnail.” The only “first class” supported types are Note and Question.

Ruby lacks good OpenAPI spec generation, which is one reason why Mastodon’s API doesn’t.

Use of Mastodon API leads to lowest common denominator / overuse of “notes” objects in place of other available activities e.g. “listen” , “arrive” .

How would we get support added for other objects into Mastodon? Seems like a big challenge getting Mastodon’s core team to accept external changes like this.

Mastodon effectively converts everything to a “status” and that’s basically everything is a note in its internal data model. https://github.com/mastodon/mastodon/blob/main/app/lib/activitypub/activity.rb#L8-L9

Evan Prodromou suggested (outside of session) Mastodon preserve whatever is sent to it when it’s not a Note, but that would mean saving unstructured data, which has its own problems.

Mastodon falls back to summary, title, link, which can be good enough in some situations, but not all, when sent a type it does not support. Article type should have a second click to show the rest of the note for example.

New task force for trust and safety might work on content warnings. Right now, Mastodon overloads summary. Actual summary usage might be possible in the future once there is a way to content labeling and not overload the summary. https://github.com/w3c/activitystreams/issues/583

Idea to Decouple the ActivityPub C2S part from fediverse services and allow publishing to a headless C2S server.

Fred Hauschel working on something similar to this idea: https://rdfpub.org/ .