@atproto/dev-env 0.3.211 → 0.3.213
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
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atproto/dev-env
|
|
2
2
|
|
|
3
|
+
## 0.3.213
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`6634140`](https://github.com/bluesky-social/atproto/commit/66341400d49d1210619b000a040852d87085c32c), [`0e5df95`](https://github.com/bluesky-social/atproto/commit/0e5df95e3a8d81931524848d301cd43d1f12fb78)]:
|
|
8
|
+
- @atproto/ozone@0.1.166
|
|
9
|
+
- @atproto/bsky@0.0.219
|
|
10
|
+
- @atproto/api@0.19.2
|
|
11
|
+
- @atproto/pds@0.4.214
|
|
12
|
+
|
|
13
|
+
## 0.3.212
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`f7c2610`](https://github.com/bluesky-social/atproto/commit/f7c26103a6d4e24e5bedbb6fd908be140420e0dd), [`f7c2610`](https://github.com/bluesky-social/atproto/commit/f7c26103a6d4e24e5bedbb6fd908be140420e0dd), [`f7c2610`](https://github.com/bluesky-social/atproto/commit/f7c26103a6d4e24e5bedbb6fd908be140420e0dd), [`f7c2610`](https://github.com/bluesky-social/atproto/commit/f7c26103a6d4e24e5bedbb6fd908be140420e0dd), [`d5f4224`](https://github.com/bluesky-social/atproto/commit/d5f4224f73894a62d23d2375950cdadce6f130f4), [`f7c2610`](https://github.com/bluesky-social/atproto/commit/f7c26103a6d4e24e5bedbb6fd908be140420e0dd), [`138f0a0`](https://github.com/bluesky-social/atproto/commit/138f0a0b374c0d78372d5095237061d46db75a32), [`f7c2610`](https://github.com/bluesky-social/atproto/commit/f7c26103a6d4e24e5bedbb6fd908be140420e0dd), [`e8969b6`](https://github.com/bluesky-social/atproto/commit/e8969b6b3d3fed8912be53fd72b4d5288ca34766), [`f7c2610`](https://github.com/bluesky-social/atproto/commit/f7c26103a6d4e24e5bedbb6fd908be140420e0dd), [`52834ab`](https://github.com/bluesky-social/atproto/commit/52834aba182da8df3611fd9dff924e6c6a3973a7), [`137065b`](https://github.com/bluesky-social/atproto/commit/137065b333b8c9b97e6b3b2ac6147c7509a1ae42), [`f7c2610`](https://github.com/bluesky-social/atproto/commit/f7c26103a6d4e24e5bedbb6fd908be140420e0dd)]:
|
|
18
|
+
- @atproto/syntax@0.5.0
|
|
19
|
+
- @atproto/pds@0.4.213
|
|
20
|
+
- @atproto/common-web@0.4.18
|
|
21
|
+
- @atproto/sync@0.1.40
|
|
22
|
+
- @atproto/xrpc-server@0.10.15
|
|
23
|
+
- @atproto/ozone@0.1.165
|
|
24
|
+
- @atproto/bsky@0.0.218
|
|
25
|
+
- @atproto/api@0.19.1
|
|
26
|
+
- @atproto/bsync@0.0.24
|
|
27
|
+
- @atproto/lexicon@0.6.2
|
|
28
|
+
|
|
3
29
|
## 0.3.211
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { TestNetwork } from '../network';
|
|
1
2
|
import { SeedClient } from './client';
|
|
2
|
-
declare const _default: (sc: SeedClient) => Promise<SeedClient<
|
|
3
|
+
declare const _default: (sc: SeedClient<TestNetwork>) => Promise<SeedClient<TestNetwork>>;
|
|
3
4
|
export default _default;
|
|
4
5
|
//# sourceMappingURL=verifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifications.d.ts","sourceRoot":"","sources":["../../src/seed/verifications.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verifications.d.ts","sourceRoot":"","sources":["../../src/seed/verifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;yBAEf,IAAI,UAAU,CAAC,WAAW,CAAC;AAAjD,wBAuJC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const syntax_1 = require("@atproto/syntax");
|
|
3
4
|
exports.default = async (sc) => {
|
|
5
|
+
const labelerDid = sc.network.bsky.ctx.cfg.modServiceDid;
|
|
4
6
|
await sc.createAccount('alice', users.alice);
|
|
5
7
|
await sc.createAccount('bob', users.bob);
|
|
6
8
|
await sc.createAccount('carol', users.carol);
|
|
@@ -17,6 +19,8 @@ exports.default = async (sc) => {
|
|
|
17
19
|
await sc.createAccount('verifier2', users.verifier2);
|
|
18
20
|
// This user should be set a label 'impersonation` in the tests.
|
|
19
21
|
await sc.createAccount('verifier3', users.verifier3);
|
|
22
|
+
await sc.createAccount('handleinvalid', users.handleinvalid);
|
|
23
|
+
await sc.createAccount('handleempty', users.handleempty);
|
|
20
24
|
for (const name in sc.dids) {
|
|
21
25
|
await sc.createProfile(sc.dids[name], `display-${name}`, `descript-${name}`);
|
|
22
26
|
}
|
|
@@ -44,6 +48,33 @@ exports.default = async (sc) => {
|
|
|
44
48
|
await sc.verify(sc.dids.verifier2, sc.dids.verifier1, sc.accounts[sc.dids.verifier1].handle, sc.profiles[sc.dids.verifier1].displayName);
|
|
45
49
|
// verifier2: is verifier and has no verification by other verifier.
|
|
46
50
|
// NOOP
|
|
51
|
+
// handleinvalid: has verification but handle is set to invalid.
|
|
52
|
+
await sc.verify(sc.dids.verifier1, sc.dids.handleinvalid, sc.accounts[sc.dids.handleinvalid].handle, sc.profiles[sc.dids.handleinvalid].displayName);
|
|
53
|
+
// Process all events to sync actors to appview before modifying the DB
|
|
54
|
+
await sc.network.processAll();
|
|
55
|
+
// Do DB updates to change actors as needed for each case.
|
|
56
|
+
await createLabel(sc, labelerDid, {
|
|
57
|
+
src: labelerDid,
|
|
58
|
+
uri: sc.dids.impersonator,
|
|
59
|
+
cid: '',
|
|
60
|
+
val: 'impersonation',
|
|
61
|
+
});
|
|
62
|
+
await createLabel(sc, labelerDid, {
|
|
63
|
+
src: labelerDid,
|
|
64
|
+
uri: sc.dids.verifier3,
|
|
65
|
+
cid: '',
|
|
66
|
+
val: 'impersonation',
|
|
67
|
+
});
|
|
68
|
+
await sc.network.bsky.db.db
|
|
69
|
+
.updateTable('actor')
|
|
70
|
+
.set({ handle: syntax_1.INVALID_HANDLE })
|
|
71
|
+
.where('did', '=', sc.dids.handleinvalid)
|
|
72
|
+
.execute();
|
|
73
|
+
await sc.network.bsky.db.db
|
|
74
|
+
.updateTable('actor')
|
|
75
|
+
.set({ handle: null })
|
|
76
|
+
.where('did', '=', sc.dids.handleempty)
|
|
77
|
+
.execute();
|
|
47
78
|
return sc;
|
|
48
79
|
};
|
|
49
80
|
const users = {
|
|
@@ -107,5 +138,29 @@ const users = {
|
|
|
107
138
|
handle: 'nonverifier.test',
|
|
108
139
|
password: 'nonverifier-pass',
|
|
109
140
|
},
|
|
141
|
+
handleinvalid: {
|
|
142
|
+
email: 'handleinvalid@test.com',
|
|
143
|
+
handle: 'handleinvalid.test',
|
|
144
|
+
password: 'handleinvalid-pass',
|
|
145
|
+
},
|
|
146
|
+
handleempty: {
|
|
147
|
+
email: 'handleempty@test.com',
|
|
148
|
+
handle: 'handleempty.test',
|
|
149
|
+
password: 'handleempty-pass',
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
const createLabel = async (sc, labelerDid, opts) => {
|
|
153
|
+
await sc.network.bsky.db.db
|
|
154
|
+
.insertInto('label')
|
|
155
|
+
.values({
|
|
156
|
+
uri: opts.uri,
|
|
157
|
+
cid: opts.cid,
|
|
158
|
+
val: opts.val,
|
|
159
|
+
cts: new Date().toISOString(),
|
|
160
|
+
exp: opts.exp ?? null,
|
|
161
|
+
neg: false,
|
|
162
|
+
src: opts.src ?? labelerDid,
|
|
163
|
+
})
|
|
164
|
+
.execute();
|
|
110
165
|
};
|
|
111
166
|
//# sourceMappingURL=verif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EAAE,mBAAmB;QAC3B,QAAQ,EAAE,mBAAmB;KAC9B;IACD,SAAS,EAAE;QACT,KAAK,EAAE,oBAAoB;QAC3B,MAAM,EAAE,gBAAgB;QACxB,QAAQ,EAAE,gBAAgB;KAC3B;IACD,SAAS,EAAE;QACT,KAAK,EAAE,oBAAoB;QAC3B,MAAM,EAAE,gBAAgB;QACxB,QAAQ,EAAE,gBAAgB;KAC3B;IACD,SAAS,EAAE;QACT,KAAK,EAAE,oBAAoB;QAC3B,MAAM,EAAE,gBAAgB;QACxB,QAAQ,EAAE,gBAAgB;KAC3B;IACD,WAAW,EAAE;QACX,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,kBAAkB;QAC1B,QAAQ,EAAE,kBAAkB;KAC7B;CACF,CAAA","sourcesContent":["import { SeedClient } from './client'\n\nexport default async (sc: SeedClient) => {\n await sc.createAccount('alice', users.alice)\n await sc.createAccount('bob', users.bob)\n await sc.createAccount('carol', users.carol)\n await sc.createAccount('dan', users.dan)\n await sc.createAccount('eve', users.eve)\n await sc.createAccount('frank', users.frank)\n await sc.createAccount('gus', users.gus)\n\n // This user should be set a label 'impersonation` in the tests.\n await sc.createAccount('impersonator', users.impersonator)\n\n await sc.createAccount('nonverifier', users.nonverifier)\n\n // These users should be set as verifiers via DB in the test,\n // so their verifications are trusted by the app.\n await sc.createAccount('verifier1', users.verifier1)\n await sc.createAccount('verifier2', users.verifier2)\n // This user should be set a label 'impersonation` in the tests.\n await sc.createAccount('verifier3', users.verifier3)\n\n for (const name in sc.dids) {\n await sc.createProfile(sc.dids[name], `display-${name}`, `descript-${name}`)\n }\n\n // alice: the viewer, has no verifications at all.\n // NOOP\n\n // bob: has verifications by multiple verifiers.\n await sc.verify(\n sc.dids.verifier1,\n sc.dids.bob,\n sc.accounts[sc.dids.bob].handle,\n sc.profiles[sc.dids.bob].displayName,\n )\n await sc.verify(\n sc.dids.verifier2,\n sc.dids.bob,\n sc.accounts[sc.dids.bob].handle,\n sc.profiles[sc.dids.bob].displayName,\n )\n\n // carol: has non-broken and broken verifications by verifiers.\n await sc.verify(\n sc.dids.verifier1,\n sc.dids.carol,\n sc.accounts[sc.dids.carol].handle,\n sc.profiles[sc.dids.carol].displayName,\n )\n await sc.verify(\n sc.dids.verifier2,\n sc.dids.carol,\n 'carol.old.handle', // Broken: this was the handle during verification and it changed later.\n sc.profiles[sc.dids.carol].displayName,\n )\n\n // dan: has verifications by verifiers and non verifiers.\n await sc.verify(\n sc.dids.verifier1,\n sc.dids.dan,\n sc.accounts[sc.dids.dan].handle,\n sc.profiles[sc.dids.dan].displayName,\n )\n await sc.verify(\n sc.dids.nonverifier,\n sc.dids.dan,\n sc.accounts[sc.dids.dan].handle,\n sc.profiles[sc.dids.dan].displayName,\n )\n\n // eve: has no verifications at all.\n // NOOP\n\n // frank: has only broken verifications by verifiers.\n await sc.verify(\n sc.dids.verifier2,\n sc.dids.frank,\n sc.accounts[sc.dids.frank].handle,\n 'frank-old-name', // Broken: this was the name during verification and it changed later.\n )\n\n // gus: has only verifications by non verifiers.\n await sc.verify(\n sc.dids.nonverifier,\n sc.dids.gus,\n sc.accounts[sc.dids.gus].handle,\n sc.profiles[sc.dids.gus].displayName,\n )\n\n // impersonator: has verification by verifier but should get the impersonator label during tests.\n await sc.verify(\n sc.dids.verifier1,\n sc.dids.impersonator,\n sc.accounts[sc.dids.impersonator].handle,\n sc.profiles[sc.dids.impersonator].displayName,\n )\n\n // verifier1: is verifier and has verification by other verifier. Should show as a verifier, not just as verified.\n await sc.verify(\n sc.dids.verifier2,\n sc.dids.verifier1,\n sc.accounts[sc.dids.verifier1].handle,\n sc.profiles[sc.dids.verifier1].displayName,\n )\n\n // verifier2: is verifier and has no verification by other verifier.\n // NOOP\n\n return sc\n}\n\nconst users = {\n alice: {\n email: 'alice@test.com',\n handle: 'alice.test',\n password: 'alice-pass',\n },\n bob: {\n email: 'bob@test.com',\n handle: 'bob.test',\n password: 'bob-pass',\n },\n carol: {\n email: 'carol@test.com',\n handle: 'carol.test',\n password: 'carol-pass',\n },\n dan: {\n email: 'dan@test.com',\n handle: 'dan.test',\n password: 'dan-pass',\n },\n eve: {\n email: 'eve@test.com',\n handle: 'eve.test',\n password: 'eve-pass',\n },\n frank: {\n email: 'frank@test.com',\n handle: 'frank.test',\n password: 'frank-pass',\n },\n gus: {\n email: 'gus@test.com',\n handle: 'gus.test',\n password: 'gus-pass',\n },\n impersonator: {\n email: 'impersonator@test.com',\n handle: 'impersonator.test',\n password: 'impersonator-pass',\n },\n verifier1: {\n email: 'verifier1@test.com',\n handle: 'verifier1.test',\n password: 'verifier1-pass',\n },\n verifier2: {\n email: 'verifier2@test.com',\n handle: 'verifier2.test',\n password: 'verifier2-pass',\n },\n verifier3: {\n email: 'verifier3@test.com',\n handle: 'verifier3.test',\n password: 'verifier3-pass',\n },\n nonverifier: {\n email: 'nonverifier@test.com',\n handle: 'nonverifier.test',\n password: 'nonverifier-pass',\n },\n}\n"]}
|
|
1
|
+
{"version":3,"file":"verifications.js","sourceRoot":"","sources":["../../src/seed/verifications.ts"],"names":[],"mappings":";;AAAA,4CAAgD;AAIhD,kBAAe,KAAK,EAAE,EAA2B,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,CAAA;IAExD,MAAM,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IAC5C,MAAM,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IACxC,MAAM,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IAC5C,MAAM,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IACxC,MAAM,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IACxC,MAAM,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ACX,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,kBAAkB;QAC1B,QAAQ,EAAE,kBAAkB;KAC7B;IACD,aAAa,EAAE;QACb,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,oBAAoB;QAC5B,QAAQ,EAAE,oBAAoB;KAC/B;IACD,WAAW,EAAE;QACX,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,kBAAkB;QAC1B,QAAQ,EAAE,kBAAkB;KAC7B;CACF,CAAA;AAED,MAAM,WAAW,GAAG,KAAK,EACvB,EAA2B,EAC3B,UAAkB,EAClB,IAMC,EACD,EAAE;IACF,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;SACxB,UAAU,CAAC,OAAO,CAAC;SACnB,MAAM,CAAC;QACN,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC7B,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,IAAI;QACrB,GAAG,EAAE,KAAK;QACV,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,UAAU;KAC5B,CAAC;SACD,OAAO,EAAE,CAAA;AACd,CAAC,CAAA","sourcesContent":["import { INVALID_HANDLE } from '@atproto/syntax'\nimport { TestNetwork } from '../network'\nimport { SeedClient } from './client'\n\nexport default async (sc: SeedClient<TestNetwork>) => {\n const labelerDid = sc.network.bsky.ctx.cfg.modServiceDid\n\n await sc.createAccount('alice', users.alice)\n await sc.createAccount('bob', users.bob)\n await sc.createAccount('carol', users.carol)\n await sc.createAccount('dan', users.dan)\n await sc.createAccount('eve', users.eve)\n await sc.createAccount('frank', users.frank)\n await sc.createAccount('gus', users.gus)\n\n // This user should be set a label 'impersonation` in the tests.\n await sc.createAccount('impersonator', users.impersonator)\n\n await sc.createAccount('nonverifier', users.nonverifier)\n\n // These users should be set as verifiers via DB in the test,\n // so their verifications are trusted by the app.\n await sc.createAccount('verifier1', users.verifier1)\n await sc.createAccount('verifier2', users.verifier2)\n // This user should be set a label 'impersonation` in the tests.\n await sc.createAccount('verifier3', users.verifier3)\n\n await sc.createAccount('handleinvalid', users.handleinvalid)\n await sc.createAccount('handleempty', users.handleempty)\n\n for (const name in sc.dids) {\n await sc.createProfile(sc.dids[name], `display-${name}`, `descript-${name}`)\n }\n\n // alice: the viewer, has no verifications at all.\n // NOOP\n\n // bob: has verifications by multiple verifiers.\n await sc.verify(\n sc.dids.verifier1,\n sc.dids.bob,\n sc.accounts[sc.dids.bob].handle,\n sc.profiles[sc.dids.bob].displayName,\n )\n await sc.verify(\n sc.dids.verifier2,\n sc.dids.bob,\n sc.accounts[sc.dids.bob].handle,\n sc.profiles[sc.dids.bob].displayName,\n )\n\n // carol: has non-broken and broken verifications by verifiers.\n await sc.verify(\n sc.dids.verifier1,\n sc.dids.carol,\n sc.accounts[sc.dids.carol].handle,\n sc.profiles[sc.dids.carol].displayName,\n )\n await sc.verify(\n sc.dids.verifier2,\n sc.dids.carol,\n 'carol.old.handle', // Broken: this was the handle during verification and it changed later.\n sc.profiles[sc.dids.carol].displayName,\n )\n\n // dan: has verifications by verifiers and non verifiers.\n await sc.verify(\n sc.dids.verifier1,\n sc.dids.dan,\n sc.accounts[sc.dids.dan].handle,\n sc.profiles[sc.dids.dan].displayName,\n )\n await sc.verify(\n sc.dids.nonverifier,\n sc.dids.dan,\n sc.accounts[sc.dids.dan].handle,\n sc.profiles[sc.dids.dan].displayName,\n )\n\n // eve: has no verifications at all.\n // NOOP\n\n // frank: has only broken verifications by verifiers.\n await sc.verify(\n sc.dids.verifier2,\n sc.dids.frank,\n sc.accounts[sc.dids.frank].handle,\n 'frank-old-name', // Broken: this was the name during verification and it changed later.\n )\n\n // gus: has only verifications by non verifiers.\n await sc.verify(\n sc.dids.nonverifier,\n sc.dids.gus,\n sc.accounts[sc.dids.gus].handle,\n sc.profiles[sc.dids.gus].displayName,\n )\n\n // impersonator: has verification by verifier but should get the impersonator label during tests.\n await sc.verify(\n sc.dids.verifier1,\n sc.dids.impersonator,\n sc.accounts[sc.dids.impersonator].handle,\n sc.profiles[sc.dids.impersonator].displayName,\n )\n\n // verifier1: is verifier and has verification by other verifier. Should show as a verifier, not just as verified.\n await sc.verify(\n sc.dids.verifier2,\n sc.dids.verifier1,\n sc.accounts[sc.dids.verifier1].handle,\n sc.profiles[sc.dids.verifier1].displayName,\n )\n\n // verifier2: is verifier and has no verification by other verifier.\n // NOOP\n\n // handleinvalid: has verification but handle is set to invalid.\n await sc.verify(\n sc.dids.verifier1,\n sc.dids.handleinvalid,\n sc.accounts[sc.dids.handleinvalid].handle,\n sc.profiles[sc.dids.handleinvalid].displayName,\n )\n\n // Process all events to sync actors to appview before modifying the DB\n await sc.network.processAll()\n\n // Do DB updates to change actors as needed for each case.\n await createLabel(sc, labelerDid, {\n src: labelerDid,\n uri: sc.dids.impersonator,\n cid: '',\n val: 'impersonation',\n })\n\n await createLabel(sc, labelerDid, {\n src: labelerDid,\n uri: sc.dids.verifier3,\n cid: '',\n val: 'impersonation',\n })\n\n await sc.network.bsky.db.db\n .updateTable('actor')\n .set({ handle: INVALID_HANDLE })\n .where('did', '=', sc.dids.handleinvalid)\n .execute()\n await sc.network.bsky.db.db\n .updateTable('actor')\n .set({ handle: null })\n .where('did', '=', sc.dids.handleempty)\n .execute()\n\n return sc\n}\n\nconst users = {\n alice: {\n email: 'alice@test.com',\n handle: 'alice.test',\n password: 'alice-pass',\n },\n bob: {\n email: 'bob@test.com',\n handle: 'bob.test',\n password: 'bob-pass',\n },\n carol: {\n email: 'carol@test.com',\n handle: 'carol.test',\n password: 'carol-pass',\n },\n dan: {\n email: 'dan@test.com',\n handle: 'dan.test',\n password: 'dan-pass',\n },\n eve: {\n email: 'eve@test.com',\n handle: 'eve.test',\n password: 'eve-pass',\n },\n frank: {\n email: 'frank@test.com',\n handle: 'frank.test',\n password: 'frank-pass',\n },\n gus: {\n email: 'gus@test.com',\n handle: 'gus.test',\n password: 'gus-pass',\n },\n impersonator: {\n email: 'impersonator@test.com',\n handle: 'impersonator.test',\n password: 'impersonator-pass',\n },\n verifier1: {\n email: 'verifier1@test.com',\n handle: 'verifier1.test',\n password: 'verifier1-pass',\n },\n verifier2: {\n email: 'verifier2@test.com',\n handle: 'verifier2.test',\n password: 'verifier2-pass',\n },\n verifier3: {\n email: 'verifier3@test.com',\n handle: 'verifier3.test',\n password: 'verifier3-pass',\n },\n nonverifier: {\n email: 'nonverifier@test.com',\n handle: 'nonverifier.test',\n password: 'nonverifier-pass',\n },\n handleinvalid: {\n email: 'handleinvalid@test.com',\n handle: 'handleinvalid.test',\n password: 'handleinvalid-pass',\n },\n handleempty: {\n email: 'handleempty@test.com',\n handle: 'handleempty.test',\n password: 'handleempty-pass',\n },\n}\n\nconst createLabel = async (\n sc: SeedClient<TestNetwork>,\n labelerDid: string,\n opts: {\n src?: string\n uri: string\n cid: string\n val: string\n exp?: string\n },\n) => {\n await sc.network.bsky.db.db\n .insertInto('label')\n .values({\n uri: opts.uri,\n cid: opts.cid,\n val: opts.val,\n cts: new Date().toISOString(),\n exp: opts.exp ?? null,\n neg: false,\n src: opts.src ?? labelerDid,\n })\n .execute()\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/dev-env",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.213",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Local development environment helper for atproto development",
|
|
6
6
|
"keywords": [
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"multiformats": "^9.9.0",
|
|
28
28
|
"uint8arrays": "3.0.0",
|
|
29
29
|
"undici": "^6.14.1",
|
|
30
|
-
"@atproto/api": "^0.19.
|
|
31
|
-
"@atproto/bsky": "^0.0.
|
|
32
|
-
"@atproto/bsync": "^0.0.
|
|
33
|
-
"@atproto/common-web": "^0.4.
|
|
30
|
+
"@atproto/api": "^0.19.2",
|
|
31
|
+
"@atproto/bsky": "^0.0.219",
|
|
32
|
+
"@atproto/bsync": "^0.0.24",
|
|
33
|
+
"@atproto/common-web": "^0.4.18",
|
|
34
34
|
"@atproto/crypto": "^0.4.5",
|
|
35
35
|
"@atproto/identity": "^0.4.12",
|
|
36
|
-
"@atproto/lexicon": "^0.6.
|
|
37
|
-
"@atproto/ozone": "^0.1.
|
|
38
|
-
"@atproto/pds": "^0.4.
|
|
39
|
-
"@atproto/sync": "^0.1.
|
|
40
|
-
"@atproto/syntax": "^0.
|
|
41
|
-
"@atproto/xrpc-server": "^0.10.
|
|
36
|
+
"@atproto/lexicon": "^0.6.2",
|
|
37
|
+
"@atproto/ozone": "^0.1.166",
|
|
38
|
+
"@atproto/pds": "^0.4.214",
|
|
39
|
+
"@atproto/sync": "^0.1.40",
|
|
40
|
+
"@atproto/syntax": "^0.5.0",
|
|
41
|
+
"@atproto/xrpc-server": "^0.10.15"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/express": "^4.17.13",
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { INVALID_HANDLE } from '@atproto/syntax'
|
|
2
|
+
import { TestNetwork } from '../network'
|
|
1
3
|
import { SeedClient } from './client'
|
|
2
4
|
|
|
3
|
-
export default async (sc: SeedClient) => {
|
|
5
|
+
export default async (sc: SeedClient<TestNetwork>) => {
|
|
6
|
+
const labelerDid = sc.network.bsky.ctx.cfg.modServiceDid
|
|
7
|
+
|
|
4
8
|
await sc.createAccount('alice', users.alice)
|
|
5
9
|
await sc.createAccount('bob', users.bob)
|
|
6
10
|
await sc.createAccount('carol', users.carol)
|
|
@@ -21,6 +25,9 @@ export default async (sc: SeedClient) => {
|
|
|
21
25
|
// This user should be set a label 'impersonation` in the tests.
|
|
22
26
|
await sc.createAccount('verifier3', users.verifier3)
|
|
23
27
|
|
|
28
|
+
await sc.createAccount('handleinvalid', users.handleinvalid)
|
|
29
|
+
await sc.createAccount('handleempty', users.handleempty)
|
|
30
|
+
|
|
24
31
|
for (const name in sc.dids) {
|
|
25
32
|
await sc.createProfile(sc.dids[name], `display-${name}`, `descript-${name}`)
|
|
26
33
|
}
|
|
@@ -108,6 +115,43 @@ export default async (sc: SeedClient) => {
|
|
|
108
115
|
// verifier2: is verifier and has no verification by other verifier.
|
|
109
116
|
// NOOP
|
|
110
117
|
|
|
118
|
+
// handleinvalid: has verification but handle is set to invalid.
|
|
119
|
+
await sc.verify(
|
|
120
|
+
sc.dids.verifier1,
|
|
121
|
+
sc.dids.handleinvalid,
|
|
122
|
+
sc.accounts[sc.dids.handleinvalid].handle,
|
|
123
|
+
sc.profiles[sc.dids.handleinvalid].displayName,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
// Process all events to sync actors to appview before modifying the DB
|
|
127
|
+
await sc.network.processAll()
|
|
128
|
+
|
|
129
|
+
// Do DB updates to change actors as needed for each case.
|
|
130
|
+
await createLabel(sc, labelerDid, {
|
|
131
|
+
src: labelerDid,
|
|
132
|
+
uri: sc.dids.impersonator,
|
|
133
|
+
cid: '',
|
|
134
|
+
val: 'impersonation',
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
await createLabel(sc, labelerDid, {
|
|
138
|
+
src: labelerDid,
|
|
139
|
+
uri: sc.dids.verifier3,
|
|
140
|
+
cid: '',
|
|
141
|
+
val: 'impersonation',
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
await sc.network.bsky.db.db
|
|
145
|
+
.updateTable('actor')
|
|
146
|
+
.set({ handle: INVALID_HANDLE })
|
|
147
|
+
.where('did', '=', sc.dids.handleinvalid)
|
|
148
|
+
.execute()
|
|
149
|
+
await sc.network.bsky.db.db
|
|
150
|
+
.updateTable('actor')
|
|
151
|
+
.set({ handle: null })
|
|
152
|
+
.where('did', '=', sc.dids.handleempty)
|
|
153
|
+
.execute()
|
|
154
|
+
|
|
111
155
|
return sc
|
|
112
156
|
}
|
|
113
157
|
|
|
@@ -172,4 +216,39 @@ const users = {
|
|
|
172
216
|
handle: 'nonverifier.test',
|
|
173
217
|
password: 'nonverifier-pass',
|
|
174
218
|
},
|
|
219
|
+
handleinvalid: {
|
|
220
|
+
email: 'handleinvalid@test.com',
|
|
221
|
+
handle: 'handleinvalid.test',
|
|
222
|
+
password: 'handleinvalid-pass',
|
|
223
|
+
},
|
|
224
|
+
handleempty: {
|
|
225
|
+
email: 'handleempty@test.com',
|
|
226
|
+
handle: 'handleempty.test',
|
|
227
|
+
password: 'handleempty-pass',
|
|
228
|
+
},
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const createLabel = async (
|
|
232
|
+
sc: SeedClient<TestNetwork>,
|
|
233
|
+
labelerDid: string,
|
|
234
|
+
opts: {
|
|
235
|
+
src?: string
|
|
236
|
+
uri: string
|
|
237
|
+
cid: string
|
|
238
|
+
val: string
|
|
239
|
+
exp?: string
|
|
240
|
+
},
|
|
241
|
+
) => {
|
|
242
|
+
await sc.network.bsky.db.db
|
|
243
|
+
.insertInto('label')
|
|
244
|
+
.values({
|
|
245
|
+
uri: opts.uri,
|
|
246
|
+
cid: opts.cid,
|
|
247
|
+
val: opts.val,
|
|
248
|
+
cts: new Date().toISOString(),
|
|
249
|
+
exp: opts.exp ?? null,
|
|
250
|
+
neg: false,
|
|
251
|
+
src: opts.src ?? labelerDid,
|
|
252
|
+
})
|
|
253
|
+
.execute()
|
|
175
254
|
}
|