Skip to content

Commit e09fd1b

Browse files
authored
Merge pull request #622 from dahlia/vocab/gts-interaction-controls
GoToSocial interaction controls vocabulary
2 parents e79f888 + b986cd6 commit e09fd1b

76 files changed

Lines changed: 34316 additions & 12005 deletions

Some content is hidden

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

.github/actions/setup-deno/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ runs:
66
steps:
77
- uses: denoland/setup-deno@v2
88
with:
9-
deno-version: 2.7.1 # Keep in sync with mise.toml
9+
deno-version: 2.7.5 # Keep in sync with mise.toml

CHANGES.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,23 @@ To be released.
4141

4242
### @fedify/vocab-runtime
4343

44+
- Updated the preloaded <https://gotosocial.org/ns> JSON-LD context to
45+
match the current [GoToSocial] v0.21+ namespace, adding new type terms
46+
(`LikeRequest`, `LikeAuthorization`, etc.) and property terms
47+
(`automaticApproval`, `manualApproval`, `interactingObject`, etc.) while
48+
retaining deprecated terms (`always`, `approvalRequired`) for backward
49+
compatibility. [[#453], [#622]]
50+
4451
- Added optional `FetchError.response` so callers can inspect the original
4552
failed HTTP response when remote document or key fetches return an HTTP
4653
error (such as `404 Not Found` or `410 Gone`). This enables higher-level
4754
APIs to distinguish transport failures from specific HTTP fetch failures.
4855
[[#611]]
4956

57+
[GoToSocial]: https://gotosocial.org/
58+
[#453]: https://github.com/fedify-dev/fedify/issues/453
59+
[#622]: https://github.com/fedify-dev/fedify/pull/622
60+
5061
### @fedify/cli
5162

5263
- Added `--reverse` option to `fedify lookup` to reverse presentation order
@@ -81,6 +92,21 @@ To be released.
8192

8293
### @fedify/vocab
8394

95+
- Added [GoToSocial] interaction controls vocabulary for expressing who
96+
can like, reply to, or announce posts and for approving interactions.
97+
[[#453], [#622]]
98+
99+
- Added `InteractionPolicy` and `InteractionRule` typeless value
100+
classes.
101+
- Added `LikeRequest`, `ReplyRequest`, and `AnnounceRequest` activity
102+
types for requesting interaction approval.
103+
- Added `LikeAuthorization`, `ReplyAuthorization`, and
104+
`AnnounceAuthorization` types for proving approved interactions.
105+
- Added `Object.interactionPolicy`, `Object.approvedBy`,
106+
`Object.getLikeAuthorization()`/`Object.likeAuthorizationId`,
107+
`Object.getReplyAuthorization()`/`Object.replyAuthorizationId`, and
108+
`Object.getAnnounceAuthorization()`/`Object.announceAuthorizationId`.
109+
84110
- Fixed `Endpoints.toJsonLd()` to no longer emit invalid
85111
`"type": "as:Endpoints"` in the serialized JSON-LD. The `as:Endpoints`
86112
type does not exist in the ActivityStreams vocabulary, and its presence

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.

examples/fresh/deno.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"dom.asynciterable",
3232
"dom.iterable",
3333
"deno.ns",
34-
"deno.unstable"
34+
"deno.unstable",
35+
"deno.temporal"
3536
],
3637
"jsx": "precompile",
3738
"jsxImportSource": "preact",

mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tools]
22
bun = "1.2.22"
3-
deno = "2.7.1"
3+
deno = "2.7.5"
44
node = "22"
55
pnpm = "10.28.0"
66

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+
}

packages/vocab-runtime/src/contexts.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4247,7 +4247,40 @@ const preloadedContexts: Record<string, unknown> = {
42474247
},
42484248
"https://gotosocial.org/ns": {
42494249
"@context": {
4250+
"xsd": "http://www.w3.org/2001/XMLSchema#",
42504251
"gts": "https://gotosocial.org/ns#",
4252+
"LikeRequest": "gts:LikeRequest",
4253+
"ReplyRequest": "gts:ReplyRequest",
4254+
"AnnounceRequest": "gts:AnnounceRequest",
4255+
"QuoteRequest": "gts:QuoteRequest",
4256+
"LikeAuthorization": "gts:LikeApproval",
4257+
"ReplyAuthorization": "gts:ReplyAuthorization",
4258+
"AnnounceAuthorization": "gts:AnnounceAuthorization",
4259+
"QuoteAuthorization": "gts:QuoteAuthorization",
4260+
"likeAuthorization": {
4261+
"@id": "gts:likeAuthorization",
4262+
"@type": "@id",
4263+
},
4264+
"replyAuthorization": {
4265+
"@id": "gts:replyAuthorization",
4266+
"@type": "@id",
4267+
},
4268+
"announceAuthorization": {
4269+
"@id": "gts:announceAuthorization",
4270+
"@type": "@id",
4271+
},
4272+
"quoteAuthorization": {
4273+
"@id": "gts:quoteAuthorization",
4274+
"@type": "@id",
4275+
},
4276+
"interactingObject": {
4277+
"@id": "gts:interactingObject",
4278+
"@type": "@id",
4279+
},
4280+
"interactionTarget": {
4281+
"@id": "gts:interactionTarget",
4282+
"@type": "@id",
4283+
},
42514284
"interactionPolicy": {
42524285
"@id": "gts:interactionPolicy",
42534286
"@type": "@id",
@@ -4264,6 +4297,26 @@ const preloadedContexts: Record<string, unknown> = {
42644297
"@id": "gts:canAnnounce",
42654298
"@type": "@id",
42664299
},
4300+
"canQuote": {
4301+
"@id": "gts:canQuote",
4302+
"@type": "@id",
4303+
},
4304+
"automaticApproval": {
4305+
"@id": "gts:automaticApproval",
4306+
"@type": "@id",
4307+
},
4308+
"manualApproval": {
4309+
"@id": "gts:manualApproval",
4310+
"@type": "@id",
4311+
},
4312+
"hidesToPublicFromUnauthedWeb": {
4313+
"@id": "gts:hidesToPublicFromUnauthedWeb",
4314+
"@type": "xsd:boolean",
4315+
},
4316+
"hidesCcPublicFromUnauthedWeb": {
4317+
"@id": "gts:hidesCcPublicFromUnauthedWeb",
4318+
"@type": "xsd:boolean",
4319+
},
42674320
"always": {
42684321
"@id": "gts:always",
42694322
"@type": "@id",

0 commit comments

Comments
 (0)