@atproto/did 0.1.2 → 0.1.4
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/CHANGELOG.md +12 -0
- package/dist/atproto.d.ts +2 -0
- package/dist/atproto.d.ts.map +1 -1
- package/dist/atproto.js +10 -6
- package/dist/atproto.js.map +1 -1
- package/dist/did.d.ts +1 -1
- package/dist/did.d.ts.map +1 -1
- package/dist/did.js +7 -7
- package/dist/did.js.map +1 -1
- package/dist/methods/plc.js +7 -7
- package/dist/methods/plc.js.map +1 -1
- package/dist/methods/web.d.ts +3 -1
- package/dist/methods/web.d.ts.map +1 -1
- package/dist/methods/web.js +25 -20
- package/dist/methods/web.js.map +1 -1
- package/jest.config.js +13 -0
- package/package.json +6 -3
- package/src/atproto.ts +6 -0
- package/src/methods/plc.ts +4 -4
- package/src/methods/web.ts +23 -17
- package/tests/methods/plc.test.ts +72 -0
- package/tests/methods/web.test.ts +109 -0
- package/tsconfig.build.tsbuildinfo +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atproto/did
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3454](https://github.com/bluesky-social/atproto/pull/3454) [`cc2a1222b`](https://github.com/bluesky-social/atproto/commit/cc2a1222bd2b8ddd70d70dad174c1c63246a2d87) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Fix encoding and decoding of did:web
|
|
8
|
+
|
|
9
|
+
## 0.1.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#2871](https://github.com/bluesky-social/atproto/pull/2871) [`9d40ccbb6`](https://github.com/bluesky-social/atproto/commit/9d40ccbb69103fae9aae7e3cec31e9b3116f3ba2) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add atprotoDidSchema to validate Atproto supported DID's using zod
|
|
14
|
+
|
|
3
15
|
## 0.1.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/atproto.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { Did } from './did.js';
|
|
2
3
|
export type AtprotoIdentityDidMethods = 'plc' | 'web';
|
|
3
4
|
export type AtprotoDid = Did<AtprotoIdentityDidMethods>;
|
|
5
|
+
export declare const atprotoDidSchema: z.ZodEffects<z.ZodString, `did:plc:${string}` | `did:web:${string}`, string>;
|
|
4
6
|
export declare function isAtprotoDid(input: unknown): input is AtprotoDid;
|
|
5
7
|
export declare function asAtprotoDid(input: unknown): AtprotoDid;
|
|
6
8
|
export declare function assertAtprotoDid(input: unknown): asserts input is AtprotoDid;
|
package/dist/atproto.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atproto.d.ts","sourceRoot":"","sources":["../src/atproto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"atproto.d.ts","sourceRoot":"","sources":["../src/atproto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAW9B,MAAM,MAAM,yBAAyB,GAAG,KAAK,GAAG,KAAK,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,yBAAyB,CAAC,CAAA;AAEvD,eAAO,MAAM,gBAAgB,8EAE6C,CAAA;AAE1E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAahE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAGvD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,CAa5E;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,CAmB7B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,CAOnE"}
|
package/dist/atproto.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.atprotoDidSchema = void 0;
|
|
4
|
+
exports.isAtprotoDid = isAtprotoDid;
|
|
5
|
+
exports.asAtprotoDid = asAtprotoDid;
|
|
6
|
+
exports.assertAtprotoDid = assertAtprotoDid;
|
|
7
|
+
exports.assertAtprotoDidWeb = assertAtprotoDidWeb;
|
|
8
|
+
exports.isAtprotoDidWeb = isAtprotoDidWeb;
|
|
9
|
+
const zod_1 = require("zod");
|
|
4
10
|
const did_error_js_1 = require("./did-error.js");
|
|
5
11
|
const methods_js_1 = require("./methods.js");
|
|
12
|
+
exports.atprotoDidSchema = zod_1.z
|
|
13
|
+
.string()
|
|
14
|
+
.refine(isAtprotoDid, `Atproto only allows "plc" and "web" DID methods`);
|
|
6
15
|
function isAtprotoDid(input) {
|
|
7
16
|
// Optimized equivalent of:
|
|
8
17
|
// return isDidPlc(input) || isAtprotoDidWeb(input)
|
|
@@ -19,12 +28,10 @@ function isAtprotoDid(input) {
|
|
|
19
28
|
return false;
|
|
20
29
|
}
|
|
21
30
|
}
|
|
22
|
-
exports.isAtprotoDid = isAtprotoDid;
|
|
23
31
|
function asAtprotoDid(input) {
|
|
24
32
|
assertAtprotoDid(input);
|
|
25
33
|
return input;
|
|
26
34
|
}
|
|
27
|
-
exports.asAtprotoDid = asAtprotoDid;
|
|
28
35
|
function assertAtprotoDid(input) {
|
|
29
36
|
if (typeof input !== 'string') {
|
|
30
37
|
throw new did_error_js_1.InvalidDidError(typeof input, `DID must be a string`);
|
|
@@ -39,7 +46,6 @@ function assertAtprotoDid(input) {
|
|
|
39
46
|
throw new did_error_js_1.InvalidDidError(input, `Atproto only allows "plc" and "web" DID methods`);
|
|
40
47
|
}
|
|
41
48
|
}
|
|
42
|
-
exports.assertAtprotoDid = assertAtprotoDid;
|
|
43
49
|
function assertAtprotoDidWeb(input) {
|
|
44
50
|
(0, methods_js_1.assertDidWeb)(input);
|
|
45
51
|
if (input.includes(':', methods_js_1.DID_WEB_PREFIX.length)) {
|
|
@@ -50,7 +56,6 @@ function assertAtprotoDidWeb(input) {
|
|
|
50
56
|
throw new did_error_js_1.InvalidDidError(input, `Atproto does not allow port numbers in Web DIDs, except for localhost`);
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
|
-
exports.assertAtprotoDidWeb = assertAtprotoDidWeb;
|
|
54
59
|
/**
|
|
55
60
|
* @see {@link https://atproto.com/specs/did#blessed-did-methods}
|
|
56
61
|
*/
|
|
@@ -63,5 +68,4 @@ function isAtprotoDidWeb(input) {
|
|
|
63
68
|
return false;
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
|
-
exports.isAtprotoDidWeb = isAtprotoDidWeb;
|
|
67
71
|
//# sourceMappingURL=atproto.js.map
|
package/dist/atproto.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atproto.js","sourceRoot":"","sources":["../src/atproto.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"atproto.js","sourceRoot":"","sources":["../src/atproto.ts"],"names":[],"mappings":";;;AAqBA,oCAaC;AAED,oCAGC;AAED,4CAaC;AAED,kDAqBC;AAKD,0CAOC;AAzFD,6BAAuB;AAEvB,iDAAgD;AAEhD,6CAMqB;AAOR,QAAA,gBAAgB,GAAG,OAAC;KAC9B,MAAM,EAAE;KACR,MAAM,CAAC,YAAY,EAAE,iDAAiD,CAAC,CAAA;AAE1E,SAAgB,YAAY,CAAC,KAAc;IACzC,2BAA2B;IAC3B,mDAAmD;IAEnD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CA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C,MAAM,CAAC;QAC5C,CAAC,KAAK,CAAC,UAAU,CAAC,sBAAsB,CAAC,EACzC,CAAC;QACD,MAAM,IAAI,8BAAe,CACvB,KAAK,EACL,uEAAuE,CACxE,CAAA;IACH,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,KAAc;IAC5C,IAAI,CAAC;QACH,mBAAmB,CAAC,KAAK,CAAC,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
|
package/dist/did.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare function assertDidMethod(input: string, start?: number, end?: num
|
|
|
42
42
|
/**
|
|
43
43
|
* This method assumes the input is a valid Did
|
|
44
44
|
*/
|
|
45
|
-
export declare function extractDidMethod<D extends Did>(did: D): D extends
|
|
45
|
+
export declare function extractDidMethod<D extends Did>(did: D): D extends Did<infer M> ? M : string;
|
|
46
46
|
/**
|
|
47
47
|
* DID Method-specific identifier check function.
|
|
48
48
|
*
|
package/dist/did.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"did.d.ts","sourceRoot":"","sources":["../src/did.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,QAAA,MAAM,UAAU,SAAS,CAAA;AAEzB,OAAO,EAAE,UAAU,EAAE,CAAA;AAErB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,OAAO,WAAW,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAA;AAE9E;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,MAAM,SAAS,CAAC,GACzC,MAAM,GACN,mBAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAE9B,KAAK,gBAAgB,GAAG,SAAS,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,MAAM,CACrD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,KAAK,SAAI,EACT,GAAG,SAAe,GACjB,IAAI,CAuEN;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,GAAG,CAqB9D;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,GAAG,CAYlD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,CAGzC;AAED,eAAO,MAAM,SAAS,8DAalB,CAAA"}
|
package/dist/did.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.didSchema = exports.
|
|
3
|
+
exports.didSchema = exports.DID_PREFIX = void 0;
|
|
4
|
+
exports.assertDidMethod = assertDidMethod;
|
|
5
|
+
exports.extractDidMethod = extractDidMethod;
|
|
6
|
+
exports.assertDidMsid = assertDidMsid;
|
|
7
|
+
exports.assertDid = assertDid;
|
|
8
|
+
exports.isDid = isDid;
|
|
9
|
+
exports.asDid = asDid;
|
|
4
10
|
const zod_1 = require("zod");
|
|
5
11
|
const did_error_js_1 = require("./did-error.js");
|
|
6
12
|
const DID_PREFIX = 'did:';
|
|
@@ -32,7 +38,6 @@ function assertDidMethod(input, start = 0, end = input.length) {
|
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
|
-
exports.assertDidMethod = assertDidMethod;
|
|
36
41
|
/**
|
|
37
42
|
* This method assumes the input is a valid Did
|
|
38
43
|
*/
|
|
@@ -41,7 +46,6 @@ function extractDidMethod(did) {
|
|
|
41
46
|
const method = did.slice(DID_PREFIX_LENGTH, msidSep);
|
|
42
47
|
return method;
|
|
43
48
|
}
|
|
44
|
-
exports.extractDidMethod = extractDidMethod;
|
|
45
49
|
/**
|
|
46
50
|
* DID Method-specific identifier check function.
|
|
47
51
|
*
|
|
@@ -97,7 +101,6 @@ function assertDidMsid(input, start = 0, end = input.length) {
|
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
|
-
exports.assertDidMsid = assertDidMsid;
|
|
101
104
|
function assertDid(input) {
|
|
102
105
|
if (typeof input !== 'string') {
|
|
103
106
|
throw new did_error_js_1.InvalidDidError(typeof input, `DID must be a string`);
|
|
@@ -116,7 +119,6 @@ function assertDid(input) {
|
|
|
116
119
|
assertDidMethod(input, DID_PREFIX_LENGTH, idSep);
|
|
117
120
|
assertDidMsid(input, idSep + 1, length);
|
|
118
121
|
}
|
|
119
|
-
exports.assertDid = assertDid;
|
|
120
122
|
function isDid(input) {
|
|
121
123
|
try {
|
|
122
124
|
assertDid(input);
|
|
@@ -130,12 +132,10 @@ function isDid(input) {
|
|
|
130
132
|
throw err;
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
|
-
exports.isDid = isDid;
|
|
134
135
|
function asDid(input) {
|
|
135
136
|
assertDid(input);
|
|
136
137
|
return input;
|
|
137
138
|
}
|
|
138
|
-
exports.asDid = asDid;
|
|
139
139
|
exports.didSchema = zod_1.z
|
|
140
140
|
.string()
|
|
141
141
|
.superRefine((value, ctx) => {
|
package/dist/did.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"did.js","sourceRoot":"","sources":["../src/did.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"did.js","sourceRoot":"","sources":["../src/did.ts"],"names":[],"mappings":";;;AAqFA,0CA8BC;AAKD,4CAIC;AAQD,sCA2EC;AAED,8BAqBC;AAED,sBAYC;AAED,sBAGC;AAzPD,6BAAuB;AACvB,iDAA0D;AAE1D,MAAM,UAAU,GAAG,MAAM,CAAA;AAEhB,gCAAU;AADnB,MAAM,iBAAiB,GAAG,UAAU,CAAC,MAAM,CAAA;AA2E3C;;;;;GAKG;AACH,SAAgB,eAAe,CAC7B,KAA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"}
|
package/dist/methods/plc.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DID_PLC_PREFIX = void 0;
|
|
4
|
+
exports.isDidPlc = isDidPlc;
|
|
5
|
+
exports.asDidPlc = asDidPlc;
|
|
6
|
+
exports.assertDidPlc = assertDidPlc;
|
|
4
7
|
const did_error_js_1 = require("../did-error.js");
|
|
5
8
|
const DID_PLC_PREFIX = `did:plc:`;
|
|
6
9
|
exports.DID_PLC_PREFIX = DID_PLC_PREFIX;
|
|
@@ -20,22 +23,20 @@ function isDidPlc(input) {
|
|
|
20
23
|
}
|
|
21
24
|
return true;
|
|
22
25
|
}
|
|
23
|
-
exports.isDidPlc = isDidPlc;
|
|
24
26
|
function asDidPlc(input) {
|
|
25
27
|
assertDidPlc(input);
|
|
26
28
|
return input;
|
|
27
29
|
}
|
|
28
|
-
exports.asDidPlc = asDidPlc;
|
|
29
30
|
function assertDidPlc(input) {
|
|
30
31
|
if (typeof input !== 'string') {
|
|
31
32
|
throw new did_error_js_1.InvalidDidError(typeof input, `DID must be a string`);
|
|
32
33
|
}
|
|
33
|
-
if (input.length !== DID_PLC_LENGTH) {
|
|
34
|
-
throw new did_error_js_1.InvalidDidError(input, `did:plc must be ${DID_PLC_LENGTH} characters long`);
|
|
35
|
-
}
|
|
36
34
|
if (!input.startsWith(DID_PLC_PREFIX)) {
|
|
37
35
|
throw new did_error_js_1.InvalidDidError(input, `Invalid did:plc prefix`);
|
|
38
36
|
}
|
|
37
|
+
if (input.length !== DID_PLC_LENGTH) {
|
|
38
|
+
throw new did_error_js_1.InvalidDidError(input, `did:plc must be ${DID_PLC_LENGTH} characters long`);
|
|
39
|
+
}
|
|
39
40
|
// The following check is not necessary, as the check below is more strict:
|
|
40
41
|
// assertDidMsid(input, DID_PLC_PREFIX.length)
|
|
41
42
|
for (let i = DID_PLC_PREFIX_LENGTH; i < DID_PLC_LENGTH; i++) {
|
|
@@ -44,6 +45,5 @@ function assertDidPlc(input) {
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
exports.assertDidPlc = assertDidPlc;
|
|
48
48
|
const isBase32Char = (c) => (c >= 0x61 && c <= 0x7a) || (c >= 0x32 && c <= 0x37); // [a-z2-7]
|
|
49
49
|
//# sourceMappingURL=plc.js.map
|
package/dist/methods/plc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plc.js","sourceRoot":"","sources":["../../src/methods/plc.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"plc.js","sourceRoot":"","sources":["../../src/methods/plc.ts"],"names":[],"mappings":";;;AASA,4BASC;AAED,4BAGC;AAED,oCAyBC;AAlDD,kDAAiD;AAGjD,MAAM,cAAc,GAAG,UAAU,CAAA;AAIxB,wCAAc;AAHvB,MAAM,qBAAqB,GAAG,cAAc,CAAC,MAAM,CAAA;AACnD,MAAM,cAAc,GAAG,EAAE,CAAA;AAIzB,SAAgB,QAAQ,CAAC,KAAc;IACrC,8DAA8D;IAC9D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc;QAAE,OAAO,KAAK,CAAA;IACjD,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;QAAE,OAAO,KAAK,CAAA;IACnD,KAAK,IAAI,CAAC,GAAG,qBAAqB,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5D,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAA;IACtD,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAgB,QAAQ,CAAC,KAAc;IACrC,YAAY,CAAC,KAAK,CAAC,CAAA;IACnB,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAgB,YAAY,CAAC,KAAc;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,8BAAe,CAAC,OAAO,KAAK,EAAE,sBAAsB,CAAC,CAAA;IACjE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,8BAAe,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAA;IAC5D,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc,EAAE,CAAC;QACpC,MAAM,IAAI,8BAAe,CACvB,KAAK,EACL,mBAAmB,cAAc,kBAAkB,CACpD,CAAA;IACH,CAAC;IAED,2EAA2E;IAE3E,8CAA8C;IAE9C,KAAK,IAAI,CAAC,GAAG,qBAAqB,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5D,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,8BAAe,CAAC,KAAK,EAAE,iCAAiC,CAAC,EAAE,CAAC,CAAA;QACxE,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,CAAS,EAAW,EAAE,CAC1C,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,CAAA,CAAC,WAAW"}
|
package/dist/methods/web.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export declare const DID_WEB_PREFIX = "did:web:";
|
|
|
6
6
|
export declare function isDidWeb(input: unknown): input is Did<'web'>;
|
|
7
7
|
export declare function asDidWeb(input: unknown): Did<'web'>;
|
|
8
8
|
export declare function assertDidWeb(input: unknown): asserts input is Did<'web'>;
|
|
9
|
-
export declare function didWebToUrl(did:
|
|
9
|
+
export declare function didWebToUrl(did: Did<'web'>): URL & {
|
|
10
|
+
protocol: "http:" | "https:";
|
|
11
|
+
};
|
|
10
12
|
export declare function urlToDidWeb(url: URL): Did<'web'>;
|
|
11
13
|
//# sourceMappingURL=web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/methods/web.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAiB,MAAM,WAAW,CAAA;AAE9C,eAAO,MAAM,cAAc,aAAkC,CAAA;AAE7D;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/methods/web.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAiB,MAAM,WAAW,CAAA;AAE9C,eAAO,MAAM,cAAc,aAAkC,CAAA;AAE7D;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,CAY5D;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAGnD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,CAcxE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC;cAahB,OAAO,GAAG,QAAQ;EAQ5C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAKhD"}
|
package/dist/methods/web.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DID_WEB_PREFIX = void 0;
|
|
4
|
+
exports.isDidWeb = isDidWeb;
|
|
5
|
+
exports.asDidWeb = asDidWeb;
|
|
6
|
+
exports.assertDidWeb = assertDidWeb;
|
|
7
|
+
exports.didWebToUrl = didWebToUrl;
|
|
8
|
+
exports.urlToDidWeb = urlToDidWeb;
|
|
4
9
|
const did_error_js_1 = require("../did-error.js");
|
|
5
10
|
const did_js_1 = require("../did.js");
|
|
6
11
|
exports.DID_WEB_PREFIX = `did:web:`;
|
|
@@ -11,40 +16,43 @@ function isDidWeb(input) {
|
|
|
11
16
|
// Optimization: make cheap checks first
|
|
12
17
|
if (typeof input !== 'string')
|
|
13
18
|
return false;
|
|
19
|
+
if (!input.startsWith(exports.DID_WEB_PREFIX))
|
|
20
|
+
return false;
|
|
21
|
+
if (input.charAt(exports.DID_WEB_PREFIX.length) === ':')
|
|
22
|
+
return false;
|
|
14
23
|
try {
|
|
15
|
-
|
|
24
|
+
didWebToUrl(input);
|
|
16
25
|
return true;
|
|
17
26
|
}
|
|
18
27
|
catch {
|
|
19
28
|
return false;
|
|
20
29
|
}
|
|
21
30
|
}
|
|
22
|
-
exports.isDidWeb = isDidWeb;
|
|
23
31
|
function asDidWeb(input) {
|
|
24
32
|
assertDidWeb(input);
|
|
25
33
|
return input;
|
|
26
34
|
}
|
|
27
|
-
exports.asDidWeb = asDidWeb;
|
|
28
35
|
function assertDidWeb(input) {
|
|
29
36
|
if (typeof input !== 'string') {
|
|
30
37
|
throw new did_error_js_1.InvalidDidError(typeof input, `DID must be a string`);
|
|
31
38
|
}
|
|
39
|
+
if (!input.startsWith(exports.DID_WEB_PREFIX)) {
|
|
40
|
+
throw new did_error_js_1.InvalidDidError(input, `Invalid did:web prefix`);
|
|
41
|
+
}
|
|
42
|
+
if (input.charAt(exports.DID_WEB_PREFIX.length) === ':') {
|
|
43
|
+
throw new did_error_js_1.InvalidDidError(input, 'did:web MSID must not start with a colon');
|
|
44
|
+
}
|
|
32
45
|
void didWebToUrl(input);
|
|
33
46
|
}
|
|
34
|
-
exports.assertDidWeb = assertDidWeb;
|
|
35
47
|
function didWebToUrl(did) {
|
|
36
|
-
if (!did.startsWith(exports.DID_WEB_PREFIX)) {
|
|
37
|
-
throw new did_error_js_1.InvalidDidError(did, `did:web must start with ${exports.DID_WEB_PREFIX}`);
|
|
38
|
-
}
|
|
39
|
-
if (did.charAt(exports.DID_WEB_PREFIX.length) === ':') {
|
|
40
|
-
throw new did_error_js_1.InvalidDidError(did, 'did:web MSID must not start with a colon');
|
|
41
|
-
}
|
|
42
48
|
// Make sure every char is valid (per DID spec)
|
|
43
49
|
(0, did_js_1.assertDidMsid)(did, exports.DID_WEB_PREFIX.length);
|
|
50
|
+
const hostIdx = exports.DID_WEB_PREFIX.length;
|
|
51
|
+
const pathIdx = did.indexOf(':', hostIdx);
|
|
52
|
+
const host = pathIdx === -1 ? did.slice(hostIdx) : did.slice(hostIdx, pathIdx);
|
|
53
|
+
const path = pathIdx === -1 ? '' : did.slice(pathIdx);
|
|
44
54
|
try {
|
|
45
|
-
const
|
|
46
|
-
const parts = msid.split(':').map(decodeURIComponent);
|
|
47
|
-
const url = new URL(`https://${parts.join('/')}`);
|
|
55
|
+
const url = new URL(`https://${host.replaceAll('%3A', ':')}${path.replaceAll(':', '/')}`);
|
|
48
56
|
if (url.hostname === 'localhost') {
|
|
49
57
|
url.protocol = 'http:';
|
|
50
58
|
}
|
|
@@ -54,12 +62,9 @@ function didWebToUrl(did) {
|
|
|
54
62
|
throw new did_error_js_1.InvalidDidError(did, 'Invalid Web DID', cause);
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
|
-
exports.didWebToUrl = didWebToUrl;
|
|
58
65
|
function urlToDidWeb(url) {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return `did:web:${encodeURIComponent(url.host)}${path ? `:${path}` : ''}`;
|
|
66
|
+
const port = url.port ? `%3A${url.port}` : '';
|
|
67
|
+
const path = url.pathname === '/' ? '' : url.pathname.replaceAll('/', ':');
|
|
68
|
+
return `did:web:${url.hostname}${port}${path}`;
|
|
63
69
|
}
|
|
64
|
-
exports.urlToDidWeb = urlToDidWeb;
|
|
65
70
|
//# sourceMappingURL=web.js.map
|
package/dist/methods/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/methods/web.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/methods/web.ts"],"names":[],"mappings":";;;AAQA,4BAYC;AAED,4BAGC;AAED,oCAcC;AAED,kCAqBC;AAED,kCAKC;AAvED,kDAAiD;AACjD,sCAA8C;AAEjC,QAAA,cAAc,GAAG,UAA+B,CAAA;AAE7D;;GAEG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,wCAAwC;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,sBAAc,CAAC;QAAE,OAAO,KAAK,CAAA;IACnD,IAAI,KAAK,CAAC,MAAM,CAAC,sBAAc,CAAC,MAAM,CAAC,KAAK,GAAG;QAAE,OAAO,KAAK,CAAA;IAE7D,IAAI,CAAC;QACH,WAAW,CAAC,KAAmB,CAAC,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,SAAgB,QAAQ,CAAC,KAAc;IACrC,YAAY,CAAC,KAAK,CAAC,CAAA;IACnB,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAgB,YAAY,CAAC,KAAc;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,8BAAe,CAAC,OAAO,KAAK,EAAE,sBAAsB,CAAC,CAAA;IACjE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,sBA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f,MAAM,IAAI,8BAAe,CAAC,GAAG,EAAE,iBAAiB,EAAE,KAAK,CAAC,CAAA;IAC1D,CAAC;AACH,CAAC;AAED,SAAgB,WAAW,CAAC,GAAQ;IAClC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC7C,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAE1E,OAAO,WAAW,GAAG,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,EAAE,CAAA;AAChD,CAAC"}
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @type {import('jest').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
displayName: 'PDS',
|
|
4
|
+
transform: { '^.+\\.(t|j)s$': '@swc/jest' },
|
|
5
|
+
// Jest requires all ESM dependencies to be transpiled (even if they are
|
|
6
|
+
// dynamically import()ed).
|
|
7
|
+
transformIgnorePatterns: [
|
|
8
|
+
`/node_modules/.pnpm/(?!(get-port|lande|toygrad)@)`,
|
|
9
|
+
],
|
|
10
|
+
testTimeout: 60000,
|
|
11
|
+
setupFiles: ['<rootDir>/../../jest.setup.ts'],
|
|
12
|
+
moduleNameMapper: { '^(\\.\\.?\\/.+)\\.js$': ['$1.ts', '$1.js'] },
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/did",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "DID resolution and verification library",
|
|
6
6
|
"keywords": [
|
|
@@ -28,9 +28,12 @@
|
|
|
28
28
|
"zod": "^3.23.8"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"
|
|
31
|
+
"@swc/jest": "^0.2.24",
|
|
32
|
+
"jest": "^28.1.2",
|
|
33
|
+
"typescript": "^5.6.3"
|
|
32
34
|
},
|
|
33
35
|
"scripts": {
|
|
34
|
-
"build": "tsc --build tsconfig.build.json"
|
|
36
|
+
"build": "tsc --build tsconfig.build.json",
|
|
37
|
+
"test": "jest"
|
|
35
38
|
}
|
|
36
39
|
}
|
package/src/atproto.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
1
3
|
import { InvalidDidError } from './did-error.js'
|
|
2
4
|
import { Did } from './did.js'
|
|
3
5
|
import {
|
|
@@ -13,6 +15,10 @@ import {
|
|
|
13
15
|
export type AtprotoIdentityDidMethods = 'plc' | 'web'
|
|
14
16
|
export type AtprotoDid = Did<AtprotoIdentityDidMethods>
|
|
15
17
|
|
|
18
|
+
export const atprotoDidSchema = z
|
|
19
|
+
.string()
|
|
20
|
+
.refine(isAtprotoDid, `Atproto only allows "plc" and "web" DID methods`)
|
|
21
|
+
|
|
16
22
|
export function isAtprotoDid(input: unknown): input is AtprotoDid {
|
|
17
23
|
// Optimized equivalent of:
|
|
18
24
|
// return isDidPlc(input) || isAtprotoDidWeb(input)
|
package/src/methods/plc.ts
CHANGED
|
@@ -28,6 +28,10 @@ export function assertDidPlc(input: unknown): asserts input is Did<'plc'> {
|
|
|
28
28
|
throw new InvalidDidError(typeof input, `DID must be a string`)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
if (!input.startsWith(DID_PLC_PREFIX)) {
|
|
32
|
+
throw new InvalidDidError(input, `Invalid did:plc prefix`)
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
if (input.length !== DID_PLC_LENGTH) {
|
|
32
36
|
throw new InvalidDidError(
|
|
33
37
|
input,
|
|
@@ -35,10 +39,6 @@ export function assertDidPlc(input: unknown): asserts input is Did<'plc'> {
|
|
|
35
39
|
)
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
if (!input.startsWith(DID_PLC_PREFIX)) {
|
|
39
|
-
throw new InvalidDidError(input, `Invalid did:plc prefix`)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
42
|
// The following check is not necessary, as the check below is more strict:
|
|
43
43
|
|
|
44
44
|
// assertDidMsid(input, DID_PLC_PREFIX.length)
|
package/src/methods/web.ts
CHANGED
|
@@ -9,9 +9,11 @@ export const DID_WEB_PREFIX = `did:web:` satisfies Did<'web'>
|
|
|
9
9
|
export function isDidWeb(input: unknown): input is Did<'web'> {
|
|
10
10
|
// Optimization: make cheap checks first
|
|
11
11
|
if (typeof input !== 'string') return false
|
|
12
|
+
if (!input.startsWith(DID_WEB_PREFIX)) return false
|
|
13
|
+
if (input.charAt(DID_WEB_PREFIX.length) === ':') return false
|
|
12
14
|
|
|
13
15
|
try {
|
|
14
|
-
|
|
16
|
+
didWebToUrl(input as Did<'web'>)
|
|
15
17
|
return true
|
|
16
18
|
} catch {
|
|
17
19
|
return false
|
|
@@ -28,25 +30,31 @@ export function assertDidWeb(input: unknown): asserts input is Did<'web'> {
|
|
|
28
30
|
throw new InvalidDidError(typeof input, `DID must be a string`)
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export function didWebToUrl(did: string): URL {
|
|
35
|
-
if (!did.startsWith(DID_WEB_PREFIX)) {
|
|
36
|
-
throw new InvalidDidError(did, `did:web must start with ${DID_WEB_PREFIX}`)
|
|
33
|
+
if (!input.startsWith(DID_WEB_PREFIX)) {
|
|
34
|
+
throw new InvalidDidError(input, `Invalid did:web prefix`)
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
if (
|
|
40
|
-
throw new InvalidDidError(
|
|
37
|
+
if (input.charAt(DID_WEB_PREFIX.length) === ':') {
|
|
38
|
+
throw new InvalidDidError(input, 'did:web MSID must not start with a colon')
|
|
41
39
|
}
|
|
42
40
|
|
|
41
|
+
void didWebToUrl(input as Did<'web'>)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function didWebToUrl(did: Did<'web'>) {
|
|
43
45
|
// Make sure every char is valid (per DID spec)
|
|
44
46
|
assertDidMsid(did, DID_WEB_PREFIX.length)
|
|
45
47
|
|
|
48
|
+
const hostIdx = DID_WEB_PREFIX.length
|
|
49
|
+
const pathIdx = did.indexOf(':', hostIdx)
|
|
50
|
+
|
|
51
|
+
const host = pathIdx === -1 ? did.slice(hostIdx) : did.slice(hostIdx, pathIdx)
|
|
52
|
+
const path = pathIdx === -1 ? '' : did.slice(pathIdx)
|
|
53
|
+
|
|
46
54
|
try {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
const url = new URL(
|
|
56
|
+
`https://${host.replaceAll('%3A', ':')}${path.replaceAll(':', '/')}`,
|
|
57
|
+
) as URL & { protocol: 'http:' | 'https:' }
|
|
50
58
|
if (url.hostname === 'localhost') {
|
|
51
59
|
url.protocol = 'http:'
|
|
52
60
|
}
|
|
@@ -57,10 +65,8 @@ export function didWebToUrl(did: string): URL {
|
|
|
57
65
|
}
|
|
58
66
|
|
|
59
67
|
export function urlToDidWeb(url: URL): Did<'web'> {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
? ''
|
|
63
|
-
: url.pathname.slice(1).split('/').map(encodeURIComponent).join(':')
|
|
68
|
+
const port = url.port ? `%3A${url.port}` : ''
|
|
69
|
+
const path = url.pathname === '/' ? '' : url.pathname.replaceAll('/', ':')
|
|
64
70
|
|
|
65
|
-
return `did:web:${
|
|
71
|
+
return `did:web:${url.hostname}${port}${path}`
|
|
66
72
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { InvalidDidError } from '../../src/did-error.js'
|
|
2
|
+
import { Did } from '../../src/did.js'
|
|
3
|
+
import { asDidPlc, assertDidPlc, isDidPlc } from '../../src/methods/plc.js'
|
|
4
|
+
|
|
5
|
+
const VALID: Did<'plc'>[] = [
|
|
6
|
+
'did:plc:l3rouwludahu3ui3bt66mfvj',
|
|
7
|
+
'did:plc:aaaaaaaaaaaaaaaaaaaaaaaa',
|
|
8
|
+
'did:plc:zzzzzzzzzzzzzzzzzzzzzzzz',
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
const INVALID: [value: unknown, message: string][] = [
|
|
12
|
+
['did:plc:l3rouwludahu3ui3bt66mfv0', 'Invalid character at position 31'],
|
|
13
|
+
['did:plc:l3rouwludahu3ui3bt66mfv1', 'Invalid character at position 31'],
|
|
14
|
+
['did:plc:l3rouwludahu3ui3bt66mfv9', 'Invalid character at position 31'],
|
|
15
|
+
['did:plc:l3rouwludahu3ui3bt66mfv', 'did:plc must be 32 characters long'],
|
|
16
|
+
['did:plc:l3rouwludahu3ui3bt66mfvja', 'did:plc must be 32 characters long'],
|
|
17
|
+
['did:plc:example.com:', 'did:plc must be 32 characters long'],
|
|
18
|
+
['did:plc:exam%3Aple.com%3A8080', 'did:plc must be 32 characters long'],
|
|
19
|
+
[3, 'DID must be a string'],
|
|
20
|
+
[{ toString: () => 'did:plc:foo.com' }, 'DID must be a string'],
|
|
21
|
+
[[''], 'DID must be a string'],
|
|
22
|
+
['random-string', 'Invalid did:plc prefix'],
|
|
23
|
+
['did plc', 'Invalid did:plc prefix'],
|
|
24
|
+
['lorem ipsum dolor sit', 'Invalid did:plc prefix'],
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
describe('isDidPlc', () => {
|
|
28
|
+
it('returns true for various valid dids', () => {
|
|
29
|
+
for (const did of VALID) {
|
|
30
|
+
expect(isDidPlc(did)).toBe(true)
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it('returns false for invalid dids', () => {
|
|
35
|
+
for (const [did] of INVALID) {
|
|
36
|
+
expect(isDidPlc(did)).toBe(false)
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
describe('assertDidPlc', () => {
|
|
42
|
+
it('does not throw on valid dids', () => {
|
|
43
|
+
for (const did of VALID) {
|
|
44
|
+
expect(() => assertDidPlc(did)).not.toThrow()
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('throws if called with non string argument', () => {
|
|
49
|
+
for (const [val, message] of INVALID) {
|
|
50
|
+
expect(() => assertDidPlc(val)).toThrowError(
|
|
51
|
+
new InvalidDidError(
|
|
52
|
+
typeof val === 'string' ? val : typeof val,
|
|
53
|
+
message,
|
|
54
|
+
),
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
describe('asDidPlc', () => {
|
|
61
|
+
it('returns the input for valid dids', () => {
|
|
62
|
+
for (const did of VALID) {
|
|
63
|
+
expect(asDidPlc(did)).toBe(did)
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it('throws if called with invalid dids', () => {
|
|
68
|
+
for (const [val] of INVALID) {
|
|
69
|
+
expect(() => asDidPlc(val)).toThrowError(InvalidDidError)
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
})
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { InvalidDidError } from '../../src/did-error.js'
|
|
2
|
+
import { Did } from '../../src/did.js'
|
|
3
|
+
import {
|
|
4
|
+
asDidWeb,
|
|
5
|
+
assertDidWeb,
|
|
6
|
+
didWebToUrl,
|
|
7
|
+
isDidWeb,
|
|
8
|
+
urlToDidWeb,
|
|
9
|
+
} from '../../src/methods/web.js'
|
|
10
|
+
|
|
11
|
+
const VALID: [Did<'web'>, string][] = [
|
|
12
|
+
['did:web:example.com', 'https://example.com/'],
|
|
13
|
+
['did:web:sub.example.com', 'https://sub.example.com/'],
|
|
14
|
+
['did:web:example.com%3A8080', 'https://example.com:8080/'],
|
|
15
|
+
[
|
|
16
|
+
'did:web:example.com:path:to:resource',
|
|
17
|
+
'https://example.com/path/to/resource',
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
'did:web:example.com%3A8080:path:to:resource',
|
|
21
|
+
'https://example.com:8080/path/to/resource',
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
'did:web:xn--b48h.com%3A8080:path:to:resource',
|
|
25
|
+
'https://🙃.com:8080/path/to/resource',
|
|
26
|
+
],
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
const INVALID: [value: unknown, message: string][] = [
|
|
30
|
+
['did:web:', 'DID method-specific id must not be empty'],
|
|
31
|
+
['did:web:foo@example.com', 'Disallowed character in DID at position 11'],
|
|
32
|
+
['did:web::example.com', 'did:web MSID must not start with a colon'],
|
|
33
|
+
['did:web:example.com:', 'DID cannot end with ":"'],
|
|
34
|
+
['did:web:exam%3Aple.com%3A8080', 'Invalid Web DID'],
|
|
35
|
+
[3, 'DID must be a string'],
|
|
36
|
+
[{ toString: () => 'did:web:foo.com' }, 'DID must be a string'],
|
|
37
|
+
[[''], 'DID must be a string'],
|
|
38
|
+
['random-string', 'Invalid did:web prefix'],
|
|
39
|
+
['did web', 'Invalid did:web prefix'],
|
|
40
|
+
['lorem ipsum dolor sit', 'Invalid did:web prefix'],
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
describe('isDidWeb', () => {
|
|
44
|
+
it('returns true for various valid dids', () => {
|
|
45
|
+
for (const [did] of VALID) {
|
|
46
|
+
expect(isDidWeb(did)).toBe(true)
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('returns false for invalid dids', () => {
|
|
51
|
+
for (const did of INVALID) {
|
|
52
|
+
expect(isDidWeb(did)).toBe(false)
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
describe('assertDidWeb', () => {
|
|
58
|
+
it('does not throw on valid dids', () => {
|
|
59
|
+
for (const [did] of VALID) {
|
|
60
|
+
expect(() => assertDidWeb(did)).not.toThrow()
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it('throws if called with non string argument', () => {
|
|
65
|
+
for (const [val, message] of INVALID) {
|
|
66
|
+
expect(() => assertDidWeb(val)).toThrowError(
|
|
67
|
+
new InvalidDidError(
|
|
68
|
+
typeof val === 'string' ? val : typeof val,
|
|
69
|
+
message,
|
|
70
|
+
),
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
describe('didWebToUrl', () => {
|
|
77
|
+
it('converts valid did:web to URL', () => {
|
|
78
|
+
for (const [did, url] of VALID) {
|
|
79
|
+
expect(didWebToUrl(did)).toStrictEqual(new URL(url))
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
describe('urlToDidWeb', () => {
|
|
85
|
+
it('converts URL to valid did:web', () => {
|
|
86
|
+
for (const [did, url] of VALID) {
|
|
87
|
+
expect(urlToDidWeb(new URL(url))).toBe(did)
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
describe('asDidWeb', () => {
|
|
93
|
+
it('returns the input for valid dids', () => {
|
|
94
|
+
for (const [did] of VALID) {
|
|
95
|
+
expect(asDidWeb(did)).toBe(did)
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
it('throws if called with invalid dids', () => {
|
|
100
|
+
for (const [val, message] of INVALID) {
|
|
101
|
+
expect(() => asDidWeb(val)).toThrowError(
|
|
102
|
+
new InvalidDidError(
|
|
103
|
+
typeof val === 'string' ? val : typeof val,
|
|
104
|
+
message,
|
|
105
|
+
),
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./src/atproto.ts","./src/did-document.ts","./src/did-error.ts","./src/did.ts","./src/index.ts","./src/methods.ts","./src/methods/plc.ts","./src/methods/web.ts"],"version":"5.6.3"}
|