Skip to content

Commit d8e6cc6

Browse files
dahliaclaude
andcommitted
Add GoToSocial interaction controls vocabulary
Add type-safe vocabulary support for GoToSocial's interaction controls, which allow post authors to specify who can like, reply to, or announce their posts and to approve interactions. New typeless embedded types (like Endpoints): - InteractionPolicy: attached to posts via interactionPolicy, contains canLike, canReply, and canAnnounce sub-policies - InteractionRule: each sub-policy with automaticApproval and manualApproval URI lists New Activity subtypes for requesting interaction approval: - LikeRequest, ReplyRequest, AnnounceRequest New Object subtypes for proving approved interactions: - LikeAuthorization, ReplyAuthorization, AnnounceAuthorization (with interactingObject and interactionTarget properties) New properties on Object: - interactionPolicy, approvedBy, likeAuthorization, replyAuthorization, announceAuthorization All Object subtypes now include the GoToSocial namespace context (https://gotosocial.org/ns) in their defaultContext so that inherited GTS properties serialize correctly in compact JSON-LD. Part of #453 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a70b9d0 commit d8e6cc6

71 files changed

Lines changed: 21207 additions & 839 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deno.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/fedify/src/federation/handler.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ test("handleActor()", async () => {
134134
"https://w3id.org/security/data-integrity/v1",
135135
"https://www.w3.org/ns/did/v1",
136136
"https://w3id.org/security/multikey/v1",
137+
"https://gotosocial.org/ns",
137138
{
138139
alsoKnownAs: {
139140
"@id": "as:alsoKnownAs",
@@ -236,6 +237,7 @@ test("handleActor()", async () => {
236237
"https://w3id.org/security/data-integrity/v1",
237238
"https://www.w3.org/ns/did/v1",
238239
"https://w3id.org/security/multikey/v1",
240+
"https://gotosocial.org/ns",
239241
{
240242
alsoKnownAs: {
241243
"@id": "as:alsoKnownAs",
@@ -396,6 +398,7 @@ test("handleObject()", async () => {
396398
"@context": [
397399
"https://www.w3.org/ns/activitystreams",
398400
"https://w3id.org/security/data-integrity/v1",
401+
"https://gotosocial.org/ns",
399402
{
400403
Emoji: "toot:Emoji",
401404
Hashtag: "as:Hashtag",
@@ -494,6 +497,7 @@ test("handleObject()", async () => {
494497
"@context": [
495498
"https://www.w3.org/ns/activitystreams",
496499
"https://w3id.org/security/data-integrity/v1",
500+
"https://gotosocial.org/ns",
497501
{
498502
Emoji: "toot:Emoji",
499503
Hashtag: "as:Hashtag",
@@ -679,6 +683,7 @@ test("handleCollection()", async () => {
679683
"https://w3id.org/identity/v1",
680684
"https://www.w3.org/ns/activitystreams",
681685
"https://w3id.org/security/data-integrity/v1",
686+
"https://gotosocial.org/ns",
682687
{
683688
toot: "http://joinmastodon.org/ns#",
684689
misskey: "https://misskey-hub.net/ns#",
@@ -704,6 +709,7 @@ test("handleCollection()", async () => {
704709
"@context": [
705710
"https://www.w3.org/ns/activitystreams",
706711
"https://w3id.org/security/data-integrity/v1",
712+
"https://gotosocial.org/ns",
707713
{
708714
toot: "http://joinmastodon.org/ns#",
709715
misskey: "https://misskey-hub.net/ns#",
@@ -802,6 +808,7 @@ test("handleCollection()", async () => {
802808
"@context": [
803809
"https://www.w3.org/ns/activitystreams",
804810
"https://w3id.org/security/data-integrity/v1",
811+
"https://gotosocial.org/ns",
805812
{
806813
toot: "http://joinmastodon.org/ns#",
807814
misskey: "https://misskey-hub.net/ns#",
@@ -871,6 +878,7 @@ test("handleCollection()", async () => {
871878
"@context": [
872879
"https://www.w3.org/ns/activitystreams",
873880
"https://w3id.org/security/data-integrity/v1",
881+
"https://gotosocial.org/ns",
874882
{
875883
toot: "http://joinmastodon.org/ns#",
876884
misskey: "https://misskey-hub.net/ns#",
@@ -936,6 +944,7 @@ test("handleCollection()", async () => {
936944
"@context": [
937945
"https://www.w3.org/ns/activitystreams",
938946
"https://w3id.org/security/data-integrity/v1",
947+
"https://gotosocial.org/ns",
939948
{
940949
toot: "http://joinmastodon.org/ns#",
941950
misskey: "https://misskey-hub.net/ns#",
@@ -1005,6 +1014,7 @@ test("handleCollection()", async () => {
10051014
"@context": [
10061015
"https://www.w3.org/ns/activitystreams",
10071016
"https://w3id.org/security/data-integrity/v1",
1017+
"https://gotosocial.org/ns",
10081018
{
10091019
toot: "http://joinmastodon.org/ns#",
10101020
misskey: "https://misskey-hub.net/ns#",
@@ -1254,6 +1264,7 @@ test("respondWithObject()", async () => {
12541264
"@context": [
12551265
"https://www.w3.org/ns/activitystreams",
12561266
"https://w3id.org/security/data-integrity/v1",
1267+
"https://gotosocial.org/ns",
12571268
{
12581269
Emoji: "toot:Emoji",
12591270
Hashtag: "as:Hashtag",
@@ -1386,6 +1397,7 @@ test("respondWithObjectIfAcceptable", async () => {
13861397
"@context": [
13871398
"https://www.w3.org/ns/activitystreams",
13881399
"https://w3id.org/security/data-integrity/v1",
1400+
"https://gotosocial.org/ns",
13891401
{
13901402
Emoji: "toot:Emoji",
13911403
Hashtag: "as:Hashtag",
@@ -1565,6 +1577,7 @@ test("handleCustomCollection()", async () => {
15651577
"https://w3id.org/identity/v1",
15661578
"https://www.w3.org/ns/activitystreams",
15671579
"https://w3id.org/security/data-integrity/v1",
1580+
"https://gotosocial.org/ns",
15681581
{
15691582
toot: "http://joinmastodon.org/ns#",
15701583
misskey: "https://misskey-hub.net/ns#",
@@ -1589,6 +1602,7 @@ test("handleCustomCollection()", async () => {
15891602
const CONTEXT = [
15901603
"https://www.w3.org/ns/activitystreams",
15911604
"https://w3id.org/security/data-integrity/v1",
1605+
"https://gotosocial.org/ns",
15921606
{
15931607
toot: "http://joinmastodon.org/ns#",
15941608
misskey: "https://misskey-hub.net/ns#",

packages/fedify/src/sig/proof.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ test("createProof()", async () => {
8282
assertEquals(
8383
proof.proofValue,
8484
decodeHex(
85-
"203e6afc5b7c6affe08d2d67ad100cc6cdcf1f5a438063d16766204956aa8fdd" +
86-
"67cc04088ccf69de36225cab19377b5a032542fd2454b9b9dd001ffbdef5aa03",
85+
"860dda2bec0ab493ae9b0223ac4133ee82246d7d75d6505be2d6c53755a34454" +
86+
"dcb05feae02403ac51faf853d2e873d467f32a252d3b15a9f025e3ed0750b90b",
8787
),
8888
);
8989
assertEquals(proof.created, created);
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"@context": {
3+
"xsd": "http://www.w3.org/2001/XMLSchema#",
4+
"gts": "https://gotosocial.org/ns#",
5+
"LikeRequest": "gts:LikeRequest",
6+
"ReplyRequest": "gts:ReplyRequest",
7+
"AnnounceRequest": "gts:AnnounceRequest",
8+
"QuoteRequest": "gts:QuoteRequest",
9+
"LikeAuthorization": "gts:LikeApproval",
10+
"ReplyAuthorization": "gts:ReplyAuthorization",
11+
"AnnounceAuthorization": "gts:AnnounceAuthorization",
12+
"QuoteAuthorization": "gts:QuoteAuthorization",
13+
"likeAuthorization": {
14+
"@id": "gts:likeAuthorization",
15+
"@type": "@id"
16+
},
17+
"replyAuthorization": {
18+
"@id": "gts:replyAuthorization",
19+
"@type": "@id"
20+
},
21+
"announceAuthorization": {
22+
"@id": "gts:announceAuthorization",
23+
"@type": "@id"
24+
},
25+
"quoteAuthorization": {
26+
"@id": "gts:quoteAuthorization",
27+
"@type": "@id"
28+
},
29+
"interactingObject": {
30+
"@id": "gts:interactingObject",
31+
"@type": "@id"
32+
},
33+
"interactionTarget": {
34+
"@id": "gts:interactionTarget",
35+
"@type": "@id"
36+
},
37+
"interactionPolicy": {
38+
"@id": "gts:interactionPolicy",
39+
"@type": "@id"
40+
},
41+
"canLike": {
42+
"@id": "gts:canLike",
43+
"@type": "@id"
44+
},
45+
"canReply": {
46+
"@id": "gts:canReply",
47+
"@type": "@id"
48+
},
49+
"canAnnounce": {
50+
"@id": "gts:canAnnounce",
51+
"@type": "@id"
52+
},
53+
"canQuote": {
54+
"@id": "gts:canQuote",
55+
"@type": "@id"
56+
},
57+
"automaticApproval": {
58+
"@id": "gts:automaticApproval",
59+
"@type": "@id"
60+
},
61+
"manualApproval": {
62+
"@id": "gts:manualApproval",
63+
"@type": "@id"
64+
},
65+
"hidesToPublicFromUnauthedWeb": {
66+
"@id": "gts:hidesToPublicFromUnauthedWeb",
67+
"@type": "xsd:boolean"
68+
},
69+
"hidesCcPublicFromUnauthedWeb": {
70+
"@id": "gts:hidesCcPublicFromUnauthedWeb",
71+
"@type": "xsd:boolean"
72+
},
73+
"always": {
74+
"@id": "gts:always",
75+
"@type": "@id"
76+
},
77+
"approvalRequired": {
78+
"@id": "gts:approvalRequired",
79+
"@type": "@id"
80+
},
81+
"approvedBy": {
82+
"@id": "gts:approvedBy",
83+
"@type": "@id"
84+
}
85+
}
86+
}

0 commit comments

Comments
 (0)