@fedify/fedify 0.10.0-dev.199 → 0.10.0-dev.202
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGES.md +29 -1
- package/esm/codegen/schema.yaml +6 -1
- package/esm/runtime/key.js +1 -1
- package/esm/sig/http.js +10 -61
- package/esm/sig/key.js +85 -0
- package/esm/testing/fixtures/example.com/person2 +20 -3
- package/esm/testing/fixtures/server.example/users/alice +20 -0
- package/esm/testing/fixtures/wizard.casa/users/hongminhee +69 -0
- package/esm/vocab/dataintegrityproof.yaml +1 -1
- package/esm/vocab/object.yaml +1 -0
- package/esm/vocab/vocab.js +491 -228
- package/package.json +3 -2
- package/types/codegen/schema.d.ts.map +1 -1
- package/types/sig/http.d.ts +1 -1
- package/types/sig/http.d.ts.map +1 -1
- package/types/sig/key.d.ts +38 -0
- package/types/sig/key.d.ts.map +1 -1
- package/types/sig/proof.d.ts.map +1 -0
- package/types/sig/proof.test.d.ts.map +1 -0
- package/types/testing/keys.d.ts.map +1 -1
- package/types/vocab/vocab.d.ts.map +1 -1
- package/esm/testing/fixtures/example.com/key3 +0 -7
- package/esm/testing/fixtures/example.com/key4 +0 -7
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fedify/fedify",
|
3
|
-
"version": "0.10.0-dev.
|
3
|
+
"version": "0.10.0-dev.202+52d750a0",
|
4
4
|
"description": "An ActivityPub server framework",
|
5
5
|
"keywords": [
|
6
6
|
"ActivityPub",
|
@@ -100,7 +100,8 @@
|
|
100
100
|
"@types/node": "^20.9.0",
|
101
101
|
"picocolors": "^1.0.0",
|
102
102
|
"@cfworker/json-schema": "^1.12.8",
|
103
|
-
"fast-check": "^3.18.0"
|
103
|
+
"fast-check": "^3.18.0",
|
104
|
+
"json-canon": "^1.0.1"
|
104
105
|
},
|
105
106
|
"_generatedBy": "dnt@dev"
|
106
107
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/codegen/schema.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CAAC;IAEnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GACC,kBAAkB,GAAG,oBAAoB,GAAG;IAC5C;;;;OAIG;IACH,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAEJ;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,GAAG,GAAG,eAAe,GAAG,CAAC,GAAG,GAAG,eAAe,CAAC,EAAE,CAAC;AAExE,KAAK,GAAG,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AAClD,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AACtD,KAAK,cAAc,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,KAAK,CAAC,CAAC;AAExD;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;gBACS,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAI3C;AAgCD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CA4BrC"}
|
package/types/sig/http.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
/// <reference types="node" />
|
3
3
|
import * as dntShim from "../_dnt.shims.js";
|
4
|
-
import {
|
4
|
+
import type { DocumentLoader } from "../runtime/docloader.js";
|
5
5
|
import { CryptographicKey } from "../vocab/vocab.js";
|
6
6
|
/**
|
7
7
|
* Signs a request using the given private key.
|
package/types/sig/http.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/sig/http.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAI5C,OAAO,
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/sig/http.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAI5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,CAAC,SAAS,EAC7B,KAAK,EAAE,GAAG,GACT,OAAO,CAAC,OAAO,CAAC,CA0ClB;AAQD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;IAE/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAE3C;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;CACxC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,GACxD,oBAAyB,GAC1B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAkKlC"}
|
package/types/sig/key.d.ts
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
+
/// <reference types="node" />
|
1
2
|
import * as dntShim from "../_dnt.shims.js";
|
3
|
+
import { type DocumentLoader } from "../runtime/docloader.js";
|
4
|
+
import { CryptographicKey, type Multikey } from "../vocab/vocab.js";
|
2
5
|
/**
|
3
6
|
* Checks if the given key is valid and supported. No-op if the key is valid,
|
4
7
|
* otherwise throws an error.
|
@@ -32,4 +35,39 @@ export declare function exportJwk(key: dntShim.CryptoKey): Promise<dntShim.JsonW
|
|
32
35
|
* @throws {TypeError} If the key is invalid or unsupported.
|
33
36
|
*/
|
34
37
|
export declare function importJwk(jwk: dntShim.JsonWebKey, type: "public" | "private"): Promise<dntShim.CryptoKey>;
|
38
|
+
/**
|
39
|
+
* Options for {@link fetchKey}.
|
40
|
+
* @since 0.10.0
|
41
|
+
*/
|
42
|
+
export interface FetchKeyOptions {
|
43
|
+
/**
|
44
|
+
* The document loader for loading remote JSON-LD documents.
|
45
|
+
*/
|
46
|
+
documentLoader?: DocumentLoader;
|
47
|
+
/**
|
48
|
+
* The context loader for loading remote JSON-LD contexts.
|
49
|
+
*/
|
50
|
+
contextLoader?: DocumentLoader;
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* Fetches a {@link CryptographicKey} or {@link Multikey} from the given URL.
|
54
|
+
* If the given URL contains an {@link Actor} object, it tries to find
|
55
|
+
* the corresponding key in the `publicKey` or `assertionMethod` property.
|
56
|
+
* @typeParam T The type of the key to fetch. Either {@link CryptographicKey}
|
57
|
+
* or {@link Multikey}.
|
58
|
+
* @param keyId The URL of the key.
|
59
|
+
* @param cls The class of the key to fetch. Either {@link CryptographicKey}
|
60
|
+
* or {@link Multikey}.
|
61
|
+
* @param options Options for fetching the key. See {@link FetchKeyOptions}.
|
62
|
+
* @returns The fetched key or `null` if the key is not found.
|
63
|
+
* @since 0.10.0
|
64
|
+
*/
|
65
|
+
export declare function fetchKey<T extends CryptographicKey | Multikey>(keyId: URL | string, cls: (new (...args: any[]) => T) & {
|
66
|
+
fromJsonLd(jsonLd: unknown, options: {
|
67
|
+
documentLoader?: DocumentLoader;
|
68
|
+
contextLoader?: DocumentLoader;
|
69
|
+
}): Promise<T>;
|
70
|
+
}, { documentLoader, contextLoader }?: FetchKeyOptions): Promise<T & {
|
71
|
+
publicKey: dntShim.CryptoKey;
|
72
|
+
} | null>;
|
35
73
|
//# sourceMappingURL=key.d.ts.map
|
package/types/sig/key.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/sig/key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/sig/key.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,KAAK,QAAQ,EAAU,MAAM,mBAAmB,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,OAAO,CAAC,SAAS,EACtB,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,GAC1B,IAAI,CA2BN;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,CAAC,EAAE,mBAAmB,GAAG,SAAS,GAC1C,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CA2BhC;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAGnF;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,GAAG,EAAE,OAAO,CAAC,UAAU,EACvB,IAAI,EAAE,QAAQ,GAAG,SAAS,GACzB,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAuB5B;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,QAAQ,CAAC,CAAC,SAAS,gBAAgB,GAAG,QAAQ,EAClE,KAAK,EAAE,GAAG,GAAG,MAAM,EAEnB,GAAG,EAA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C3D,OAAO,CAAC,kBAAkB,CAAC,CA2C7B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAAC,CAAC,SAAS,MAAM,EAC/C,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,OAAO,CAAC,SAAS,EAC7B,KAAK,EAAE,GAAG,EACV,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,CAAC,CAAC,CAOZ;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;IAE/B;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CA4D1B;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;CAC9D;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAaxB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"proof.test.d.ts","sourceRoot":"","sources":["../../src/sig/proof.test.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/testing/keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,aAAa,kBA2BxB,CAAC;AAEH,eAAO,MAAM,cAAc,mBAyC1B,CAAC;AAEF,eAAO,MAAM,aAAa,kBAuBxB,CAAC;AAEH,eAAO,MAAM,cAAc,mBA6D1B,CAAC;AAEF,eAAO,MAAM,aAAa,kBA6BxB,CAAC;AAEH,eAAO,MAAM,iBAAiB,mBAe7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,kBAkB3B,CAAC"}
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/testing/keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,aAAa,kBA2BxB,CAAC;AAEH,eAAO,MAAM,cAAc,mBAyC1B,CAAC;AAEF,eAAO,MAAM,aAAa,kBAuBxB,CAAC;AAEH,eAAO,MAAM,cAAc,mBA6D1B,CAAC;AAEF,eAAO,MAAM,aAAa,kBA6BxB,CAAC;AAEH,eAAO,MAAM,YAAY,UAIvB,CAAC;AAEH,eAAO,MAAM,iBAAiB,mBAe7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,kBAkB3B,CAAC;AAEH,eAAO,MAAM,eAAe,UAI1B,CAAC"}
|