@fedify/fedify 0.15.0-dev.374 → 0.15.0-dev.375
Sign up to get free protection for your applications and to get access to all the features.
package/CHANGES.md
CHANGED
@@ -10,6 +10,8 @@ To be released.
|
|
10
10
|
|
11
11
|
- Removed `expand` option of `Object.toJsonLd()` method, which was deprecated
|
12
12
|
in version 0.14.0. Use `format: "expand"` option instead.
|
13
|
+
- Added `Context.lookupObject()` method.
|
14
|
+
- Added `allowPrivateAddress` option to `CreateFederationOptions` interface.
|
13
15
|
- Renamed the short option `-c` for `--compact` of `fedify lookup` command to
|
14
16
|
`-C` to avoid conflict with the short option `-c` for `--cache-dir`.
|
15
17
|
- Added `-r`/`--raw` option to `fedify lookup` command to output the raw JSON
|
@@ -5,6 +5,7 @@ import { fetchDocumentLoader, getAuthenticatedDocumentLoader, kvCache, } from ".
|
|
5
5
|
import { verifyRequest } from "../sig/http.js";
|
6
6
|
import { exportJwk, importJwk, validateCryptoKey } from "../sig/key.js";
|
7
7
|
import { getKeyOwner } from "../sig/owner.js";
|
8
|
+
import { lookupObject } from "../vocab/lookup.js";
|
8
9
|
import { Activity, CryptographicKey, Multikey, } from "../vocab/vocab.js";
|
9
10
|
import { handleWebFinger } from "../webfinger/handler.js";
|
10
11
|
import { buildCollectionSynchronizationHeader } from "./collection.js";
|
@@ -72,15 +73,31 @@ class FederationImpl {
|
|
72
73
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
73
74
|
this.objectCallbacks = {};
|
74
75
|
this.objectTypeIds = {};
|
76
|
+
if (options.allowPrivateAddress) {
|
77
|
+
if (options.documentLoader != null) {
|
78
|
+
throw new TypeError("Cannot set documentLoader with allowPrivateAddress turned on.");
|
79
|
+
}
|
80
|
+
else if (options.contextLoader != null) {
|
81
|
+
throw new TypeError("Cannot set contextLoader with allowPrivateAddress turned on.");
|
82
|
+
}
|
83
|
+
else if (options.authenticatedDocumentLoaderFactory != null) {
|
84
|
+
throw new TypeError("Cannot set authenticatedDocumentLoaderFactory with " +
|
85
|
+
"allowPrivateAddress turned on.");
|
86
|
+
}
|
87
|
+
}
|
75
88
|
this.documentLoader = options.documentLoader ?? kvCache({
|
76
|
-
loader:
|
89
|
+
loader: options.allowPrivateAddress
|
90
|
+
? (url) => fetchDocumentLoader(url, true)
|
91
|
+
: fetchDocumentLoader,
|
77
92
|
kv: options.kv,
|
78
93
|
prefix: this.kvPrefixes.remoteDocument,
|
79
94
|
});
|
80
95
|
this.contextLoader = options.contextLoader ?? this.documentLoader;
|
81
96
|
this.authenticatedDocumentLoaderFactory =
|
82
97
|
options.authenticatedDocumentLoaderFactory ??
|
83
|
-
|
98
|
+
(options.allowPrivateAddress
|
99
|
+
? (identity) => getAuthenticatedDocumentLoader(identity, true)
|
100
|
+
: getAuthenticatedDocumentLoader);
|
84
101
|
this.onOutboxError = options.onOutboxError;
|
85
102
|
this.signatureTimeWindow = options.signatureTimeWindow ?? { minutes: 1 };
|
86
103
|
this.skipSignatureVerification = options.skipSignatureVerification ?? false;
|
@@ -1278,6 +1295,12 @@ class ContextImpl {
|
|
1278
1295
|
}
|
1279
1296
|
return this.federation.authenticatedDocumentLoaderFactory(identity);
|
1280
1297
|
}
|
1298
|
+
lookupObject(identifier, options = {}) {
|
1299
|
+
return lookupObject(identifier, {
|
1300
|
+
documentLoader: options.documentLoader ?? this.documentLoader,
|
1301
|
+
contextLoader: options.contextLoader ?? this.contextLoader,
|
1302
|
+
});
|
1303
|
+
}
|
1281
1304
|
async sendActivity(sender, recipients, activity, options = {}) {
|
1282
1305
|
let keys;
|
1283
1306
|
if ("handle" in sender) {
|
package/package.json
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
import * as dntShim from "../_dnt.shims.js";
|
4
4
|
import type { DocumentLoader } from "../runtime/docloader.js";
|
5
5
|
import type { Actor, Recipient } from "../vocab/actor.js";
|
6
|
+
import type { LookupObjectOptions } from "../vocab/lookup.js";
|
6
7
|
import type { Activity, CryptographicKey, Multikey, Object } from "../vocab/mod.js";
|
7
8
|
import type { SenderKeyPair } from "./send.js";
|
8
9
|
/**
|
@@ -166,6 +167,44 @@ export interface Context<TContextData> {
|
|
166
167
|
keyId: URL;
|
167
168
|
privateKey: dntShim.CryptoKey;
|
168
169
|
}): DocumentLoader;
|
170
|
+
/**
|
171
|
+
* Looks up an ActivityStreams object by its URI (including `acct:` URIs)
|
172
|
+
* or a fediverse handle (e.g., `@user@server` or `user@server`).
|
173
|
+
*
|
174
|
+
* @example
|
175
|
+
* ``` typescript
|
176
|
+
* // Look up an actor by its fediverse handle:
|
177
|
+
* await ctx.lookupObject("@hongminhee@fosstodon.org");
|
178
|
+
* // returning a `Person` object.
|
179
|
+
*
|
180
|
+
* // A fediverse handle can omit the leading '@':
|
181
|
+
* await ctx.lookupObject("hongminhee@fosstodon.org");
|
182
|
+
* // returning a `Person` object.
|
183
|
+
*
|
184
|
+
* // A `acct:` URI can be used as well:
|
185
|
+
* await ctx.lookupObject("acct:hongminhee@fosstodon.org");
|
186
|
+
* // returning a `Person` object.
|
187
|
+
*
|
188
|
+
* // Look up an object by its URI:
|
189
|
+
* await ctx.lookupObject("https://todon.eu/@hongminhee/112060633798771581");
|
190
|
+
* // returning a `Note` object.
|
191
|
+
*
|
192
|
+
* // It can be a `URL` object as well:
|
193
|
+
* await ctx.lookupObject(
|
194
|
+
* new URL("https://todon.eu/@hongminhee/112060633798771581")
|
195
|
+
* );
|
196
|
+
* // returning a `Note` object.
|
197
|
+
* ```
|
198
|
+
*
|
199
|
+
* It's almost the same as the {@link lookupObject} function, but it uses
|
200
|
+
* the context's document loader and context loader by default.
|
201
|
+
*
|
202
|
+
* @param identifier The URI or fediverse handle to look up.
|
203
|
+
* @param options Lookup options.
|
204
|
+
* @returns The object, or `null` if not found.
|
205
|
+
* @since 0.15.0
|
206
|
+
*/
|
207
|
+
lookupObject(identifier: string | URL, options?: LookupObjectOptions): Promise<Object | null>;
|
169
208
|
/**
|
170
209
|
* Sends an activity to recipients' inboxes.
|
171
210
|
* @param sender The sender's handle or the sender's key pair(s).
|
@@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CACpB"}
|
@@ -59,6 +59,19 @@ export interface CreateFederationOptions {
|
|
59
59
|
* authentication.
|
60
60
|
*/
|
61
61
|
authenticatedDocumentLoaderFactory?: AuthenticatedDocumentLoaderFactory;
|
62
|
+
/**
|
63
|
+
* Whether to allow fetching private network addresses in the document loader.
|
64
|
+
*
|
65
|
+
* If turned on, {@link CreateFederationOptions.documentLoader},
|
66
|
+
* {@link CreateFederationOptions.contextLoader}, and
|
67
|
+
* {@link CreateFederationOptions.authenticatedDocumentLoaderFactory}
|
68
|
+
* cannot be configured.
|
69
|
+
*
|
70
|
+
* Mostly useful for testing purposes. *Do not use in production.*
|
71
|
+
*
|
72
|
+
* Turned off by default.
|
73
|
+
*/
|
74
|
+
allowPrivateAddress?: boolean;
|
62
75
|
/**
|
63
76
|
* A callback that handles errors during outbox processing. Note that this
|
64
77
|
* callback can be called multiple times for the same activity, because
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/federation/middleware.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,cAAc,EAIpB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/federation/middleware.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,cAAc,EAIpB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EACL,QAAQ,EAER,KAAK,OAAO,EACZ,KAAK,IAAI,EAET,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,K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