@fedify/fedify 0.10.0-dev.207 → 0.10.0-dev.209

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/CHANGES.md CHANGED
@@ -119,12 +119,16 @@ To be released.
119
119
  - Ephemeral actors now have the following properties: `summary`,
120
120
  `following`, `followers`, `outbox`, `manuallyApprovesFollowers`, and
121
121
  `url`.
122
+ - Improved the compatibility of the `fedify inbox` command with Misskey
123
+ and Mitra.
122
124
 
123
125
  - Added more log messages using the [LogTape] library. Currently the below
124
126
  logger categories are used:
125
127
 
126
128
  - `["fedify", "sig", "proof"]`
127
129
  - `["fedify", "sig", "key"]`
130
+ - `["fedify", "vocab", "lookup"]`
131
+ - `["fedify", "webfinger", "lookup"]`
128
132
 
129
133
  [#54]: https://github.com/dahlia/fedify/issues/54
130
134
  [#55]: https://github.com/dahlia/fedify/issues/55
package/FEDERATION.md ADDED
@@ -0,0 +1,62 @@
1
+ <!-- deno-fmt-ignore-file -->
2
+
3
+ Federation
4
+ ==========
5
+
6
+ Supported federation protocols and standards
7
+ --------------------------------------------
8
+
9
+ - [ActivityPub] (S2S)
10
+ - [WebFinger]
11
+ - [HTTP Signatures]
12
+ - [NodeInfo]
13
+
14
+ [ActivityPub]: https://www.w3.org/TR/activitypub/
15
+ [WebFinger]: https://datatracker.ietf.org/doc/html/rfc7033
16
+ [HTTP Signatures]: https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures
17
+ [NodeInfo]: https://nodeinfo.diaspora.software/
18
+
19
+
20
+ Supported FEPs
21
+ --------------
22
+
23
+ - [FEP-67ff][]: FEDERATION.md
24
+ - [FEP-8fcf][]: Followers collection synchronization across servers
25
+ - [FEP-f1d5][]: NodeInfo in Fediverse Software
26
+ - [FEP-8b32][]: Object Integrity Proofs
27
+ - [FEP-521a][]: Representing actor's public keys
28
+ - [FEP-5feb][]: Search indexing consent for actors
29
+ - [FEP-c7d3][]: Ownership
30
+
31
+ [FEP-67ff]: https://codeberg.org/fediverse/fep/src/branch/main/fep/67ff/fep-67ff.md
32
+ [FEP-8fcf]: https://codeberg.org/fediverse/fep/src/branch/main/fep/8fcf/fep-8fcf.md
33
+ [FEP-f1d5]: https://codeberg.org/fediverse/fep/src/branch/main/fep/f1d5/fep-f1d5.md
34
+ [FEP-8b32]: https://codeberg.org/fediverse/fep/src/branch/main/fep/8b32/fep-8b32.md
35
+ [FEP-521a]: https://codeberg.org/fediverse/fep/src/branch/main/fep/521a/fep-521a.md
36
+ [FEP-5feb]: https://codeberg.org/fediverse/fep/src/branch/main/fep/5feb/fep-5feb.md
37
+ [FEP-c7d3]: https://codeberg.org/silverpill/feps/src/branch/main/c7d3/fep-c7d3.md
38
+
39
+
40
+ ActivityPub
41
+ -----------
42
+
43
+ Since Fedify is a framework, what activity types it uses is up to
44
+ the application developers. However, Fedify provides a set of
45
+ activity types that are commonly used in the Fediverse. The following
46
+ lists the activity types that Fedify provides:
47
+
48
+ - [`Accept`](https://jsr.io/@fedify/fedify/doc/vocab/~/Accept)
49
+ - [`Add`](https://jsr.io/@fedify/fedify/doc/vocab/~/Add)
50
+ - [`Announce`](https://jsr.io/@fedify/fedify/doc/vocab/~/Announce)
51
+ - [`Block`](https://jsr.io/@fedify/fedify/doc/vocab/~/Block)
52
+ - [`Create`](https://jsr.io/@fedify/fedify/doc/vocab/~/Create)
53
+ - [`Delete`](https://jsr.io/@fedify/fedify/doc/vocab/~/Delete)
54
+ - [`Dislike`](https://jsr.io/@fedify/fedify/doc/vocab/~/Dislike)
55
+ - [`Flag`](https://jsr.io/@fedify/fedify/doc/vocab/~/Flag)
56
+ - [`Follow`](https://jsr.io/@fedify/fedify/doc/vocab/~/Follow)
57
+ - [`Ignore`](https://jsr.io/@fedify/fedify/doc/vocab/~/Ignore)
58
+ - [`Like`](https://jsr.io/@fedify/fedify/doc/vocab/~/Like)
59
+ - [`Reject`](https://jsr.io/@fedify/fedify/doc/vocab/~/Reject)
60
+ - [`Remove`](https://jsr.io/@fedify/fedify/doc/vocab/~/Remove)
61
+ - [`Undo`](https://jsr.io/@fedify/fedify/doc/vocab/~/Undo)
62
+ - [`Update`](https://jsr.io/@fedify/fedify/doc/vocab/~/Update)
@@ -1,6 +1,8 @@
1
+ import { getLogger } from "@logtape/logtape";
1
2
  import { fetchDocumentLoader, } from "../runtime/docloader.js";
2
3
  import { lookupWebFinger } from "../webfinger/lookup.js";
3
4
  import { Object } from "./vocab.js";
5
+ const logger = getLogger(["fedify", "vocab", "lookup"]);
4
6
  const handleRegexp = /^@?((?:[-A-Za-z0-9._~!$&'()*+,;=]|%[A-Fa-f0-9]{2})+)@([^@]+)$/;
5
7
  /**
6
8
  * Looks up an ActivityStreams object by its URI (including `acct:` URIs)
@@ -48,8 +50,8 @@ export async function lookupObject(identifier, options = {}) {
48
50
  const remoteDoc = await documentLoader(identifier.href);
49
51
  document = remoteDoc.document;
50
52
  }
51
- catch (_) {
52
- // Silently ignore errors.
53
+ catch (error) {
54
+ logger.debug("Failed to fetch remote document:\n{error}", { error });
53
55
  }
54
56
  }
55
57
  if (document == null) {
@@ -65,8 +67,8 @@ export async function lookupObject(identifier, options = {}) {
65
67
  document = remoteDoc.document;
66
68
  break;
67
69
  }
68
- catch (_) {
69
- // Silently ignore errors.
70
+ catch (error) {
71
+ logger.debug("Failed to fetch remote document:\n{error}", { error });
70
72
  continue;
71
73
  }
72
74
  }
@@ -79,9 +81,11 @@ export async function lookupObject(identifier, options = {}) {
79
81
  contextLoader: options.contextLoader,
80
82
  });
81
83
  }
82
- catch (e) {
83
- if (e instanceof TypeError)
84
+ catch (error) {
85
+ if (error instanceof TypeError) {
86
+ logger.debug("Failed to parse JSON-LD document:\n{error}", { error });
84
87
  return null;
85
- throw e;
88
+ }
89
+ throw error;
86
90
  }
87
91
  }
@@ -1,3 +1,5 @@
1
+ import { getLogger } from "@logtape/logtape";
2
+ const logger = getLogger(["fedify", "webfinger", "lookup"]);
1
3
  /**
2
4
  * Looks up a WebFinger resource.
3
5
  * @param resource The resource URL to look up.
@@ -22,6 +24,7 @@ export async function lookupWebFinger(resource) {
22
24
  let url = new URL(`https://${server}/.well-known/webfinger`);
23
25
  url.searchParams.set("resource", resource.href);
24
26
  while (true) {
27
+ logger.debug("Fetching WebFinger resource descriptor from {url}...", { url: url.href });
25
28
  const response = await fetch(url, {
26
29
  headers: { Accept: "application/jrd+json" },
27
30
  redirect: "manual",
@@ -31,14 +34,22 @@ export async function lookupWebFinger(resource) {
31
34
  url = new URL(response.headers.get("Location"));
32
35
  continue;
33
36
  }
34
- if (!response.ok)
37
+ if (!response.ok) {
38
+ logger.debug("Failed to fetch WebFinger resource descriptor: {status} {statusText}.", {
39
+ url: url.href,
40
+ status: response.status,
41
+ statusText: response.statusText,
42
+ });
35
43
  return null;
44
+ }
36
45
  try {
37
46
  return await response.json();
38
47
  }
39
48
  catch (e) {
40
- if (e instanceof SyntaxError)
49
+ if (e instanceof SyntaxError) {
50
+ logger.debug("Failed to parse WebFinger resource descriptor as JSON: {error}", { error: e });
41
51
  return null;
52
+ }
42
53
  throw e;
43
54
  }
44
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "0.10.0-dev.207+1573cf43",
3
+ "version": "0.10.0-dev.209+841d94c5",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -1 +1 @@
1
- {"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/vocab/lookup.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,GAAG,GAAG,EACxB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA8CxB"}
1
+ {"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/vocab/lookup.ts"],"names":[],"mappings":";AACA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIpC;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,GAAG,GAAG,EACxB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiDxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/webfinger/lookup.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,GAAG,GAAG,MAAM,GACrB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAiCpC"}
1
+ {"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/webfinger/lookup.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,GAAG,GAAG,MAAM,GACrB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAqDpC"}