Skip to content

Commit 1fc921b

Browse files
committed
Merge tag '1.3.24' into 1.4-maintenance
Fedify 1.3.24
2 parents cb9d612 + 04fddf7 commit 1fc921b

File tree

4 files changed

+217
-22
lines changed

4 files changed

+217
-22
lines changed

CHANGES.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Version 1.4.17
88

99
To be released.
1010

11+
- Improved the AT Protocol URI workaround to handle all DID methods and
12+
edge cases. The fix now properly percent-encodes any authority component
13+
in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods
14+
beyond just `did:plc`. Also handles URIs without path components
15+
correctly. [[#436]]
16+
1117

1218
Version 1.4.16
1319
--------------
@@ -306,6 +312,18 @@ Released on February 5, 2025.
306312
[#195]: https://github.com/fedify-dev/fedify/issues/195
307313

308314

315+
Version 1.3.24
316+
--------------
317+
318+
Released on September 17, 2025.
319+
320+
- Improved the AT Protocol URI workaround to handle all DID methods and
321+
edge cases. The fix now properly percent-encodes any authority component
322+
in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods
323+
beyond just `did:plc`. Also handles URIs without path components
324+
correctly. [[#436]]
325+
326+
309327
Version 1.3.23
310328
--------------
311329

@@ -721,6 +739,18 @@ Released on November 30, 2024.
721739
[#193]: https://github.com/fedify-dev/fedify/issues/193
722740

723741

742+
Version 1.2.27
743+
--------------
744+
745+
Released on September 17, 2025.
746+
747+
- Improved the AT Protocol URI workaround to handle all DID methods and
748+
edge cases. The fix now properly percent-encodes any authority component
749+
in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods
750+
beyond just `did:plc`. Also handles URIs without path components
751+
correctly. [[#436]]
752+
753+
724754
Version 1.2.26
725755
--------------
726756

@@ -1169,6 +1199,18 @@ Released on October 31, 2024.
11691199
[#118]: https://github.com/fedify-dev/fedify/issues/118
11701200

11711201

1202+
Version 1.1.27
1203+
--------------
1204+
1205+
Released on September 17, 2025.
1206+
1207+
- Improved the AT Protocol URI workaround to handle all DID methods and
1208+
edge cases. The fix now properly percent-encodes any authority component
1209+
in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods
1210+
beyond just `did:plc`. Also handles URIs without path components
1211+
correctly. [[#436]]
1212+
1213+
11721214
Version 1.1.26
11731215
--------------
11741216

@@ -1658,6 +1700,18 @@ Released on October 20, 2024.
16581700
[#150]: https://github.com/fedify-dev/fedify/issues/150
16591701

16601702

1703+
Version 1.0.30
1704+
--------------
1705+
1706+
Released on September 17, 2025.
1707+
1708+
- Improved the AT Protocol URI workaround to handle all DID methods and
1709+
edge cases. The fix now properly percent-encodes any authority component
1710+
in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods
1711+
beyond just `did:plc`. Also handles URIs without path components
1712+
correctly. [[#436]]
1713+
1714+
16611715
Version 1.0.29
16621716
--------------
16631717

src/codegen/__snapshots__/class.test.ts.snap

Lines changed: 130 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7915,8 +7915,19 @@ get urls(): ((URL | Link))[] {
79157915
const decoded =
79167916
typeof v === \\"object\\" && \\"@id\\" in v
79177917
&& typeof v[\\"@id\\"] === \\"string\\"
7918-
&& v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://did:plc:\\")
7919-
? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13))
7918+
&& v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://\\")
7919+
? new URL(\\"at://\\" +
7920+
encodeURIComponent(
7921+
v[\\"@id\\"].includes(\\"/\\", 5)
7922+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
7923+
: v[\\"@id\\"].slice(5)
7924+
) +
7925+
(
7926+
v[\\"@id\\"].includes(\\"/\\", 5)
7927+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
7928+
: \\"\\"
7929+
)
7930+
)
79207931
: new URL(v[\\"@id\\"]) : typeof v === \\"object\\" && \\"@type\\" in v
79217932
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some(
79227933
t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd(
@@ -13528,8 +13539,19 @@ get endpoints(): (URL)[] {
1352813539
: _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint__array
1352913540
) {
1353013541
if (v == null) continue;
13531-
_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\")
13532-
? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13))
13542+
_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(v[\\"@id\\"].startsWith(\\"at://\\")
13543+
? new URL(\\"at://\\" +
13544+
encodeURIComponent(
13545+
v[\\"@id\\"].includes(\\"/\\", 5)
13546+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
13547+
: v[\\"@id\\"].slice(5)
13548+
) +
13549+
(
13550+
v[\\"@id\\"].includes(\\"/\\", 5)
13551+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
13552+
: \\"\\"
13553+
)
13554+
)
1353313555
: new URL(v[\\"@id\\"]))
1353413556
}
1353513557
instance.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint;
@@ -29456,8 +29478,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint
2945629478
: _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl__array
2945729479
) {
2945829480
if (v == null) continue;
29459-
_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\")
29460-
? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13))
29481+
_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(v[\\"@id\\"].startsWith(\\"at://\\")
29482+
? new URL(\\"at://\\" +
29483+
encodeURIComponent(
29484+
v[\\"@id\\"].includes(\\"/\\", 5)
29485+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
29486+
: v[\\"@id\\"].slice(5)
29487+
) +
29488+
(
29489+
v[\\"@id\\"].includes(\\"/\\", 5)
29490+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
29491+
: \\"\\"
29492+
)
29493+
)
2946129494
: new URL(v[\\"@id\\"]))
2946229495
}
2946329496
instance.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl;
@@ -29473,8 +29506,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint
2947329506
: _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint__array
2947429507
) {
2947529508
if (v == null) continue;
29476-
_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\")
29477-
? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13))
29509+
_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(v[\\"@id\\"].startsWith(\\"at://\\")
29510+
? new URL(\\"at://\\" +
29511+
encodeURIComponent(
29512+
v[\\"@id\\"].includes(\\"/\\", 5)
29513+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
29514+
: v[\\"@id\\"].slice(5)
29515+
) +
29516+
(
29517+
v[\\"@id\\"].includes(\\"/\\", 5)
29518+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
29519+
: \\"\\"
29520+
)
29521+
)
2947829522
: new URL(v[\\"@id\\"]))
2947929523
}
2948029524
instance.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint = _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint;
@@ -29490,8 +29534,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint
2949029534
: _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint__array
2949129535
) {
2949229536
if (v == null) continue;
29493-
_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\")
29494-
? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13))
29537+
_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(v[\\"@id\\"].startsWith(\\"at://\\")
29538+
? new URL(\\"at://\\" +
29539+
encodeURIComponent(
29540+
v[\\"@id\\"].includes(\\"/\\", 5)
29541+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
29542+
: v[\\"@id\\"].slice(5)
29543+
) +
29544+
(
29545+
v[\\"@id\\"].includes(\\"/\\", 5)
29546+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
29547+
: \\"\\"
29548+
)
29549+
)
2949529550
: new URL(v[\\"@id\\"]))
2949629551
}
2949729552
instance.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint = _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint;
@@ -29507,8 +29562,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint
2950729562
: _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey__array
2950829563
) {
2950929564
if (v == null) continue;
29510-
_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\")
29511-
? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13))
29565+
_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(v[\\"@id\\"].startsWith(\\"at://\\")
29566+
? new URL(\\"at://\\" +
29567+
encodeURIComponent(
29568+
v[\\"@id\\"].includes(\\"/\\", 5)
29569+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
29570+
: v[\\"@id\\"].slice(5)
29571+
) +
29572+
(
29573+
v[\\"@id\\"].includes(\\"/\\", 5)
29574+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
29575+
: \\"\\"
29576+
)
29577+
)
2951229578
: new URL(v[\\"@id\\"]))
2951329579
}
2951429580
instance.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey = _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey;
@@ -29524,8 +29590,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint
2952429590
: _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey__array
2952529591
) {
2952629592
if (v == null) continue;
29527-
_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\")
29528-
? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13))
29593+
_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(v[\\"@id\\"].startsWith(\\"at://\\")
29594+
? new URL(\\"at://\\" +
29595+
encodeURIComponent(
29596+
v[\\"@id\\"].includes(\\"/\\", 5)
29597+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
29598+
: v[\\"@id\\"].slice(5)
29599+
) +
29600+
(
29601+
v[\\"@id\\"].includes(\\"/\\", 5)
29602+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
29603+
: \\"\\"
29604+
)
29605+
)
2952929606
: new URL(v[\\"@id\\"]))
2953029607
}
2953129608
instance.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey = _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey;
@@ -29541,8 +29618,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint
2954129618
: _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox__array
2954229619
) {
2954329620
if (v == null) continue;
29544-
_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\")
29545-
? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13))
29621+
_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(v[\\"@id\\"].startsWith(\\"at://\\")
29622+
? new URL(\\"at://\\" +
29623+
encodeURIComponent(
29624+
v[\\"@id\\"].includes(\\"/\\", 5)
29625+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
29626+
: v[\\"@id\\"].slice(5)
29627+
) +
29628+
(
29629+
v[\\"@id\\"].includes(\\"/\\", 5)
29630+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
29631+
: \\"\\"
29632+
)
29633+
)
2954629634
: new URL(v[\\"@id\\"]))
2954729635
}
2954829636
instance.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox = _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox;
@@ -37136,8 +37224,19 @@ get names(): ((string | LanguageString))[] {
3713637224
: _pVjLsybKQdmkjuU7MHjiVmNnuj7_href__array
3713737225
) {
3713837226
if (v == null) continue;
37139-
_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\")
37140-
? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13))
37227+
_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(v[\\"@id\\"].startsWith(\\"at://\\")
37228+
? new URL(\\"at://\\" +
37229+
encodeURIComponent(
37230+
v[\\"@id\\"].includes(\\"/\\", 5)
37231+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
37232+
: v[\\"@id\\"].slice(5)
37233+
) +
37234+
(
37235+
v[\\"@id\\"].includes(\\"/\\", 5)
37236+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
37237+
: \\"\\"
37238+
)
37239+
)
3714137240
: new URL(v[\\"@id\\"]))
3714237241
}
3714337242
instance.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = _pVjLsybKQdmkjuU7MHjiVmNnuj7_href;
@@ -54228,8 +54327,19 @@ proofs?: (DataIntegrityProof | URL)[];accuracy?: number | null;altitude?: number
5422854327
typeof v === \\"object\\" && \\"@value\\" in v
5422954328
&& (v[\\"@value\\"] == \\"cm\\" || v[\\"@value\\"] == \\"feet\\" || v[\\"@value\\"] == \\"inches\\" || v[\\"@value\\"] == \\"km\\" || v[\\"@value\\"] == \\"m\\" || v[\\"@value\\"] == \\"miles\\") ? v[\\"@value\\"] : typeof v === \\"object\\" && \\"@id\\" in v
5423054329
&& typeof v[\\"@id\\"] === \\"string\\"
54231-
&& v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://did:plc:\\")
54232-
? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13))
54330+
&& v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://\\")
54331+
? new URL(\\"at://\\" +
54332+
encodeURIComponent(
54333+
v[\\"@id\\"].includes(\\"/\\", 5)
54334+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
54335+
: v[\\"@id\\"].slice(5)
54336+
) +
54337+
(
54338+
v[\\"@id\\"].includes(\\"/\\", 5)
54339+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
54340+
: \\"\\"
54341+
)
54342+
)
5423354343
: new URL(v[\\"@id\\"]) : undefined
5423454344
;
5423554345
if (typeof decoded === \\"undefined\\") continue;

src/codegen/type.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,19 @@ const scalarTypes: Record<string, ScalarType> = {
144144
&& ${v}["@id"] !== "" && ${v}["@id"] !== "/"`;
145145
},
146146
decoder(v) {
147-
return `${v}["@id"].startsWith("at://did:plc:")
148-
? new URL("at://did%3Aplc%3A" + ${v}["@id"].slice(13))
147+
return `${v}["@id"].startsWith("at://")
148+
? new URL("at://" +
149+
encodeURIComponent(
150+
${v}["@id"].includes("/", 5)
151+
? ${v}["@id"].slice(5, ${v}["@id"].indexOf("/", 5))
152+
: ${v}["@id"].slice(5)
153+
) +
154+
(
155+
${v}["@id"].includes("/", 5)
156+
? ${v}["@id"].slice(${v}["@id"].indexOf("/", 5))
157+
: ""
158+
)
159+
)
149160
: new URL(${v}["@id"])`;
150161
},
151162
},

src/vocab/vocab.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,26 @@ test("Link.fromJsonLd()", async () => {
835835
"at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem/app.bsky.feed.post/3lyxjjs27jkqg",
836836
),
837837
);
838+
839+
const link2 = await Link.fromJsonLd({
840+
"@context": "https://www.w3.org/ns/activitystreams",
841+
"type": "Link",
842+
"href": "at://bnewbold.bsky.team/app.bsky.feed.post/3jwdwj2ctlk26",
843+
});
844+
assertEquals(
845+
link2.href,
846+
new URL("at://bnewbold.bsky.team/app.bsky.feed.post/3jwdwj2ctlk26"),
847+
);
848+
849+
const link3 = await Link.fromJsonLd({
850+
"@context": "https://www.w3.org/ns/activitystreams",
851+
"type": "Link",
852+
"href": "at://did:plc:ia76kvnndjutgedggx2ibrem",
853+
});
854+
assertEquals(
855+
link3.href,
856+
new URL("at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem"),
857+
);
838858
});
839859

840860
function getAllProperties(

0 commit comments

Comments
 (0)