@dxos/client-services 0.6.12-main.78ddbdf → 0.6.12-main.89e9959
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-XSFLJVDP.mjs → chunk-XVI3VSJT.mjs} +637 -292
- package/dist/lib/browser/chunk-XVI3VSJT.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +2 -2
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/node/{chunk-F3WGFGEN.cjs → chunk-NZL66D6K.cjs} +727 -382
- package/dist/lib/node/chunk-NZL66D6K.cjs.map +7 -0
- package/dist/lib/node/index.cjs +45 -45
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +8 -8
- package/dist/lib/node/testing/index.cjs.map +2 -2
- package/dist/lib/node-esm/{chunk-3HDLTAT2.mjs → chunk-6747X7GN.mjs} +637 -292
- package/dist/lib/node-esm/chunk-6747X7GN.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +2 -2
- package/dist/lib/node-esm/testing/index.mjs.map +2 -2
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/contacts-service.d.ts +1 -1
- package/dist/types/src/packlets/identity/contacts-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +1 -0
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +4 -2
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +1 -0
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +3 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +2 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts +2 -0
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts +31 -6
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +38 -38
- package/src/packlets/identity/authenticator.ts +5 -2
- package/src/packlets/identity/contacts-service.ts +1 -1
- package/src/packlets/identity/identity.ts +4 -0
- package/src/packlets/services/service-context.ts +41 -17
- package/src/packlets/services/service-host.ts +7 -5
- package/src/packlets/spaces/data-space-manager.ts +5 -1
- package/src/packlets/spaces/data-space.ts +23 -4
- package/src/packlets/spaces/edge-feed-replicator.test.ts +22 -15
- package/src/packlets/spaces/edge-feed-replicator.ts +45 -25
- package/src/packlets/spaces/notarization-plugin.test.ts +8 -4
- package/src/packlets/spaces/notarization-plugin.ts +169 -29
- package/src/packlets/testing/test-builder.ts +1 -1
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-XSFLJVDP.mjs.map +0 -7
- package/dist/lib/node/chunk-F3WGFGEN.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-3HDLTAT2.mjs.map +0 -7
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
InvitationsManager,
|
|
7
7
|
ServiceContext,
|
|
8
8
|
SpaceInvitationProtocol
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-6747X7GN.mjs";
|
|
10
10
|
|
|
11
11
|
// packages/sdk/client-services/src/packlets/testing/credential-utils.ts
|
|
12
12
|
import { createCredential } from "@dxos/credentials";
|
|
@@ -247,7 +247,7 @@ var createServiceContext = async ({ signalManagerFactory = async () => {
|
|
|
247
247
|
});
|
|
248
248
|
const level = createTestLevel();
|
|
249
249
|
await level.open();
|
|
250
|
-
return new ServiceContext(storage, level, networkManager, signalManager, void 0, {
|
|
250
|
+
return new ServiceContext(storage, level, networkManager, signalManager, void 0, void 0, {
|
|
251
251
|
invitationConnectionDefaultParams: {
|
|
252
252
|
controlHeartbeatInterval: 200
|
|
253
253
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/packlets/testing/credential-utils.ts", "../../../../src/packlets/testing/invitation-utils.ts", "../../../../src/packlets/testing/test-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createCredential } from '@dxos/credentials';\nimport { type Signer } from '@dxos/crypto';\nimport { PublicKey } from '@dxos/keys';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nexport const createMockCredential = async ({\n signer,\n issuer,\n}: {\n signer: Signer;\n issuer: PublicKey;\n}): Promise<Credential> =>\n createCredential({\n signer,\n issuer,\n subject: new PublicKey(Buffer.from('test')),\n assertion: {\n '@type': 'example.testing.rpc.MessageWithAny',\n payload: {\n '@type': 'google.protobuf.Any',\n value: Buffer.from('test'),\n },\n },\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { InvitationEncoder, type AuthenticatingInvitation, type CancellableInvitation } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { ServiceContext } from '../services';\n\n/**\n * Strip secrets from invitation before giving it to the peer.\n */\nexport const sanitizeInvitation = (invitation: Invitation): Invitation => {\n return InvitationEncoder.decode(InvitationEncoder.encode(invitation));\n};\n\nexport type InvitationHost = {\n share(options?: Partial<Invitation>): CancellableInvitation;\n};\n\nexport type InvitationGuest = {\n join(invitation: Invitation | string, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation;\n};\n\nexport type PerformInvitationCallbacks<T> = {\n onConnecting?: (value: T) => boolean | void;\n onConnected?: (value: T) => boolean | void;\n onReady?: (value: T) => boolean | void;\n onAuthenticating?: (value: T) => boolean | void;\n onSuccess?: (value: T) => boolean | void;\n onCancelled?: (value: T) => boolean | void;\n onTimeout?: (value: T) => boolean | void;\n onError?: (value: T) => boolean | void;\n};\n\nexport type PerformInvitationParams = {\n host: ServiceContext | InvitationHost;\n guest: ServiceContext | InvitationGuest;\n options?: Partial<Invitation>;\n hooks?: {\n host?: PerformInvitationCallbacks<CancellableInvitation>;\n guest?: PerformInvitationCallbacks<AuthenticatingInvitation>;\n };\n guestDeviceProfile?: DeviceProfileDocument;\n codeInputDelay?: number;\n};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\n// TODO(burdon): Make async.\n// TODO(burdon): Rename startInvitation.\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n codeInputDelay,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n let guestError = false;\n let guestConnected = false;\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n void createInvitation(host, options).then((hostObservable) => {\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (guestConnected) {\n break;\n }\n guestConnected = true;\n if (hooks?.host?.onConnecting?.(hostObservable)) {\n break;\n }\n const guestObservable = acceptInvitation(guest, hostInvitation, guestDeviceProfile);\n guestObservable.subscribe(\n async (guestInvitation: Invitation) => {\n switch (guestInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (hooks?.guest?.onConnecting?.(guestObservable)) {\n break;\n }\n invariant(hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!));\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.guest?.onConnected?.(guestObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.guest?.onReady?.(guestObservable)) {\n break;\n }\n const code = await authCode.wait();\n if (codeInputDelay == null) {\n await guestObservable.authenticate(code);\n } else {\n setTimeout(async () => {\n if (!guestError) {\n await guestObservable.authenticate(code);\n }\n }, codeInputDelay);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.guest?.onAuthenticating?.(guestObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.guest?.onSuccess?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.guest?.onCancelled?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.guest?.onTimeout?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ invitation: guestInvitation });\n }\n }\n },\n (error: Error) => {\n guestError = true;\n if (hooks?.guest?.onError?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ error });\n },\n );\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.host?.onConnected?.(hostObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.host?.onReady?.(hostObservable)) {\n break;\n }\n if (hostInvitation.authCode) {\n authCode.wake(hostInvitation.authCode);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.host?.onAuthenticating?.(hostObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.host?.onSuccess?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.host?.onCancelled?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.host?.onTimeout?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n }\n },\n (error: Error) => {\n if (hooks?.host?.onError?.(hostObservable)) {\n return;\n }\n hostComplete.wake({ error });\n },\n );\n });\n\n return [hostComplete.wait(), guestComplete.wait()];\n};\n\nexport const createInvitation = async (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): Promise<CancellableInvitation> => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n return host.invitationsManager.createInvitation({\n kind: Invitation.Kind.SPACE,\n ...options,\n });\n }\n\n return host.share(options);\n};\n\nexport const acceptInvitation = (\n guest: ServiceContext | InvitationGuest,\n invitation: Invitation,\n guestDeviceProfile?: DeviceProfileDocument,\n): AuthenticatingInvitation => {\n invitation = sanitizeInvitation(invitation);\n\n if (guest instanceof ServiceContext) {\n return guest.invitationsManager.acceptInvitation({\n invitation,\n deviceProfile: guestDeviceProfile,\n });\n }\n\n return guest.join(invitation, guestDeviceProfile);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Config } from '@dxos/config';\nimport { Context } from '@dxos/context';\nimport { createCredentialSignerWithChain, CredentialGenerator } from '@dxos/credentials';\nimport { failUndefined } from '@dxos/debug';\nimport { EchoHost, MetadataStore, SpaceManager, valueEncoding, MeshEchoReplicator } from '@dxos/echo-pipeline';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { type LevelDB } from '@dxos/kv-store';\nimport { createTestLevel } from '@dxos/kv-store/testing';\nimport { MemorySignalManager, MemorySignalManagerContext, type SignalManager } from '@dxos/messaging';\nimport { MemoryTransportFactory, SwarmNetworkManager } from '@dxos/network-manager';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { InvitationsHandler, InvitationsManager, SpaceInvitationProtocol } from '../invitations';\nimport { ClientServicesHost, ServiceContext, type ServiceContextRuntimeParams } from '../services';\nimport { DataSpaceManager, type DataSpaceManagerRuntimeParams, type SigningContext } from '../spaces';\n\n//\n// TODO(burdon): Replace with test builder.\n//\n\nexport const createServiceHost = (config: Config, signalManagerContext: MemorySignalManagerContext) => {\n return new ClientServicesHost({\n config,\n signalManager: new MemorySignalManager(signalManagerContext),\n transportFactory: MemoryTransportFactory,\n });\n};\n\nexport const createServiceContext = async ({\n signalManagerFactory = async () => {\n const signalContext = new MemorySignalManagerContext();\n return new MemorySignalManager(signalContext);\n },\n storage = createStorage({ type: StorageType.RAM }),\n runtimeParams,\n}: {\n signalManagerFactory?: () => Promise<SignalManager>;\n storage?: Storage;\n runtimeParams?: ServiceContextRuntimeParams;\n} = {}) => {\n const signalManager = await signalManagerFactory();\n const networkManager = new SwarmNetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n const level = createTestLevel();\n await level.open();\n\n return new ServiceContext(storage, level, networkManager, signalManager, undefined, {\n invitationConnectionDefaultParams: { controlHeartbeatInterval: 200 },\n ...runtimeParams,\n });\n};\n\nexport const createPeers = async (numPeers: number, signalManagerFactory?: () => Promise<SignalManager>) => {\n if (!signalManagerFactory) {\n const signalContext = new MemorySignalManagerContext();\n signalManagerFactory = async () => new MemorySignalManager(signalContext);\n }\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = await createServiceContext({ signalManagerFactory });\n await peer.open(new Context());\n return peer;\n }),\n );\n};\n\nexport const createIdentity = async (peer: ServiceContext) => {\n await peer.createIdentity();\n return peer;\n};\n\nexport class TestBuilder {\n public readonly signalContext = new MemorySignalManagerContext();\n private readonly _ctx = new Context();\n\n createPeer(peerOptions?: TestPeerOpts): TestPeer {\n const peer = new TestPeer(this.signalContext, peerOptions);\n this._ctx.onDispose(async () => peer.destroy());\n return peer;\n }\n\n async destroy() {\n await this._ctx.dispose();\n }\n}\n\nexport type TestPeerOpts = {\n dataStore?: StorageType;\n dataSpaceParams?: DataSpaceManagerRuntimeParams;\n};\n\nexport type TestPeerProps = {\n storage?: Storage;\n level?: LevelDB;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: SwarmNetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n echoHost?: EchoHost;\n meshEchoReplicator?: MeshEchoReplicator;\n invitationsManager?: InvitationsManager;\n};\n\nexport class TestPeer {\n private _props: TestPeerProps = {};\n\n constructor(\n private readonly _signalContext: MemorySignalManagerContext,\n private readonly _opts: TestPeerOpts = { dataStore: StorageType.RAM },\n ) {}\n\n get props() {\n return this._props;\n }\n\n get storage() {\n return (this._props.storage ??= createStorage({ type: this._opts.dataStore }));\n }\n\n get keyring() {\n return (this._props.keyring ??= new Keyring(this.storage.createDirectory('keyring')));\n }\n\n get level() {\n return (this._props.level ??= createTestLevel());\n }\n\n get feedStore() {\n return (this._props.feedStore ??= new FeedStore({\n factory: new FeedFactory({\n root: this.storage.createDirectory('feeds'),\n signer: this.keyring,\n hypercore: {\n valueEncoding,\n },\n }),\n }));\n }\n\n get metadataStore() {\n return (this._props.metadataStore ??= new MetadataStore(this.storage.createDirectory('metadata')));\n }\n\n get blobStore() {\n return (this._props.blobStore ??= new BlobStore(this.storage.createDirectory('blobs')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new SwarmNetworkManager({\n signalManager: new MemorySignalManager(this._signalContext),\n transportFactory: MemoryTransportFactory,\n }));\n }\n\n get spaceManager() {\n return (this._props.spaceManager ??= new SpaceManager({\n feedStore: this.feedStore,\n networkManager: this.networkManager,\n metadataStore: this.metadataStore,\n blobStore: this.blobStore,\n }));\n }\n\n get identity() {\n return this._props.signingContext ?? failUndefined();\n }\n\n get echoHost() {\n return (this._props.echoHost ??= new EchoHost({ kv: this.level }));\n }\n\n get meshEchoReplicator() {\n return (this._props.meshEchoReplicator ??= new MeshEchoReplicator());\n }\n\n get dataSpaceManager(): DataSpaceManager {\n return (this._props.dataSpaceManager ??= new DataSpaceManager({\n spaceManager: this.spaceManager,\n metadataStore: this.metadataStore,\n keyring: this.keyring,\n signingContext: this.identity,\n feedStore: this.feedStore,\n echoHost: this.echoHost,\n invitationsManager: this.invitationsManager,\n edgeConnection: undefined,\n meshReplicator: this.meshEchoReplicator,\n echoEdgeReplicator: undefined,\n runtimeParams: this._opts.dataSpaceParams,\n }));\n }\n\n get invitationsManager() {\n return (this._props.invitationsManager ??= new InvitationsManager(\n new InvitationsHandler(this.networkManager),\n (invitation) => {\n if (invitation.kind === Invitation.Kind.SPACE) {\n return new SpaceInvitationProtocol(this.dataSpaceManager, this.identity!, this.keyring, invitation.spaceKey!);\n } else {\n throw new Error('not implemented');\n }\n },\n this.metadataStore,\n ));\n }\n\n async createIdentity() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\n await this.level.close();\n await this.storage.reset();\n }\n}\n\nexport const createSigningContext = async (keyring: Keyring): Promise<SigningContext> => {\n const identityKey = await keyring.createKey();\n const deviceKey = await keyring.createKey();\n\n return {\n identityKey,\n deviceKey,\n credentialSigner: createCredentialSignerWithChain(\n keyring,\n {\n credential: await new CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey),\n },\n deviceKey,\n ),\n recordCredential: async () => {}, // No-op.\n getProfile: () => undefined,\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAIA,SAASA,wBAAwB;AAEjC,SAASC,iBAAiB;AAGnB,IAAMC,uBAAuB,OAAO,EACzCC,QACAC,OAAM,MAKNC,iBAAiB;EACfF;EACAC;EACAE,SAAS,IAAIC,UAAUC,OAAOC,KAAK,MAAA,CAAA;EACnCC,WAAW;IACT,SAAS;IACTC,SAAS;MACP,SAAS;MACTC,OAAOJ,OAAOC,KAAK,MAAA;IACrB;EACF;AACF,CAAA;;;ACvBF,SAASI,eAAe;AACxB,SAASC,yBAAoF;AAC7F,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;;AAQpB,IAAMC,qBAAqB,CAAC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K9D,YAAYS,kBAAAA;AAChC;;;AChPA,SAASsD,eAAe;AACxB,SAASC,iCAAiCC,2BAA2B;AACrE,SAASC,qBAAqB;AAC9B,SAASC,UAAUC,eAAeC,cAAcC,eAAeC,0BAA0B;AACzF,SAASC,aAAaC,iBAAiB;AACvC,SAASC,eAAe;AAExB,SAASC,uBAAuB;AAChC,SAASC,qBAAqBC,kCAAsD;AACpF,SAASC,wBAAwBC,2BAA2B;AAC5D,SAASC,cAAAA,mBAAkB;AAC3B,SAASC,eAAeC,mBAAiC;AACzD,SAASC,iBAAiB;;AAUnB,IAAMC,oBAAoB,CAACC,QAAgBC,yBAAAA;AAChD,SAAO,IAAIC,mBAAmB;IAC5BF;IACAG,eAAe,IAAIC,oBAAoBH,oBAAAA;IACvCI,kBAAkBC;EACpB,CAAA;AACF;AAEO,IAAMC,uBAAuB,OAAO,EACzCC,uBAAuB,YAAA;AACrB,QAAMC,gBAAgB,IAAIC,2BAAAA;AAC1B,SAAO,IAAIN,oBAAoBK,aAAAA;AACjC,GACAE,UAAUC,cAAc;EAAEC,MAAMC,YAAYC;AAAI,CAAA,GAChDC,cAAa,IAKX,CAAC,MAAC;AACJ,QAAMb,gBAAgB,MAAMK,qBAAAA;AAC5B,QAAMS,iBAAiB,IAAIC,oBAAoB;IAC7Cf;IACAE,kBAAkBC;EACpB,CAAA;AACA,QAAMa,QAAQC,gBAAAA;AACd,QAAMD,MAAME,KAAI;AAEhB,SAAO,IAAIC,eAAeX,SAASQ,OAAOF,gBAAgBd,eAAeoB,QAAW;
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createCredential } from '@dxos/credentials';\nimport { type Signer } from '@dxos/crypto';\nimport { PublicKey } from '@dxos/keys';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nexport const createMockCredential = async ({\n signer,\n issuer,\n}: {\n signer: Signer;\n issuer: PublicKey;\n}): Promise<Credential> =>\n createCredential({\n signer,\n issuer,\n subject: new PublicKey(Buffer.from('test')),\n assertion: {\n '@type': 'example.testing.rpc.MessageWithAny',\n payload: {\n '@type': 'google.protobuf.Any',\n value: Buffer.from('test'),\n },\n },\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { InvitationEncoder, type AuthenticatingInvitation, type CancellableInvitation } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { ServiceContext } from '../services';\n\n/**\n * Strip secrets from invitation before giving it to the peer.\n */\nexport const sanitizeInvitation = (invitation: Invitation): Invitation => {\n return InvitationEncoder.decode(InvitationEncoder.encode(invitation));\n};\n\nexport type InvitationHost = {\n share(options?: Partial<Invitation>): CancellableInvitation;\n};\n\nexport type InvitationGuest = {\n join(invitation: Invitation | string, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation;\n};\n\nexport type PerformInvitationCallbacks<T> = {\n onConnecting?: (value: T) => boolean | void;\n onConnected?: (value: T) => boolean | void;\n onReady?: (value: T) => boolean | void;\n onAuthenticating?: (value: T) => boolean | void;\n onSuccess?: (value: T) => boolean | void;\n onCancelled?: (value: T) => boolean | void;\n onTimeout?: (value: T) => boolean | void;\n onError?: (value: T) => boolean | void;\n};\n\nexport type PerformInvitationParams = {\n host: ServiceContext | InvitationHost;\n guest: ServiceContext | InvitationGuest;\n options?: Partial<Invitation>;\n hooks?: {\n host?: PerformInvitationCallbacks<CancellableInvitation>;\n guest?: PerformInvitationCallbacks<AuthenticatingInvitation>;\n };\n guestDeviceProfile?: DeviceProfileDocument;\n codeInputDelay?: number;\n};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\n// TODO(burdon): Make async.\n// TODO(burdon): Rename startInvitation.\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n codeInputDelay,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n let guestError = false;\n let guestConnected = false;\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n void createInvitation(host, options).then((hostObservable) => {\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (guestConnected) {\n break;\n }\n guestConnected = true;\n if (hooks?.host?.onConnecting?.(hostObservable)) {\n break;\n }\n const guestObservable = acceptInvitation(guest, hostInvitation, guestDeviceProfile);\n guestObservable.subscribe(\n async (guestInvitation: Invitation) => {\n switch (guestInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (hooks?.guest?.onConnecting?.(guestObservable)) {\n break;\n }\n invariant(hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!));\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.guest?.onConnected?.(guestObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.guest?.onReady?.(guestObservable)) {\n break;\n }\n const code = await authCode.wait();\n if (codeInputDelay == null) {\n await guestObservable.authenticate(code);\n } else {\n setTimeout(async () => {\n if (!guestError) {\n await guestObservable.authenticate(code);\n }\n }, codeInputDelay);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.guest?.onAuthenticating?.(guestObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.guest?.onSuccess?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.guest?.onCancelled?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.guest?.onTimeout?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ invitation: guestInvitation });\n }\n }\n },\n (error: Error) => {\n guestError = true;\n if (hooks?.guest?.onError?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ error });\n },\n );\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.host?.onConnected?.(hostObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.host?.onReady?.(hostObservable)) {\n break;\n }\n if (hostInvitation.authCode) {\n authCode.wake(hostInvitation.authCode);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.host?.onAuthenticating?.(hostObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.host?.onSuccess?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.host?.onCancelled?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.host?.onTimeout?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n }\n },\n (error: Error) => {\n if (hooks?.host?.onError?.(hostObservable)) {\n return;\n }\n hostComplete.wake({ error });\n },\n );\n });\n\n return [hostComplete.wait(), guestComplete.wait()];\n};\n\nexport const createInvitation = async (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): Promise<CancellableInvitation> => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n return host.invitationsManager.createInvitation({\n kind: Invitation.Kind.SPACE,\n ...options,\n });\n }\n\n return host.share(options);\n};\n\nexport const acceptInvitation = (\n guest: ServiceContext | InvitationGuest,\n invitation: Invitation,\n guestDeviceProfile?: DeviceProfileDocument,\n): AuthenticatingInvitation => {\n invitation = sanitizeInvitation(invitation);\n\n if (guest instanceof ServiceContext) {\n return guest.invitationsManager.acceptInvitation({\n invitation,\n deviceProfile: guestDeviceProfile,\n });\n }\n\n return guest.join(invitation, guestDeviceProfile);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Config } from '@dxos/config';\nimport { Context } from '@dxos/context';\nimport { createCredentialSignerWithChain, CredentialGenerator } from '@dxos/credentials';\nimport { failUndefined } from '@dxos/debug';\nimport { EchoHost, MetadataStore, SpaceManager, valueEncoding, MeshEchoReplicator } from '@dxos/echo-pipeline';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { type LevelDB } from '@dxos/kv-store';\nimport { createTestLevel } from '@dxos/kv-store/testing';\nimport { MemorySignalManager, MemorySignalManagerContext, type SignalManager } from '@dxos/messaging';\nimport { MemoryTransportFactory, SwarmNetworkManager } from '@dxos/network-manager';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { InvitationsHandler, InvitationsManager, SpaceInvitationProtocol } from '../invitations';\nimport { ClientServicesHost, ServiceContext, type ServiceContextRuntimeParams } from '../services';\nimport { DataSpaceManager, type DataSpaceManagerRuntimeParams, type SigningContext } from '../spaces';\n\n//\n// TODO(burdon): Replace with test builder.\n//\n\nexport const createServiceHost = (config: Config, signalManagerContext: MemorySignalManagerContext) => {\n return new ClientServicesHost({\n config,\n signalManager: new MemorySignalManager(signalManagerContext),\n transportFactory: MemoryTransportFactory,\n });\n};\n\nexport const createServiceContext = async ({\n signalManagerFactory = async () => {\n const signalContext = new MemorySignalManagerContext();\n return new MemorySignalManager(signalContext);\n },\n storage = createStorage({ type: StorageType.RAM }),\n runtimeParams,\n}: {\n signalManagerFactory?: () => Promise<SignalManager>;\n storage?: Storage;\n runtimeParams?: ServiceContextRuntimeParams;\n} = {}) => {\n const signalManager = await signalManagerFactory();\n const networkManager = new SwarmNetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n const level = createTestLevel();\n await level.open();\n\n return new ServiceContext(storage, level, networkManager, signalManager, undefined, undefined, {\n invitationConnectionDefaultParams: { controlHeartbeatInterval: 200 },\n ...runtimeParams,\n });\n};\n\nexport const createPeers = async (numPeers: number, signalManagerFactory?: () => Promise<SignalManager>) => {\n if (!signalManagerFactory) {\n const signalContext = new MemorySignalManagerContext();\n signalManagerFactory = async () => new MemorySignalManager(signalContext);\n }\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = await createServiceContext({ signalManagerFactory });\n await peer.open(new Context());\n return peer;\n }),\n );\n};\n\nexport const createIdentity = async (peer: ServiceContext) => {\n await peer.createIdentity();\n return peer;\n};\n\nexport class TestBuilder {\n public readonly signalContext = new MemorySignalManagerContext();\n private readonly _ctx = new Context();\n\n createPeer(peerOptions?: TestPeerOpts): TestPeer {\n const peer = new TestPeer(this.signalContext, peerOptions);\n this._ctx.onDispose(async () => peer.destroy());\n return peer;\n }\n\n async destroy() {\n await this._ctx.dispose();\n }\n}\n\nexport type TestPeerOpts = {\n dataStore?: StorageType;\n dataSpaceParams?: DataSpaceManagerRuntimeParams;\n};\n\nexport type TestPeerProps = {\n storage?: Storage;\n level?: LevelDB;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: SwarmNetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n echoHost?: EchoHost;\n meshEchoReplicator?: MeshEchoReplicator;\n invitationsManager?: InvitationsManager;\n};\n\nexport class TestPeer {\n private _props: TestPeerProps = {};\n\n constructor(\n private readonly _signalContext: MemorySignalManagerContext,\n private readonly _opts: TestPeerOpts = { dataStore: StorageType.RAM },\n ) {}\n\n get props() {\n return this._props;\n }\n\n get storage() {\n return (this._props.storage ??= createStorage({ type: this._opts.dataStore }));\n }\n\n get keyring() {\n return (this._props.keyring ??= new Keyring(this.storage.createDirectory('keyring')));\n }\n\n get level() {\n return (this._props.level ??= createTestLevel());\n }\n\n get feedStore() {\n return (this._props.feedStore ??= new FeedStore({\n factory: new FeedFactory({\n root: this.storage.createDirectory('feeds'),\n signer: this.keyring,\n hypercore: {\n valueEncoding,\n },\n }),\n }));\n }\n\n get metadataStore() {\n return (this._props.metadataStore ??= new MetadataStore(this.storage.createDirectory('metadata')));\n }\n\n get blobStore() {\n return (this._props.blobStore ??= new BlobStore(this.storage.createDirectory('blobs')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new SwarmNetworkManager({\n signalManager: new MemorySignalManager(this._signalContext),\n transportFactory: MemoryTransportFactory,\n }));\n }\n\n get spaceManager() {\n return (this._props.spaceManager ??= new SpaceManager({\n feedStore: this.feedStore,\n networkManager: this.networkManager,\n metadataStore: this.metadataStore,\n blobStore: this.blobStore,\n }));\n }\n\n get identity() {\n return this._props.signingContext ?? failUndefined();\n }\n\n get echoHost() {\n return (this._props.echoHost ??= new EchoHost({ kv: this.level }));\n }\n\n get meshEchoReplicator() {\n return (this._props.meshEchoReplicator ??= new MeshEchoReplicator());\n }\n\n get dataSpaceManager(): DataSpaceManager {\n return (this._props.dataSpaceManager ??= new DataSpaceManager({\n spaceManager: this.spaceManager,\n metadataStore: this.metadataStore,\n keyring: this.keyring,\n signingContext: this.identity,\n feedStore: this.feedStore,\n echoHost: this.echoHost,\n invitationsManager: this.invitationsManager,\n edgeConnection: undefined,\n meshReplicator: this.meshEchoReplicator,\n echoEdgeReplicator: undefined,\n runtimeParams: this._opts.dataSpaceParams,\n }));\n }\n\n get invitationsManager() {\n return (this._props.invitationsManager ??= new InvitationsManager(\n new InvitationsHandler(this.networkManager),\n (invitation) => {\n if (invitation.kind === Invitation.Kind.SPACE) {\n return new SpaceInvitationProtocol(this.dataSpaceManager, this.identity!, this.keyring, invitation.spaceKey!);\n } else {\n throw new Error('not implemented');\n }\n },\n this.metadataStore,\n ));\n }\n\n async createIdentity() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\n await this.level.close();\n await this.storage.reset();\n }\n}\n\nexport const createSigningContext = async (keyring: Keyring): Promise<SigningContext> => {\n const identityKey = await keyring.createKey();\n const deviceKey = await keyring.createKey();\n\n return {\n identityKey,\n deviceKey,\n credentialSigner: createCredentialSignerWithChain(\n keyring,\n {\n credential: await new CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey),\n },\n deviceKey,\n ),\n recordCredential: async () => {}, // No-op.\n getProfile: () => undefined,\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAIA,SAASA,wBAAwB;AAEjC,SAASC,iBAAiB;AAGnB,IAAMC,uBAAuB,OAAO,EACzCC,QACAC,OAAM,MAKNC,iBAAiB;EACfF;EACAC;EACAE,SAAS,IAAIC,UAAUC,OAAOC,KAAK,MAAA,CAAA;EACnCC,WAAW;IACT,SAAS;IACTC,SAAS;MACP,SAAS;MACTC,OAAOJ,OAAOC,KAAK,MAAA;IACrB;EACF;AACF,CAAA;;;ACvBF,SAASI,eAAe;AACxB,SAASC,yBAAoF;AAC7F,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;;AAQpB,IAAMC,qBAAqB,CAACC,eAAAA;AACjC,SAAOC,kBAAkBC,OAAOD,kBAAkBE,OAAOH,UAAAA,CAAAA;AAC3D;AAqCO,IAAMI,oBAAoB,CAAC,EAChCC,MACAC,OACAC,SACAC,OACAC,oBACAC,eAAc,MACU;AACxB,MAAIC,aAAa;AACjB,MAAIC,iBAAiB;AACrB,QAAMC,eAAe,IAAIC,QAAAA;AACzB,QAAMC,gBAAgB,IAAID,QAAAA;AAC1B,QAAME,WAAW,IAAIF,QAAAA;AAErB,OAAKG,iBAAiBZ,MAAME,OAAAA,EAASW,KAAK,CAACC,mBAAAA;AACzCA,mBAAeC,UACb,OAAOC,mBAAAA;AACL,cAAQA,eAAeC,OAAK;QAC1B,KAAKC,WAAWC,MAAMC,YAAY;AAChC,cAAIb,gBAAgB;AAClB;UACF;AACAA,2BAAiB;AACjB,cAAIJ,OAAOH,MAAMqB,eAAeP,cAAAA,GAAiB;AAC/C;UACF;AACA,gBAAMQ,kBAAkBC,iBAAiB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C3C,QAAMC,YAAY,MAAM/C,QAAQ8C,UAAS;AAEzC,SAAO;IACLD;IACAE;IACAC,kBAAkBC,gCAChBjD,SACA;MACEkD,YAAY,MAAM,IAAIC,oBAAoBnD,SAAS6C,aAAaE,SAAAA,EAAWK,0BAA0BL,SAAAA;IACvG,GACAA,SAAAA;IAEFM,kBAAkB,YAAA;IAAa;IAC/BC,YAAY,MAAMjF;EACpB;AACF;",
|
|
6
6
|
"names": ["createCredential", "PublicKey", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "Trigger", "InvitationEncoder", "invariant", "Invitation", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "codeInputDelay", "guestError", "guestConnected", "hostComplete", "Trigger", "guestComplete", "authCode", "createInvitation", "then", "hostObservable", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "code", "wait", "authenticate", "setTimeout", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "wake", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "invitationsManager", "kind", "Kind", "SPACE", "share", "deviceProfile", "join", "Context", "createCredentialSignerWithChain", "CredentialGenerator", "failUndefined", "EchoHost", "MetadataStore", "SpaceManager", "valueEncoding", "MeshEchoReplicator", "FeedFactory", "FeedStore", "Keyring", "createTestLevel", "MemorySignalManager", "MemorySignalManagerContext", "MemoryTransportFactory", "SwarmNetworkManager", "Invitation", "createStorage", "StorageType", "BlobStore", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalManagerFactory", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "runtimeParams", "networkManager", "SwarmNetworkManager", "level", "createTestLevel", "open", "ServiceContext", "undefined", "invitationConnectionDefaultParams", "controlHeartbeatInterval", "createPeers", "numPeers", "Promise", "all", "Array", "from", "map", "peer", "Context", "createIdentity", "TestBuilder", "_ctx", "createPeer", "peerOptions", "TestPeer", "onDispose", "destroy", "dispose", "constructor", "_signalContext", "_opts", "dataStore", "_props", "props", "keyring", "Keyring", "createDirectory", "feedStore", "FeedStore", "factory", "FeedFactory", "root", "signer", "hypercore", "valueEncoding", "metadataStore", "MetadataStore", "blobStore", "BlobStore", "spaceManager", "SpaceManager", "identity", "signingContext", "failUndefined", "echoHost", "EchoHost", "kv", "meshEchoReplicator", "MeshEchoReplicator", "dataSpaceManager", "DataSpaceManager", "invitationsManager", "edgeConnection", "meshReplicator", "echoEdgeReplicator", "dataSpaceParams", "InvitationsManager", "InvitationsHandler", "invitation", "kind", "Invitation", "Kind", "SPACE", "SpaceInvitationProtocol", "spaceKey", "Error", "createSigningContext", "close", "reset", "identityKey", "createKey", "deviceKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticator.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/authenticator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAW,MAAM,aAAa,CAAC;AAElD,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C,eAAO,MAAM,kBAAkB,WACpB,gBAAgB,KAAG,YAW3B,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AAa;CAItB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stream } from '@dxos/codec-protobuf';
|
|
2
|
-
import type
|
|
2
|
+
import { type SpaceManager } from '@dxos/echo-pipeline';
|
|
3
3
|
import { type ContactBook, type ContactsService } from '@dxos/protocols/proto/dxos/client/services';
|
|
4
4
|
import { type IdentityManager } from './identity-manager';
|
|
5
5
|
import { type DataSpaceManager } from '../spaces';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/contacts-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"contacts-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/contacts-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAgB,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAGlH,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,qBAAa,mBAAoB,YAAW,eAAe;IAEvD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBAFzB,gBAAgB,EAAE,eAAe,EACjC,aAAa,EAAE,YAAY,EAC3B,yBAAyB,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC;IAGvE,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IA8BzC,aAAa,IAAI,MAAM,CAAC,WAAW,CAAC;CAgCrC"}
|
|
@@ -50,6 +50,7 @@ export declare class Identity {
|
|
|
50
50
|
get haloGenesisFeedKey(): PublicKey;
|
|
51
51
|
get deviceCredentialChain(): import("@dxos/protocols/proto/dxos/halo/credentials").Chain | undefined;
|
|
52
52
|
get presence(): Presence | undefined;
|
|
53
|
+
get signer(): Signer;
|
|
53
54
|
/**
|
|
54
55
|
* Issues credentials as identity.
|
|
55
56
|
* Requires identity to be ready.
|
|
@@ -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,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAEL,KAAK,gBAAgB,EAItB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAGhE,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAI5D,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,SAAS,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,MAAM,CA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
1
1
|
import { Trigger } from '@dxos/async';
|
|
2
2
|
import { Context, Resource } from '@dxos/context';
|
|
3
3
|
import { EchoHost, MetadataStore, SpaceManager } from '@dxos/echo-pipeline';
|
|
4
|
-
import type { EdgeConnection } from '@dxos/edge-client';
|
|
4
|
+
import type { EdgeHttpClient, EdgeConnection } from '@dxos/edge-client';
|
|
5
5
|
import { FeedStore } from '@dxos/feed-store';
|
|
6
6
|
import { Keyring } from '@dxos/keyring';
|
|
7
7
|
import { type LevelDB } from '@dxos/kv-store';
|
|
@@ -30,8 +30,10 @@ export declare class ServiceContext extends Resource {
|
|
|
30
30
|
readonly networkManager: SwarmNetworkManager;
|
|
31
31
|
readonly signalManager: SignalManager;
|
|
32
32
|
private readonly _edgeConnection;
|
|
33
|
+
private readonly _edgeHttpClient;
|
|
33
34
|
readonly _runtimeParams?: ServiceContextRuntimeParams | undefined;
|
|
34
35
|
private readonly _edgeFeatures?;
|
|
36
|
+
private readonly _edgeIdentityUpdateMutex;
|
|
35
37
|
readonly initialized: Trigger<void>;
|
|
36
38
|
readonly metadataStore: MetadataStore;
|
|
37
39
|
readonly blobStore: BlobStore;
|
|
@@ -48,7 +50,7 @@ export declare class ServiceContext extends Resource {
|
|
|
48
50
|
private readonly _handlerFactories;
|
|
49
51
|
private _deviceSpaceSync?;
|
|
50
52
|
private readonly _instanceId;
|
|
51
|
-
constructor(storage: Storage, level: LevelDB, networkManager: SwarmNetworkManager, signalManager: SignalManager, _edgeConnection: EdgeConnection | undefined, _runtimeParams?: ServiceContextRuntimeParams | undefined, _edgeFeatures?: Runtime.Client.EdgeFeatures | undefined);
|
|
53
|
+
constructor(storage: Storage, level: LevelDB, networkManager: SwarmNetworkManager, signalManager: SignalManager, _edgeConnection: EdgeConnection | undefined, _edgeHttpClient: EdgeHttpClient | undefined, _runtimeParams?: ServiceContextRuntimeParams | undefined, _edgeFeatures?: Runtime.Client.EdgeFeatures | undefined);
|
|
52
54
|
protected _open(ctx: Context): Promise<void>;
|
|
53
55
|
protected _close(ctx: Context): Promise<void>;
|
|
54
56
|
createIdentity(params?: CreateIdentityOptions): Promise<import("../identity").Identity>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4B,OAAO,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAEL,QAAQ,EAER,aAAa,EACb,YAAY,EAEb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EACL,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,OAAO,EAAE,EAAE,iBAAiB;IAqD9C,IAAI,CAAC,GAAG,EAAE,OAAO;IA6GjB,KAAK;IAkBL,KAAK;YAYG,eAAe;CAK9B"}
|
|
@@ -2,7 +2,7 @@ import { Event } from '@dxos/async';
|
|
|
2
2
|
import { Resource } from '@dxos/context';
|
|
3
3
|
import { type CredentialSigner } from '@dxos/credentials';
|
|
4
4
|
import { type EchoEdgeReplicator, type EchoHost, type MeshEchoReplicator, type MetadataStore, type SpaceManager } from '@dxos/echo-pipeline';
|
|
5
|
-
import type { EdgeConnection } from '@dxos/edge-client';
|
|
5
|
+
import type { EdgeConnection, EdgeHttpClient } from '@dxos/edge-client';
|
|
6
6
|
import { type FeedStore } from '@dxos/feed-store';
|
|
7
7
|
import { type Keyring } from '@dxos/keyring';
|
|
8
8
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -50,6 +50,7 @@ export type DataSpaceManagerParams = {
|
|
|
50
50
|
echoHost: EchoHost;
|
|
51
51
|
invitationsManager: InvitationsManager;
|
|
52
52
|
edgeConnection?: EdgeConnection;
|
|
53
|
+
edgeHttpClient?: EdgeHttpClient;
|
|
53
54
|
meshReplicator?: MeshEchoReplicator;
|
|
54
55
|
echoEdgeReplicator?: EchoEdgeReplicator;
|
|
55
56
|
runtimeParams?: DataSpaceManagerRuntimeParams;
|
|
@@ -72,6 +73,7 @@ export declare class DataSpaceManager extends Resource {
|
|
|
72
73
|
private readonly _echoHost;
|
|
73
74
|
private readonly _invitationsManager;
|
|
74
75
|
private readonly _edgeConnection?;
|
|
76
|
+
private readonly _edgeHttpClient?;
|
|
75
77
|
private readonly _edgeFeatures?;
|
|
76
78
|
private readonly _meshReplicator?;
|
|
77
79
|
private readonly _echoEdgeReplicator?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-space-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAA4B,MAAM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,OAAO,CAAC,OAAO,CAAC;IAqBlD,kBAAkB;YA0BV,qBAAqB;IAU7B,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC;IAqBzD,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC;IA6BnE;;;;OAIG;IACG,mBAAmB,CAAC,QAAQ,EAAE,SAAS;IAUhC,+BAA+B,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;YAcxE,eAAe;YAmHf,0BAA0B;IAaxC,OAAO,CAAC,wBAAwB;IAyBhC,OAAO,CAAC,uBAAuB;YAWjB,6BAA6B;YAiB7B,2BAA2B;CAqB1C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Event } from '@dxos/async';
|
|
2
2
|
import type { SpecificCredential } from '@dxos/credentials';
|
|
3
3
|
import { type EchoHost, type DatabaseRoot, type MetadataStore, type Space } from '@dxos/echo-pipeline';
|
|
4
|
-
import type { EdgeConnection } from '@dxos/edge-client';
|
|
4
|
+
import type { EdgeConnection, EdgeHttpClient } from '@dxos/edge-client';
|
|
5
5
|
import { type FeedStore } from '@dxos/feed-store';
|
|
6
6
|
import { type Keyring } from '@dxos/keyring';
|
|
7
7
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -45,6 +45,7 @@ export type DataSpaceParams = {
|
|
|
45
45
|
callbacks?: DataSpaceCallbacks;
|
|
46
46
|
cache?: SpaceCache;
|
|
47
47
|
edgeConnection?: EdgeConnection;
|
|
48
|
+
edgeHttpClient?: EdgeHttpClient;
|
|
48
49
|
edgeFeatures?: Runtime.Client.EdgeFeatures;
|
|
49
50
|
};
|
|
50
51
|
export type CreateEpochOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-space.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAwD,MAA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QAAQ,aAEX;IAED,IAAI,kBAAkB,uBAErB;IAED,IAAI,KAAK,2BAER;IAED,IAAI,mBAAmB,wBAEtB;IAED,IAAI,YAAY,IAAI,YAAY,GAAG,IAAI,CAEtC;IAGD,OAAO,KAAK,cAAc,GAKzB;IAGK,IAAI;YAMI,KAAK;IA0Bb,KAAK;YAIG,MAAM;IA4Bd,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IAI/C,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI;;;IAIlE;;OAEG;IACH,2BAA2B;IAuBrB,sBAAsB;YAyBd,gBAAgB;YAWhB,iCAAiC;YA0BjC,oBAAoB;IAyDlC,OAAO,CAAC,mBAAmB;IAkDrB,gBAAgB,CAAC,OAAO,EAAE,eAAe;IAWzC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IA4C5E,QAAQ;IAWR,UAAU;IAchB,OAAO,CAAC,YAAY,CAElB;CACH;AAED,KAAK,iBAAiB,GAAG;IACvB,UAAU,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC"}
|
|
@@ -23,6 +23,7 @@ export declare class EdgeFeedReplicator extends Resource {
|
|
|
23
23
|
constructor({ messenger, spaceId }: EdgeFeedReplicatorParams);
|
|
24
24
|
protected _open(): Promise<void>;
|
|
25
25
|
protected _close(): Promise<void>;
|
|
26
|
+
private _startReplication;
|
|
26
27
|
private _resetConnection;
|
|
27
28
|
addFeed(feed: FeedWrapper<any>): Promise<void>;
|
|
28
29
|
private _getPushMutex;
|
|
@@ -32,5 +33,6 @@ export declare class EdgeFeedReplicator extends Resource {
|
|
|
32
33
|
private _pushBlocks;
|
|
33
34
|
private _integrateBlocks;
|
|
34
35
|
private _pushBlocksIfNeeded;
|
|
36
|
+
private _createConnectionContext;
|
|
35
37
|
}
|
|
36
38
|
//# sourceMappingURL=edge-feed-replicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-feed-replicator.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/edge-feed-replicator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAW,QAAQ,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAWrD,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,cAAc,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiB;
|
|
1
|
+
{"version":3,"file":"edge-feed-replicator.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/edge-feed-replicator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAW,QAAQ,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAWrD,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,cAAc,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiB;IAG5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IAEnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+D;IAEtF,OAAO,CAAC,cAAc,CAAC,CAAsB;IAC7C,OAAO,CAAC,UAAU,CAAS;IAC3B;;OAEG;IACH,OAAO,CAAC,aAAa,CAAqD;IAE1E;;OAEG;IACH,OAAO,CAAC,UAAU,CAAoD;gBAE1D,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,wBAAwB;cAMnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;cAmCtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKhD,OAAO,CAAC,iBAAiB;YAYX,gBAAgB;IAQxB,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC;IASpC,OAAO,CAAC,aAAa;YAIP,cAAc;YAYd,YAAY;IA0B1B,OAAO,CAAC,UAAU;YAuDJ,WAAW;YA0BX,gBAAgB;YAkBhB,mBAAmB;IAcjC,OAAO,CAAC,wBAAwB;CAgBjC"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { Context } from '@dxos/context';
|
|
1
|
+
import { type Context, Resource } from '@dxos/context';
|
|
2
2
|
import { type CredentialProcessor } from '@dxos/credentials';
|
|
3
|
+
import { type EdgeHttpClient } from '@dxos/edge-client';
|
|
3
4
|
import { type FeedWriter } from '@dxos/feed-store';
|
|
5
|
+
import { type SpaceId } from '@dxos/keys';
|
|
6
|
+
import { type Runtime } from '@dxos/protocols/proto/dxos/config';
|
|
4
7
|
import { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
5
8
|
import { type NotarizationService, type NotarizeRequest } from '@dxos/protocols/proto/dxos/mesh/teleport/notarization';
|
|
6
9
|
import { type ExtensionContext, RpcExtension } from '@dxos/teleport';
|
|
10
|
+
export type NotarizationPluginParams = {
|
|
11
|
+
spaceId: SpaceId;
|
|
12
|
+
edgeClient?: EdgeHttpClient;
|
|
13
|
+
edgeFeatures?: Runtime.Client.EdgeFeatures;
|
|
14
|
+
};
|
|
7
15
|
export type NotarizeParams = {
|
|
8
16
|
/**
|
|
9
17
|
* For cancellation.
|
|
@@ -30,35 +38,52 @@ export type NotarizeParams = {
|
|
|
30
38
|
* @default {@link DEFAULT_SUCCESS_DELAY}
|
|
31
39
|
*/
|
|
32
40
|
successDelay?: number;
|
|
41
|
+
/**
|
|
42
|
+
* A random amount of time before making or retrying an edge request to help prevent large bursts of requests.
|
|
43
|
+
*/
|
|
44
|
+
edgeRetryJitter?: number;
|
|
33
45
|
};
|
|
34
46
|
/**
|
|
35
47
|
* See NotarizationService proto.
|
|
36
48
|
*/
|
|
37
|
-
export declare class NotarizationPlugin implements CredentialProcessor {
|
|
38
|
-
private readonly _ctx;
|
|
49
|
+
export declare class NotarizationPlugin extends Resource implements CredentialProcessor {
|
|
39
50
|
private readonly _extensionOpened;
|
|
40
51
|
private _writer;
|
|
41
52
|
private readonly _extensions;
|
|
42
53
|
private readonly _processedCredentials;
|
|
43
54
|
private readonly _processCredentialsTriggers;
|
|
55
|
+
private readonly _spaceId;
|
|
56
|
+
private readonly _edgeClient;
|
|
57
|
+
constructor(params: NotarizationPluginParams);
|
|
44
58
|
get hasWriter(): boolean;
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
protected _open(): Promise<void>;
|
|
60
|
+
protected _close(): Promise<void>;
|
|
47
61
|
/**
|
|
48
62
|
* Request credentials to be notarized.
|
|
49
63
|
*/
|
|
50
|
-
notarize({ ctx: opCtx, credentials, timeout, retryTimeout, successDelay, }: NotarizeParams): Promise<void>;
|
|
64
|
+
notarize({ ctx: opCtx, credentials, timeout, retryTimeout, successDelay, edgeRetryJitter, }: NotarizeParams): Promise<void>;
|
|
65
|
+
private _tryNotarizeCredentialsWithPeers;
|
|
66
|
+
private _tryNotarizeCredentialsWithEdge;
|
|
51
67
|
/**
|
|
52
68
|
* Called with credentials arriving from the control pipeline.
|
|
53
69
|
*/
|
|
54
70
|
processCredential(credential: Credential): Promise<void>;
|
|
55
71
|
setWriter(writer: FeedWriter<Credential>): void;
|
|
72
|
+
/**
|
|
73
|
+
* The method is used only for adding agent feeds to spaces.
|
|
74
|
+
* When an agent is created we can admit them into all the existing spaces. In case the operation fails
|
|
75
|
+
* this method will fix it on the next space open.
|
|
76
|
+
* Given how rarely this happens there's no need to poll the endpoint.
|
|
77
|
+
*/
|
|
78
|
+
private _notarizePendingEdgeCredentials;
|
|
56
79
|
private _waitUntilProcessed;
|
|
57
80
|
/**
|
|
58
81
|
* Requests from other peers to notarize credentials.
|
|
59
82
|
*/
|
|
60
83
|
private _onNotarize;
|
|
84
|
+
private _notarizeCredentials;
|
|
61
85
|
createExtension(): NotarizationTeleportExtension;
|
|
86
|
+
private _scheduleTimeout;
|
|
62
87
|
}
|
|
63
88
|
export type NotarizationTeleportExtensionParams = {
|
|
64
89
|
onOpen: () => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notarization-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/notarization-plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAmB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"notarization-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/notarization-plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAmB,QAAQ,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,KAAK,mBAAmB,EAAoB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,KAAK,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AiB,CAAC,UAAU,EAAE,UAAU;IAS9C,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC;IAQxC;;;;;OAKG;IACH,OAAO,CAAC,+BAA+B;YA6BzB,mBAAmB;IAOjC;;OAEG;YACW,WAAW;YAOX,oBAAoB;IAclC,eAAe;IAgBf,OAAO,CAAC,gBAAgB;CAczB;AAUD,MAAM,MAAM,mCAAmC,GAAG;IAChD,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD,CAAC;AAEF,qBAAa,6BAA8B,SAAQ,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACrE,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,mCAAmC;cAWzD,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC;IAUjC,MAAM,CAAC,GAAG,EAAE,gBAAgB;IAK5B,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS;CAI/C;AAOD,KAAK,QAAQ,GAAG;IACd,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DXOS_VERSION = "0.6.12-main.
|
|
1
|
+
export declare const DXOS_VERSION = "0.6.12-main.89e9959";
|
|
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.6.12-main.
|
|
3
|
+
"version": "0.6.12-main.89e9959",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -47,48 +47,48 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"cbor-x": "^1.5.4",
|
|
49
49
|
"platform": "^1.3.6",
|
|
50
|
-
"@dxos/async": "0.6.12-main.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/codec-protobuf": "0.6.12-main.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/context": "0.6.12-main.
|
|
56
|
-
"@dxos/crypto": "0.6.12-main.
|
|
57
|
-
"@dxos/credentials": "0.6.12-main.
|
|
58
|
-
"@dxos/debug": "0.6.12-main.
|
|
59
|
-
"@dxos/echo-db": "0.6.12-main.
|
|
60
|
-
"@dxos/echo-pipeline": "0.6.12-main.
|
|
61
|
-
"@dxos/echo-protocol": "0.6.12-main.
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/keyring": "0.6.12-main.
|
|
68
|
-
"@dxos/keys": "0.6.12-main.
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/messaging": "0.6.12-main.
|
|
73
|
-
"@dxos/network-manager": "0.6.12-main.
|
|
74
|
-
"@dxos/node-std": "0.6.12-main.
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/teleport-extension-
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
50
|
+
"@dxos/async": "0.6.12-main.89e9959",
|
|
51
|
+
"@dxos/automerge": "0.6.12-main.89e9959",
|
|
52
|
+
"@dxos/client-protocol": "0.6.12-main.89e9959",
|
|
53
|
+
"@dxos/codec-protobuf": "0.6.12-main.89e9959",
|
|
54
|
+
"@dxos/config": "0.6.12-main.89e9959",
|
|
55
|
+
"@dxos/context": "0.6.12-main.89e9959",
|
|
56
|
+
"@dxos/crypto": "0.6.12-main.89e9959",
|
|
57
|
+
"@dxos/credentials": "0.6.12-main.89e9959",
|
|
58
|
+
"@dxos/debug": "0.6.12-main.89e9959",
|
|
59
|
+
"@dxos/echo-db": "0.6.12-main.89e9959",
|
|
60
|
+
"@dxos/echo-pipeline": "0.6.12-main.89e9959",
|
|
61
|
+
"@dxos/echo-protocol": "0.6.12-main.89e9959",
|
|
62
|
+
"@dxos/feed-store": "0.6.12-main.89e9959",
|
|
63
|
+
"@dxos/edge-client": "0.6.12-main.89e9959",
|
|
64
|
+
"@dxos/echo-schema": "0.6.12-main.89e9959",
|
|
65
|
+
"@dxos/invariant": "0.6.12-main.89e9959",
|
|
66
|
+
"@dxos/indexing": "0.6.12-main.89e9959",
|
|
67
|
+
"@dxos/keyring": "0.6.12-main.89e9959",
|
|
68
|
+
"@dxos/keys": "0.6.12-main.89e9959",
|
|
69
|
+
"@dxos/kv-store": "0.6.12-main.89e9959",
|
|
70
|
+
"@dxos/lock-file": "0.6.12-main.89e9959",
|
|
71
|
+
"@dxos/log": "0.6.12-main.89e9959",
|
|
72
|
+
"@dxos/messaging": "0.6.12-main.89e9959",
|
|
73
|
+
"@dxos/network-manager": "0.6.12-main.89e9959",
|
|
74
|
+
"@dxos/node-std": "0.6.12-main.89e9959",
|
|
75
|
+
"@dxos/protocols": "0.6.12-main.89e9959",
|
|
76
|
+
"@dxos/random-access-storage": "0.6.12-main.89e9959",
|
|
77
|
+
"@dxos/rpc": "0.6.12-main.89e9959",
|
|
78
|
+
"@dxos/teleport": "0.6.12-main.89e9959",
|
|
79
|
+
"@dxos/teleport-extension-object-sync": "0.6.12-main.89e9959",
|
|
80
|
+
"@dxos/teleport-extension-gossip": "0.6.12-main.89e9959",
|
|
81
|
+
"@dxos/timeframe": "0.6.12-main.89e9959",
|
|
82
|
+
"@dxos/tracing": "0.6.12-main.89e9959",
|
|
83
|
+
"@dxos/websocket-rpc": "0.6.12-main.89e9959",
|
|
84
|
+
"@dxos/util": "0.6.12-main.89e9959"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/platform": "^1.3.4",
|
|
88
88
|
"@types/readable-stream": "^2.3.9",
|
|
89
89
|
"get-port-please": "^3.1.1",
|
|
90
|
-
"@dxos/signal": "0.6.12-main.
|
|
91
|
-
"@dxos/test-utils": "0.6.12-main.
|
|
90
|
+
"@dxos/signal": "0.6.12-main.89e9959",
|
|
91
|
+
"@dxos/test-utils": "0.6.12-main.89e9959"
|
|
92
92
|
},
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|
|
@@ -67,7 +67,7 @@ export class TrustedKeySetAuthVerifier {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
if (this._isTrustedKey(credential.issuer)) {
|
|
70
|
-
log('key is
|
|
70
|
+
log('key is trusted -- auth success', { key: credential.issuer });
|
|
71
71
|
return true;
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -81,7 +81,10 @@ export class TrustedKeySetAuthVerifier {
|
|
|
81
81
|
log('auth success', { key: credential.issuer });
|
|
82
82
|
trigger.wake(true);
|
|
83
83
|
} else {
|
|
84
|
-
log('key is not currently in trusted set, waiting...', {
|
|
84
|
+
log('key is not currently in trusted set, waiting...', {
|
|
85
|
+
key: credential.issuer,
|
|
86
|
+
trusted: [...this._params.trustedKeysProvider()],
|
|
87
|
+
});
|
|
85
88
|
}
|
|
86
89
|
});
|
|
87
90
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { EventSubscriptions, scheduleTask, UpdateScheduler } from '@dxos/async';
|
|
6
6
|
import { Stream } from '@dxos/codec-protobuf';
|
|
7
7
|
import { type MemberInfo } from '@dxos/credentials';
|
|
8
|
-
import type
|
|
8
|
+
import { type SpaceManager } from '@dxos/echo-pipeline';
|
|
9
9
|
import { PublicKey } from '@dxos/keys';
|
|
10
10
|
import { type Contact, type ContactBook, type ContactsService } from '@dxos/protocols/proto/dxos/client/services';
|
|
11
11
|
import { ComplexMap, ComplexSet } from '@dxos/util';
|