@fedify/fedify 1.6.12 → 1.6.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{actor-tT_B0pDn.d.ts → actor.d.ts} +3 -3
- package/dist/{actor-BxaCJsn8.js → actor.js} +6 -6
- package/dist/{assert-LOEeCUK5.js → assert.js} +2 -2
- package/dist/{assert_equals-B44MxcIj.js → assert_equals.js} +16 -16
- package/dist/{assert_instance_of-XtuFevV_.js → assert_instance_of.js} +2 -2
- package/dist/{assert_is_error-BTlryvT0.js → assert_is_error.js} +2 -2
- package/dist/{assert_not_equals-C685gKx6.js → assert_not_equals.js} +3 -6
- package/dist/{assert_rejects-DWQ4jaf9.js → assert_rejects.js} +3 -3
- package/dist/{assert_throws-YetpVSc-.js → assert_throws.js} +3 -3
- package/dist/{authdocloader-niAJMnCQ.js → authdocloader.js} +8 -8
- package/dist/{builder-DboGa9iv.js → builder.js} +7 -7
- package/dist/{chunk-Cx8LTkjm.js → chunk.js} +22 -15
- package/dist/{client-Cd552pKL.d.ts → client.d.ts} +2 -2
- package/dist/{client-De_5-2EG.js → client.js} +3 -3
- package/dist/{collection-Dfb0TPno.js → collection.js} +2 -3
- package/dist/compat/mod.d.ts +79 -12
- package/dist/compat/mod.js +1 -2
- package/dist/compat/transformers.test.js +34 -38
- package/dist/{context-DRhhOsMk.d.ts → context.d.ts} +10 -10
- package/dist/{context-KOy1fHBn.js → context.js} +5 -5
- package/dist/{docloader-DlUDOVSe.d.ts → docloader.d.ts} +2 -2
- package/dist/{docloader-CPBLJsVK.js → docloader.js} +32 -152
- package/dist/{docloader-09nVWLAZ.js → docloader2.js} +1 -1
- package/dist/{esm-DO9PrujO.js → esm.js} +36 -22
- package/dist/federation/builder.test.js +20 -26
- package/dist/federation/collection.test.js +11 -16
- package/dist/federation/handler.test.js +41 -48
- package/dist/federation/inbox.test.js +11 -11
- package/dist/federation/keycache.test.js +12 -11
- package/dist/federation/kv.test.js +8 -10
- package/dist/federation/middleware.test.js +99 -120
- package/dist/federation/mod.d.ts +4 -13
- package/dist/federation/mod.js +195 -12
- package/dist/federation/mq.test.js +9 -14
- package/dist/federation/retry.test.js +5 -4
- package/dist/federation/router.test.js +9 -10
- package/dist/federation/send.test.js +23 -24
- package/dist/{http-BkUCISGt.d.ts → http.d.ts} +3 -3
- package/dist/{http-B__WhFrv.js → http.js} +19 -27
- package/dist/{inbox-L4MTtAQ4.js → inbox.js} +5 -5
- package/dist/key.js +16 -0
- package/dist/{key-Dlbuqhbr.js → key2.js} +5 -5
- package/dist/{keycache-BEb0DSk7.js → keycache.js} +2 -2
- package/dist/{keys-CqpeF-EG.js → keys.js} +2 -2
- package/dist/{kv-p8sC8PTT.d.ts → kv.d.ts} +1 -1
- package/dist/{kv-DohFOP2C.js → kv.js} +1 -1
- package/dist/{langstr-DbWheeIS.js → langstr.js} +1 -1
- package/dist/{ld-45SsuOmB.js → ld.js} +9 -12
- package/dist/{lookup-vJccIKCS.d.ts → lookup.d.ts} +2 -2
- package/dist/{lookup-HY083HcK.js → lookup.js} +4 -4
- package/dist/{lookup-CWdbkwKD.js → lookup2.js} +6 -6
- package/dist/{middleware-D2HU0DhQ.js → middleware.js} +35 -39
- package/dist/middleware2.js +32 -0
- package/dist/mod.d.ts +17 -17
- package/dist/mod.js +17 -17
- package/dist/{mod-DSPyncxx.d.ts → mod2.d.ts} +3 -3
- package/dist/{mod-j45KmAfR.d.ts → mod3.d.ts} +4 -4
- package/dist/{mq-nceTGCuc.d.ts → mq.d.ts} +1 -1
- package/dist/{multibase-CnLHszip.js → multibase.js} +1 -1
- package/dist/nodeinfo/client.test.js +19 -28
- package/dist/nodeinfo/handler.test.js +37 -44
- package/dist/nodeinfo/mod.d.ts +2 -5
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/semver.test.js +13 -21
- package/dist/nodeinfo/types.test.js +9 -11
- package/dist/{owner-CbRc94FP.d.ts → owner.d.ts} +4 -4
- package/dist/{owner-BYxqeMiw.js → owner.js} +4 -4
- package/dist/{proof-BjHA4H_1.js → proof.js} +11 -13
- package/dist/{retry-BiIhZWgD.js → retry.js} +1 -1
- package/dist/{router-D_aVZZUc.js → router.js} +1 -1
- package/dist/runtime/authdocloader.test.js +22 -26
- package/dist/runtime/docloader.test.js +50 -46
- package/dist/runtime/key.test.js +31 -53
- package/dist/runtime/langstr.test.js +8 -10
- package/dist/runtime/mod.d.ts +103 -6
- package/dist/runtime/mod.js +6 -7
- package/dist/runtime/multibase/multibase.test.js +12 -18
- package/dist/runtime/url.test.js +7 -6
- package/dist/{semver-BNrOOAs9.js → semver.js} +7 -17
- package/dist/{send-BQA1p7vs.js → send.js} +4 -4
- package/dist/sig/http.test.js +104 -168
- package/dist/sig/key.test.js +17 -20
- package/dist/sig/ld.test.js +28 -35
- package/dist/sig/mod.d.ts +3 -7
- package/dist/sig/mod.js +6 -7
- package/dist/sig/owner.test.js +24 -30
- package/dist/sig/proof.test.js +24 -29
- package/dist/{std__assert-o_r9vqm1.js → std__assert.js} +7 -13
- package/dist/testing/docloader.test.js +9 -12
- package/dist/testing/mod.js +2 -1
- package/dist/{testing-DLyvtiiW.js → testing.js} +2 -2
- package/dist/{transformers-ghwJuzGY.js → transformers.js} +1 -1
- package/dist/{type-CFuiGLz9.js → type.js} +1 -1
- package/dist/{types-CJHS5pXl.js → types.js} +2 -2
- package/dist/{url-C2xuoQD1.js → url.js} +1 -1
- package/dist/vocab/actor.test.js +76 -128
- package/dist/vocab/lookup.test.js +19 -23
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +10 -10
- package/dist/vocab/vocab.test.js +90 -109
- package/dist/{vocab-DSFLLLe6.d.ts → vocab.d.ts} +2 -2
- package/dist/{vocab-DVEzP_bQ.js → vocab.js} +318 -454
- package/dist/webfinger/handler.test.js +40 -48
- package/dist/webfinger/lookup.test.js +12 -15
- package/dist/webfinger/mod.d.ts +1 -4
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.test.js +7 -9
- package/dist/x/hono.d.ts +2 -11
- package/dist/x/sveltekit.d.ts +2 -11
- package/package.json +1 -1
- package/dist/actor-7vCpWIGd.js +0 -34925
- package/dist/authdocloader-CVhMTbv4.js +0 -53
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/docloader-RFcxdgI8.js +0 -4590
- package/dist/federation-DyRlaC4X.js +0 -192
- package/dist/http-CnSGudcE.js +0 -789
- package/dist/key-BG_CTepE.js +0 -10
- package/dist/key-BQg3A7eo.js +0 -257
- package/dist/key-CeY-eted.js +0 -16
- package/dist/lookup-CdHTw-tQ.js +0 -127
- package/dist/middleware-BP-XbRGC.js +0 -17
- package/dist/middleware-Cg-eSyqX.js +0 -3501
- package/dist/middleware-JoLpCiMC.js +0 -33
- package/dist/mod-1pDWKvUL.d.ts +0 -2
- package/dist/mod-BTHfUeLo.d.ts +0 -104
- package/dist/mod-CgmTOt4z.d.ts +0 -82
- package/dist/mod-GIh5OYxW.d.ts +0 -2
- package/dist/mod-g0xFzAP9.d.ts +0 -2
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/proof-DVYup76O.js +0 -582
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/types-D7_MRRa4.js +0 -455
- package/dist/vocab-aaGb1Tji.js +0 -168
- package/dist/webfinger-C3GIyXIg.js +0 -4
- /package/dist/{denokv-B_GFWjrl.js → denokv.js} +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
6
|
-
import { createRequest, getRemoteDocument, logRequest } from "./docloader-CPBLJsVK.js";
|
|
7
|
-
import { UrlError, validatePublicUrl } from "./url-C2xuoQD1.js";
|
|
8
|
-
import { validateCryptoKey } from "./key-Dlbuqhbr.js";
|
|
9
|
-
import { doubleKnock } from "./http-CnSGudcE.js";
|
|
10
|
-
import { getLogger } from "@logtape/logtape";
|
|
11
|
-
|
|
12
|
-
//#region runtime/authdocloader.ts
|
|
13
|
-
const logger = getLogger([
|
|
14
|
-
"fedify",
|
|
15
|
-
"runtime",
|
|
16
|
-
"docloader"
|
|
17
|
-
]);
|
|
18
|
-
/**
|
|
19
|
-
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
|
20
|
-
* Note that an authenticated document loader intentionally does not cache
|
|
21
|
-
* the fetched documents.
|
|
22
|
-
* @param identity The identity to get the document loader for.
|
|
23
|
-
* The actor's key pair.
|
|
24
|
-
* @param options The options for the document loader.
|
|
25
|
-
* @returns The authenticated document loader.
|
|
26
|
-
* @throws {TypeError} If the key is invalid or unsupported.
|
|
27
|
-
* @since 0.4.0
|
|
28
|
-
*/
|
|
29
|
-
function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, userAgent, specDeterminer, tracerProvider } = {}) {
|
|
30
|
-
validateCryptoKey(identity.privateKey);
|
|
31
|
-
async function load(url) {
|
|
32
|
-
if (!allowPrivateAddress) try {
|
|
33
|
-
await validatePublicUrl(url);
|
|
34
|
-
} catch (error) {
|
|
35
|
-
if (error instanceof UrlError) logger.error("Disallowed private URL: {url}", {
|
|
36
|
-
url,
|
|
37
|
-
error
|
|
38
|
-
});
|
|
39
|
-
throw error;
|
|
40
|
-
}
|
|
41
|
-
const originalRequest = createRequest(url, { userAgent });
|
|
42
|
-
const response = await doubleKnock(originalRequest, identity, {
|
|
43
|
-
specDeterminer,
|
|
44
|
-
log: logRequest,
|
|
45
|
-
tracerProvider
|
|
46
|
-
});
|
|
47
|
-
return getRemoteDocument(url, response, load);
|
|
48
|
-
}
|
|
49
|
-
return load;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
//#endregion
|
|
53
|
-
export { getAuthenticatedDocumentLoader };
|
package/dist/compat-Bb5myD13.js
DELETED