@dxos/client-services 0.3.2-main.d77d2bc → 0.3.2-main.ec06501
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/dist/lib/browser/{chunk-WOH6JPED.mjs → chunk-KLSDV4XQ.mjs} +62 -115
- package/dist/lib/browser/chunk-KLSDV4XQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/index.cjs +105 -148
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +81 -124
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/devices/devices-service.d.ts +2 -2
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +0 -4
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +2 -2
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +37 -35
- package/src/packlets/devices/devices-service.ts +3 -15
- package/src/packlets/identity/identity-manager.test.ts +6 -5
- package/src/packlets/identity/identity-manager.ts +12 -20
- package/src/packlets/identity/identity.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-WOH6JPED.mjs.map +0 -7
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Stream } from '@dxos/codec-protobuf';
|
|
2
2
|
import { Device, DevicesService, QueryDevicesResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
3
|
-
import {
|
|
3
|
+
import { DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
4
4
|
import { IdentityManager } from '../identity';
|
|
5
5
|
export declare class DevicesServiceImpl implements DevicesService {
|
|
6
6
|
private readonly _identityManager;
|
|
7
7
|
constructor(_identityManager: IdentityManager);
|
|
8
|
-
updateDevice(profile:
|
|
8
|
+
updateDevice(profile: DeviceProfileDocument): Promise<Device>;
|
|
9
9
|
queryDevices(): Stream<QueryDevicesResponse>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=devices-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devices-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devices/devices-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"devices-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devices/devices-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAc,cAAc,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AACtH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,kBAAmB,YAAW,cAAc;IAC3C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,eAAe;IAExD,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IAInE,YAAY,IAAI,MAAM,CAAC,oBAAoB,CAAC;CAqC7C"}
|
|
@@ -44,10 +44,6 @@ export declare class IdentityManager {
|
|
|
44
44
|
* Update the profile document of an existing identity.
|
|
45
45
|
*/
|
|
46
46
|
updateProfile(profile: ProfileDocument): Promise<ProfileDocument>;
|
|
47
|
-
updateDevice({ deviceKey, profile }: {
|
|
48
|
-
deviceKey: PublicKey;
|
|
49
|
-
profile: ProfileDocument;
|
|
50
|
-
}): Promise<ProfileDocument>;
|
|
51
47
|
private _constructIdentity;
|
|
52
48
|
private _constructSpace;
|
|
53
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"identity-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity-manager.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAgB,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,SAAS,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,SAAS,CAAC;IACxB,kBAAkB,EAAE,SAAS,CAAC;IAC9B,cAAc,EAAE,SAAS,CAAC;IAC1B,WAAW,EAAE,SAAS,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF,qBACa,eAAe;IAQxB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAVhC,QAAQ,CAAC,WAAW,cAAe;IAEnC,OAAO,CAAC,SAAS,CAAC,CAAW;gBAKV,cAAc,EAAE,aAAa,EAC7B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,SAAS,CAAC,WAAW,CAAC,EAClC,aAAa,EAAE,YAAY;IAG9C,IAAI,QAAQ,yBAEX;IAGK,IAAI,CAAC,GAAG,EAAE,OAAO;IAmBjB,KAAK;IAIL,cAAc,CAAC,EAAE,WAAW,EAAE,GAAE,qBAA0B;IA6EhE;;OAEG;IACG,cAAc,CAAC,MAAM,EAAE,kBAAkB;IA+B/C;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,eAAe;YAiB9B,kBAAkB;YA2ClB,eAAe;CAc9B"}
|
|
@@ -4,7 +4,7 @@ import { CredentialSigner } from '@dxos/credentials';
|
|
|
4
4
|
import { Signer } from '@dxos/crypto';
|
|
5
5
|
import { Space } from '@dxos/echo-pipeline';
|
|
6
6
|
import { PublicKey } from '@dxos/keys';
|
|
7
|
-
import { ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
7
|
+
import { DeviceProfileDocument, ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
8
8
|
import { DeviceAdmissionRequest } from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
9
9
|
import { ComplexMap } from '@dxos/util';
|
|
10
10
|
import { TrustedKeySetAuthVerifier } from './authenticator';
|
|
@@ -27,7 +27,7 @@ export declare class Identity {
|
|
|
27
27
|
readonly deviceKey: PublicKey;
|
|
28
28
|
readonly stateUpdate: Event<void>;
|
|
29
29
|
constructor({ space, signer, identityKey, deviceKey }: IdentityParams);
|
|
30
|
-
get authorizedDeviceKeys(): ComplexMap<PublicKey,
|
|
30
|
+
get authorizedDeviceKeys(): ComplexMap<PublicKey, DeviceProfileDocument>;
|
|
31
31
|
open(ctx: Context): Promise<void>;
|
|
32
32
|
close(ctx: Context): Promise<void>;
|
|
33
33
|
ready(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAEL,gBAAgB,EAIjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAgB,eAAe,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAEL,gBAAgB,EAIjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAgB,qBAAqB,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AACnH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF,OAAO,EAAE,UAAU,EAAc,MAAM,YAAY,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,SAAS,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,qBACa,QAAQ;IACnB,SAAgB,KAAK,EAAE,KAAK,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAqB;IACzD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAsB;IAC3D,SAAgB,YAAY,EAAE,yBAAyB,CAAC;IAExD,SAAgB,WAAW,EAAE,SAAS,CAAC;IACvC,SAAgB,SAAS,EAAE,SAAS,CAAC;IAErC,SAAgB,WAAW,cAAe;gBAE9B,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,cAAc;IA2BrE,IAAI,oBAAoB,IAAI,UAAU,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAEvE;IAGK,IAAI,CAAC,GAAG,EAAE,OAAO;IAOjB,KAAK,CAAC,GAAG,EAAE,OAAO;IAOlB,KAAK;IAMX,IAAI,eAAe,IAAI,eAAe,GAAG,SAAS,CAEjD;IAED;;OAEG;IACH,IAAI,eAAe,mDAElB;IAED,IAAI,YAAY,cAEf;IAED,IAAI,kBAAkB,cAErB;IAED,IAAI,qBAAqB,4EAExB;IAED,uBAAuB,IAAI,sBAAsB;IAQjD;;;OAGG;IACH,2BAA2B,IAAI,gBAAgB;IAS/C;;OAEG;IACH,yBAAyB,IAAI,gBAAgB;IAIvC,WAAW,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,EAAE,sBAAsB;CA2CrF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DXOS_VERSION = "0.3.2-main.
|
|
1
|
+
export declare const DXOS_VERSION = "0.3.2-main.ec06501";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.3.2-main.
|
|
3
|
+
"version": "0.3.2-main.ec06501",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -21,43 +21,45 @@
|
|
|
21
21
|
"src"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
"@dxos/
|
|
26
|
-
"@dxos/
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/echo-
|
|
35
|
-
"@dxos/echo-
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/teleport
|
|
51
|
-
"@dxos/teleport-extension-
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
24
|
+
"platform": "^1.3.6",
|
|
25
|
+
"@dxos/async": "0.3.2-main.ec06501",
|
|
26
|
+
"@dxos/client-protocol": "0.3.2-main.ec06501",
|
|
27
|
+
"@dxos/codec-protobuf": "0.3.2-main.ec06501",
|
|
28
|
+
"@dxos/config": "0.3.2-main.ec06501",
|
|
29
|
+
"@dxos/context": "0.3.2-main.ec06501",
|
|
30
|
+
"@dxos/credentials": "0.3.2-main.ec06501",
|
|
31
|
+
"@dxos/crypto": "0.3.2-main.ec06501",
|
|
32
|
+
"@dxos/debug": "0.3.2-main.ec06501",
|
|
33
|
+
"@dxos/document-model": "0.3.2-main.ec06501",
|
|
34
|
+
"@dxos/echo-db": "0.3.2-main.ec06501",
|
|
35
|
+
"@dxos/echo-pipeline": "0.3.2-main.ec06501",
|
|
36
|
+
"@dxos/echo-schema": "0.3.2-main.ec06501",
|
|
37
|
+
"@dxos/feed-store": "0.3.2-main.ec06501",
|
|
38
|
+
"@dxos/invariant": "0.3.2-main.ec06501",
|
|
39
|
+
"@dxos/keyring": "0.3.2-main.ec06501",
|
|
40
|
+
"@dxos/keys": "0.3.2-main.ec06501",
|
|
41
|
+
"@dxos/lock-file": "0.3.2-main.ec06501",
|
|
42
|
+
"@dxos/log": "0.3.2-main.ec06501",
|
|
43
|
+
"@dxos/messaging": "0.3.2-main.ec06501",
|
|
44
|
+
"@dxos/model-factory": "0.3.2-main.ec06501",
|
|
45
|
+
"@dxos/network-manager": "0.3.2-main.ec06501",
|
|
46
|
+
"@dxos/node-std": "0.3.2-main.ec06501",
|
|
47
|
+
"@dxos/protocols": "0.3.2-main.ec06501",
|
|
48
|
+
"@dxos/random-access-storage": "0.3.2-main.ec06501",
|
|
49
|
+
"@dxos/rpc": "0.3.2-main.ec06501",
|
|
50
|
+
"@dxos/teleport": "0.3.2-main.ec06501",
|
|
51
|
+
"@dxos/teleport-extension-gossip": "0.3.2-main.ec06501",
|
|
52
|
+
"@dxos/teleport-extension-object-sync": "0.3.2-main.ec06501",
|
|
53
|
+
"@dxos/text-model": "0.3.2-main.ec06501",
|
|
54
|
+
"@dxos/timeframe": "0.3.2-main.ec06501",
|
|
55
|
+
"@dxos/tracing": "0.3.2-main.ec06501",
|
|
56
|
+
"@dxos/util": "0.3.2-main.ec06501",
|
|
57
|
+
"@dxos/websocket-rpc": "0.3.2-main.ec06501"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
60
|
+
"@types/platform": "^1.3.4",
|
|
59
61
|
"@types/readable-stream": "^2.3.9",
|
|
60
|
-
"@dxos/signal": "0.3.2-main.
|
|
62
|
+
"@dxos/signal": "0.3.2-main.ec06501"
|
|
61
63
|
},
|
|
62
64
|
"publishConfig": {
|
|
63
65
|
"access": "public"
|
|
@@ -4,28 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { EventSubscriptions } from '@dxos/async';
|
|
6
6
|
import { Stream } from '@dxos/codec-protobuf';
|
|
7
|
-
import { invariant } from '@dxos/invariant';
|
|
8
7
|
import { Device, DeviceKind, DevicesService, QueryDevicesResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
9
|
-
import {
|
|
8
|
+
import { DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
10
9
|
|
|
11
10
|
import { IdentityManager } from '../identity';
|
|
12
11
|
|
|
13
12
|
export class DevicesServiceImpl implements DevicesService {
|
|
14
13
|
constructor(private readonly _identityManager: IdentityManager) {}
|
|
15
14
|
|
|
16
|
-
async updateDevice(profile:
|
|
17
|
-
|
|
18
|
-
const deviceKey = this._identityManager.identity.deviceKey;
|
|
19
|
-
await this._identityManager.updateDevice({
|
|
20
|
-
deviceKey,
|
|
21
|
-
profile,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
deviceKey,
|
|
26
|
-
kind: DeviceKind.CURRENT,
|
|
27
|
-
profile,
|
|
28
|
-
};
|
|
15
|
+
async updateDevice(profile: DeviceProfileDocument): Promise<Device> {
|
|
16
|
+
throw new Error('Method not implemented.');
|
|
29
17
|
}
|
|
30
18
|
|
|
31
19
|
queryDevices(): Stream<QueryDevicesResponse> {
|
|
@@ -152,14 +152,15 @@ describe('identity/identity-manager', () => {
|
|
|
152
152
|
expect(identity2.space.protocol.sessions.get(identity1.deviceKey)?.authStatus).to.equal(AuthStatus.SUCCESS);
|
|
153
153
|
});
|
|
154
154
|
|
|
155
|
-
test('
|
|
155
|
+
test('sets device profile', async () => {
|
|
156
156
|
const signalContext = new MemorySignalManagerContext();
|
|
157
157
|
|
|
158
|
-
const
|
|
159
|
-
const
|
|
158
|
+
const peer = await setupPeer({ signalContext });
|
|
159
|
+
const identity = await peer.identityManager.createIdentity();
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
// Note: Waiting for device profile credential to be processed.
|
|
162
|
+
await identity.stateUpdate.waitForCount(1);
|
|
162
163
|
|
|
163
|
-
expect(
|
|
164
|
+
expect(!!identity.authorizedDeviceKeys.get(identity.deviceKey)?.platform).is.true;
|
|
164
165
|
});
|
|
165
166
|
});
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import platform from 'platform';
|
|
6
|
+
|
|
5
7
|
import { Event } from '@dxos/async';
|
|
6
8
|
import { Context } from '@dxos/context';
|
|
7
9
|
import { createCredentialSignerWithKey, CredentialGenerator } from '@dxos/credentials';
|
|
@@ -134,6 +136,16 @@ export class IdentityManager {
|
|
|
134
136
|
// NOTE: This credential is written last. This is a hack to make sure that display name is set before identity is "ready".
|
|
135
137
|
credentials.push(await generator.createDeviceAuthorization(identityRecord.deviceKey));
|
|
136
138
|
|
|
139
|
+
// Write device metadata to profile.
|
|
140
|
+
credentials.push(
|
|
141
|
+
await generator.createDeviceProfile({
|
|
142
|
+
platform: platform.name,
|
|
143
|
+
platformVersion: platform.version,
|
|
144
|
+
architecture: typeof platform.os?.architecture === 'number' ? String(platform.os.architecture) : undefined,
|
|
145
|
+
os: platform.os?.family,
|
|
146
|
+
osVersion: platform.os?.version,
|
|
147
|
+
}),
|
|
148
|
+
);
|
|
137
149
|
for (const credential of credentials) {
|
|
138
150
|
await identity.controlPipeline.writer.write({
|
|
139
151
|
credential: { credential },
|
|
@@ -212,26 +224,6 @@ export class IdentityManager {
|
|
|
212
224
|
return profile;
|
|
213
225
|
}
|
|
214
226
|
|
|
215
|
-
async updateDevice({ deviceKey, profile }: { deviceKey: PublicKey; profile: ProfileDocument }) {
|
|
216
|
-
invariant(this._identity, 'Identity not initialized.');
|
|
217
|
-
|
|
218
|
-
invariant(this._identity.authorizedDeviceKeys.has(deviceKey), 'Device not authorized.');
|
|
219
|
-
|
|
220
|
-
const credential = await this._identity.getIdentityCredentialSigner().createCredential({
|
|
221
|
-
subject: this._identity.identityKey,
|
|
222
|
-
assertion: {
|
|
223
|
-
'@type': 'dxos.halo.credentials.DeviceProfile',
|
|
224
|
-
deviceKey,
|
|
225
|
-
profile,
|
|
226
|
-
},
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
const receipt = await this._identity.controlPipeline.writer.write({ credential: { credential } });
|
|
230
|
-
await this._identity.controlPipeline.state.waitUntilTimeframe(new Timeframe([[receipt.feedKey, receipt.seq]]));
|
|
231
|
-
this.stateUpdate.emit();
|
|
232
|
-
return profile;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
227
|
private async _constructIdentity(identityRecord: IdentityRecord) {
|
|
236
228
|
invariant(!this._identity);
|
|
237
229
|
log('constructing identity', { identityRecord });
|
|
@@ -20,7 +20,7 @@ import { invariant } from '@dxos/invariant';
|
|
|
20
20
|
import { PublicKey } from '@dxos/keys';
|
|
21
21
|
import { log } from '@dxos/log';
|
|
22
22
|
import { FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
23
|
-
import { AdmittedFeed, ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
23
|
+
import { AdmittedFeed, DeviceProfileDocument, ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
24
24
|
import { DeviceAdmissionRequest } from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
25
25
|
import { trace } from '@dxos/tracing';
|
|
26
26
|
import { ComplexMap, ComplexSet } from '@dxos/util';
|
|
@@ -77,7 +77,7 @@ export class Identity {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// TODO(burdon): Expose state object?
|
|
80
|
-
get authorizedDeviceKeys(): ComplexMap<PublicKey,
|
|
80
|
+
get authorizedDeviceKeys(): ComplexMap<PublicKey, DeviceProfileDocument> {
|
|
81
81
|
return this._deviceStateMachine.authorizedDeviceKeys;
|
|
82
82
|
}
|
|
83
83
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.3.2-main.
|
|
1
|
+
export const DXOS_VERSION = "0.3.2-main.ec06501";
|