Remove webfinger from actor

merge-requests/30/head
Bob Mottram 2022-06-27 21:40:15 +01:00
parent 535df7c293
commit a7fabb69fd
1 changed files with 145 additions and 139 deletions

View File

@ -28,78 +28,73 @@ Here's an example of the actor record of our friend Alyssa P. Hacker:
### Example 1 ### Example 1
``` json ``` json
{"aliases": ["https://instancedomain/@Alyssa", {
"https://instancedomain/users/Alyssa"], "@context": [
"links": [{"href": "https://instancedomain/@Alyssa", "https://www.w3.org/ns/activitystreams",
"rel": "http://webfinger.net/rel/profile-page", "https://w3id.org/security/v1",
"type": "text/html"}, {
{"href": "https://instancedomain/users/Alyssa", "Curve25519Key": "toot:Curve25519Key",
"rel": "self", "Device": "toot:Device",
"type": "application/activity+json"}, "Ed25519Key": "toot:Ed25519Key",
{"rel": "http://ostatus.org/schema/1.0/subscribe", "Ed25519Signature": "toot:Ed25519Signature",
"template": "https://instancedomain/authorize_interaction?uri={uri}"}], "EncryptedMessage": "toot:EncryptedMessage",
"subject": "acct:Alyssa@instancedomain"} "PropertyValue": "schema:PropertyValue",
{"@context": ["https://www.w3.org/ns/activitystreams", "alsoKnownAs": {"@id": "as:alsoKnownAs", "@type": "@id"},
"https://w3id.org/security/v1", "cipherText": "toot:cipherText",
{"Curve25519Key": "toot:Curve25519Key", "claim": {"@id": "toot:claim", "@type": "@id"},
"Device": "toot:Device", "deviceId": "toot:deviceId",
"Ed25519Key": "toot:Ed25519Key", "devices": {"@id": "toot:devices", "@type": "@id"},
"Ed25519Signature": "toot:Ed25519Signature", "discoverable": "toot:discoverable",
"EncryptedMessage": "toot:EncryptedMessage", "featured": {"@id": "toot:featured", "@type": "@id"},
"PropertyValue": "schema:PropertyValue", "featuredTags": {"@id": "toot:featuredTags", "@type": "@id"},
"alsoKnownAs": {"@id": "as:alsoKnownAs", "@type": "@id"}, "fingerprintKey": {"@id": "toot:fingerprintKey", "@type": "@id"},
"cipherText": "toot:cipherText", "focalPoint": {"@container": "@list", "@id": "toot:focalPoint"},
"claim": {"@id": "toot:claim", "@type": "@id"}, "identityKey": {"@id": "toot:identityKey", "@type": "@id"},
"deviceId": "toot:deviceId", "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"devices": {"@id": "toot:devices", "@type": "@id"}, "messageFranking": "toot:messageFranking",
"discoverable": "toot:discoverable", "messageType": "toot:messageType",
"featured": {"@id": "toot:featured", "@type": "@id"}, "movedTo": {"@id": "as:movedTo", "@type": "@id"},
"featuredTags": {"@id": "toot:featuredTags", "@type": "@id"}, "publicKeyBase64": "toot:publicKeyBase64",
"fingerprintKey": {"@id": "toot:fingerprintKey", "@type": "@id"}, "schema": "http://schema.org#",
"focalPoint": {"@container": "@list", "@id": "toot:focalPoint"}, "suspended": "toot:suspended",
"identityKey": {"@id": "toot:identityKey", "@type": "@id"}, "toot": "http://joinmastodon.org/ns#",
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers", "value": "schema:value"
"messageFranking": "toot:messageFranking", }
"messageType": "toot:messageType", ],
"movedTo": {"@id": "as:movedTo", "@type": "@id"}, "alsoKnownAs": ["https://activitypubhackers/users/Alyssa"],
"publicKeyBase64": "toot:publicKeyBase64", "attachment": [{"name": "XMPP",
"schema": "http://schema.org#", "type": "PropertyValue",
"suspended": "toot:suspended", "value": "alyssa@chatdomain"}],
"toot": "http://joinmastodon.org/ns#", "devices": "https://instancedomain/users/Alyssa/collections/devices",
"value": "schema:value"}], "discoverable": True,
"alsoKnownAs": ["https://activitypubhackers/users/Alyssa"], "endpoints": {"sharedInbox": "https://instancedomain/inbox"},
"attachment": [{"name": "XMPP", "featured": "https://instancedomain/users/Alyssa/collections/featured",
"type": "PropertyValue", "featuredTags": "https://instancedomain/users/Alyssa/collections/tags",
"value": "alyssa@chatdomain"}], "followers": "https://instancedomain/users/Alyssa/followers",
"devices": "https://instancedomain/users/Alyssa/collections/devices", "following": "https://instancedomain/users/Alyssa/following",
"discoverable": True, "icon": {"mediaType": "image/png",
"endpoints": {"sharedInbox": "https://instancedomain/inbox"},
"featured": "https://instancedomain/users/Alyssa/collections/featured",
"featuredTags": "https://instancedomain/users/Alyssa/collections/tags",
"followers": "https://instancedomain/users/Alyssa/followers",
"following": "https://instancedomain/users/Alyssa/following",
"icon": {"mediaType": "image/png",
"type": "Image",
"url": "https://instancedomain/accounts/avatars/abc.png"},
"id": "https://instancedomain/users/Alyssa",
"image": {"mediaType": "image/jpeg",
"type": "Image", "type": "Image",
"url": "https://instancedomain/accounts/headers/def.jpeg"}, "url": "https://instancedomain/accounts/avatars/abc.png"},
"inbox": "https://instancedomain/users/Alyssa/inbox", "id": "https://instancedomain/users/Alyssa",
"manuallyApprovesFollowers": False, "image": {"mediaType": "image/jpeg",
"name": "Alyssa", "type": "Image",
"outbox": "https://instancedomain/users/Alyssa/outbox", "url": "https://instancedomain/accounts/headers/def.jpeg"},
"preferredUsername": "Alyssa", "inbox": "https://instancedomain/users/Alyssa/inbox",
"publicKey": {"id": "https://instancedomain/users/Alyssa#main-key", "manuallyApprovesFollowers": False,
"owner": "https://instancedomain/users/Alyssa", "name": "Alyssa",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\n" "outbox": "https://instancedomain/users/Alyssa/outbox",
"..." "preferredUsername": "Alyssa",
"-----END PUBLIC KEY-----\n"}, "publicKey": {"id": "https://instancedomain/users/Alyssa#main-key",
"published": "2016-03-16T00:00:00Z", "owner": "https://instancedomain/users/Alyssa",
"summary": "<p>Hacker in residence</p>", "publicKeyPem": "-----BEGIN PUBLIC KEY-----\n"
"tag": [], "..."
"type": "Person", "-----END PUBLIC KEY-----\n"},
"url": "https://instancedomain/@Alyssa"} "published": "2016-03-16T00:00:00Z",
"summary": "<p>Hacker in residence</p>",
"tag": [],
"type": "Person",
"url": "https://instancedomain/@Alyssa"
}
``` ```
ActivityPub uses [ActivityStreams](https://www.w3.org/TR/activitystreams-core) for its [vocabulary](https://www.w3.org/TR/activitystreams-vocabulary). This is pretty great because ActivityStreams includes all the common terms you need to represent all the activities and content flowing around a social network. It's likely that ActivityStreams already includes all the vocabulary you need, but even if it doesn't, ActivityStreams can be extended via [JSON-LD](https://en.wikipedia.org/wiki/JSON-LD). If you know what JSON-LD is, you can take advantage of the cool linked data approaches provided by JSON-LD. If you don't, don't worry, JSON-LD documents and ActivityStreams can be understood as plain old simple JSON. (If you're going to add extensions, that's the point at which JSON-LD really helps you out). ActivityPub uses [ActivityStreams](https://www.w3.org/TR/activitystreams-core) for its [vocabulary](https://www.w3.org/TR/activitystreams-vocabulary). This is pretty great because ActivityStreams includes all the common terms you need to represent all the activities and content flowing around a social network. It's likely that ActivityStreams already includes all the vocabulary you need, but even if it doesn't, ActivityStreams can be extended via [JSON-LD](https://en.wikipedia.org/wiki/JSON-LD). If you know what JSON-LD is, you can take advantage of the cool linked data approaches provided by JSON-LD. If you don't, don't worry, JSON-LD documents and ActivityStreams can be understood as plain old simple JSON. (If you're going to add extensions, that's the point at which JSON-LD really helps you out).
@ -121,16 +116,18 @@ Let's see an example! Let's say Alyssa wants to catch up with her friend, Ben Bi
### Example 2 ### Example 2
``` json ``` json
{"@context": "https://www.w3.org/ns/activitystreams", {
"type": "Note", "@context": "https://www.w3.org/ns/activitystreams",
"to": ["https://chatty.example/users/ben"], "type": "Note",
"attributedTo": "https://instancedomain/users/alyssa", "to": ["https://chatty.example/users/ben"],
"published": "2039-10-15T10:30:11Z", "attributedTo": "https://instancedomain/users/alyssa",
"rejectReplies": False, "published": "2039-10-15T10:30:11Z",
"mediaType": "text/html", "rejectReplies": False,
"attachment": [], "mediaType": "text/html",
"summary": "Book", "attachment": [],
"content": "Say, did you finish reading that book I lent you?"} "summary": "Book",
"content": "Say, did you finish reading that book I lent you?"
}
``` ```
This is a note addressed to Ben. Since she doesn't want to distract him too much she includes a summary line, which is similar to an email subject line. She POSTs it to her outbox. This is a note addressed to Ben. Since she doesn't want to distract him too much she includes a summary line, which is similar to an email subject line. She POSTs it to her outbox.
@ -141,23 +138,25 @@ Since this is a non-activity object, the server recognizes that this is an objec
### Example 3 ### Example 3
``` json ``` json
{"@context": "https://www.w3.org/ns/activitystreams", {
"type": "Create", "@context": "https://www.w3.org/ns/activitystreams",
"id": "https://instancedomain/users/alyssa/statuses/a29a6843/activity", "type": "Create",
"to": ["https://chatty.example/users/ben"], "id": "https://instancedomain/users/alyssa/statuses/a29a6843/activity",
"actor": "https://instancedomain/users/alyssa", "to": ["https://chatty.example/users/ben"],
"object": { "actor": "https://instancedomain/users/alyssa",
"type": "Note", "object": {
"id": "https://instancedomain/users/alyssa/statuses/49e2d03d", "type": "Note",
"attributedTo": "https://instancedomain/users/alyssa", "id": "https://instancedomain/users/alyssa/statuses/49e2d03d",
"to": ["https://chatty.example/users/ben"], "attributedTo": "https://instancedomain/users/alyssa",
"published": "2039-10-15T10:30:11Z", "to": ["https://chatty.example/users/ben"],
"rejectReplies": False, "published": "2039-10-15T10:30:11Z",
"mediaType": "text/html", "rejectReplies": False,
"attachment": [], "mediaType": "text/html",
"summary": "Book", "attachment": [],
"content": "Say, did you finish reading that book I lent you?" "summary": "Book",
}} "content": "Say, did you finish reading that book I lent you?"
}
}
``` ```
Alyssa's server looks up Ben's [ActivityStreams actor object](https://www.w3.org/TR/activitystreams-vocabulary/#actor-types), finds his inbox endpoint, and POSTs her object to his inbox. Alyssa's server looks up Ben's [ActivityStreams actor object](https://www.w3.org/TR/activitystreams-vocabulary/#actor-types), finds his inbox endpoint, and POSTs her object to his inbox.
@ -172,36 +171,40 @@ Cool! A while later, Alyssa checks what new messages she's gotten. Her phone pol
### Example 4 ### Example 4
``` json ``` json
{"@context": "https://www.w3.org/ns/activitystreams", {
"type": "Create", "@context": "https://www.w3.org/ns/activitystreams",
"id": "https://chatty.example/users/ben/statuses/51086/activity", "type": "Create",
"to": ["https://instancedomain/users/alyssa"], "id": "https://chatty.example/users/ben/statuses/51086/activity",
"actor": "https://chatty.example/users/ben", "to": ["https://instancedomain/users/alyssa"],
"object": { "actor": "https://chatty.example/users/ben",
"type": "Note", "object": {
"id": "https://chatty.example/users/ben/statuses/51085", "type": "Note",
"attributedTo": "https://chatty.example/users/ben", "id": "https://chatty.example/users/ben/statuses/51085",
"to": ["https://instancedomain/users/alyssa"], "attributedTo": "https://chatty.example/users/ben",
"inReplyTo": "https://instancedomain/users/alyssa/statuses/49e2d03d", "to": ["https://instancedomain/users/alyssa"],
"published": "2039-10-15T12:45:45Z", "inReplyTo": "https://instancedomain/users/alyssa/statuses/49e2d03d",
"rejectReplies": False, "published": "2039-10-15T12:45:45Z",
"mediaType": "text/html", "rejectReplies": False,
"content": "<p>Argh, yeah, sorry, I'll get it back to you tomorrow.</p> "mediaType": "text/html",
<p>I was reviewing the section on register machines, "content": "<p>Argh, yeah, sorry, I'll get it back to you tomorrow.</p>
since it's been a while since I wrote one.</p>" <p>I was reviewing the section on register machines,
}} since it's been a while since I wrote one.</p>"
}
}
``` ```
Alyssa is relieved, and likes Ben's post: Alyssa is relieved, and likes Ben's post:
### Example 5 ### Example 5
``` json ``` json
{"@context": "https://www.w3.org/ns/activitystreams", {
"type": "Like", "@context": "https://www.w3.org/ns/activitystreams",
"id": "https://instancedomain/users/alyssa/statuses/5312e10e", "type": "Like",
"to": ["https://chatty.example/users/ben/"], "id": "https://instancedomain/users/alyssa/statuses/5312e10e",
"actor": "https://instancedomain/users/alyssa/", "to": ["https://chatty.example/users/ben/"],
"object": "https://chatty.example/users/ben/statuses/51086"} "actor": "https://instancedomain/users/alyssa/",
"object": "https://chatty.example/users/ben/statuses/51086"
}
``` ```
She POSTs this message to her outbox. (Since it's an activity, her server knows it doesn't need to wrap it in a Create object). She POSTs this message to her outbox. (Since it's an activity, her server knows it doesn't need to wrap it in a Create object).
@ -210,23 +213,25 @@ Feeling happy about things, she decides to post a public message to her follower
### Example 6 ### Example 6
``` json ``` json
{"@context": "https://www.w3.org/ns/activitystreams", {
"type": "Create", "@context": "https://www.w3.org/ns/activitystreams",
"id": "https://instancedomain/users/alyssa/statuses/9282e9cc/activity", "type": "Create",
"to": ["https://instancedomain/users/alyssa/followers", "id": "https://instancedomain/users/alyssa/statuses/9282e9cc/activity",
"https://www.w3.org/ns/activitystreams#Public"], "to": ["https://instancedomain/users/alyssa/followers",
"actor": "https://instancedomain/users/alyssa", "https://www.w3.org/ns/activitystreams#Public"],
"object": { "actor": "https://instancedomain/users/alyssa",
"type": "Note", "object": {
"id": "https://instancedomain/users/alyssa/statuses/d18c55d4", "type": "Note",
"attributedTo": "https://instancedomain/users/alyssa", "id": "https://instancedomain/users/alyssa/statuses/d18c55d4",
"to": ["https://instancedomain/users/alyssa/followers", "attributedTo": "https://instancedomain/users/alyssa",
"https://www.w3.org/ns/activitystreams#Public"], "to": ["https://instancedomain/users/alyssa/followers",
"published": "2039-10-15T13:11:16Z", "https://www.w3.org/ns/activitystreams#Public"],
"rejectReplies": False, "published": "2039-10-15T13:11:16Z",
"mediaType": "text/html", "rejectReplies": False,
"content": "Lending books to friends is nice. Getting them back is even nicer! :)" "mediaType": "text/html",
}} "content": "Lending books to friends is nice. Getting them back is even nicer! :)"
}
}
``` ```
### 1.1 Social Web Working Group ### 1.1 Social Web Working Group
@ -287,6 +292,7 @@ As an example, if example.com receives the activity
"id": "https://example.org/users/~alice/note/23", "id": "https://example.org/users/~alice/note/23",
"type": "Note", "type": "Note",
"attributedTo": "https://example.org/users/~alice", "attributedTo": "https://example.org/users/~alice",
"mediaType": "text/html",
"content": "I'm a goat" "content": "I'm a goat"
} }
} }