Federation protocol building blocks (phase 1, step 2)
Pure, framework-free code in federation/protocol: - media: ActivityPub content types and Accept negotiation - vocab: actor URLs, Person and Application actors (Mastodon's extension terms), public keys, collections, plain text to safe HTML - webfinger: acct:/actor-URL resource parsing (other domains and bad usernames rejected) and JRD documents - nodeinfo: discovery and NodeInfo 2.1; hostmeta: XRD pointing at WebFinger Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
This commit is contained in:
1 parent
98c65547f3
commit
e890568c54
6 files changed
+392
No files matched your search
@@ -0,0 +1,19 @@
|
||||
"""NodeInfo 2.1 (https://nodeinfo.diaspora.software/): what software a server runs."""
|
||||
|
||||
SCHEMA_21 = "http://nodeinfo.diaspora.software/ns/schema/2.1"
|
||||
|
||||
|
||||
def discovery(base_url: str) -> dict:
|
||||
return {"links": [{"rel": SCHEMA_21, "href": f"{base_url}/nodeinfo/2.1"}]}
|
||||
|
||||
|
||||
def document(*, version: str, users_total: int, open_registrations: bool) -> dict:
|
||||
return {
|
||||
"version": "2.1",
|
||||
"software": {"name": "scrobbler", "version": version},
|
||||
"protocols": ["activitypub"],
|
||||
"services": {"inbound": [], "outbound": []},
|
||||
"openRegistrations": open_registrations,
|
||||
"usage": {"users": {"total": users_total}, "localPosts": 0},
|
||||
"metadata": {},
|
||||
}
|
||||
Reference in new issue
Block a user