@dxos/credentials 0.7.5-feature-compute.4d9d99a → 0.7.5-labs.35b4b42
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/index.mjs +71 -45
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +79 -54
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +71 -45
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/did.d.ts +7 -0
- package/dist/types/src/did.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/state-machine/space-state-machine.d.ts +0 -1
- package/dist/types/src/state-machine/space-state-machine.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/src/did.ts +27 -0
- package/src/index.ts +1 -0
- package/src/state-machine/space-state-machine.ts +2 -2
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytes":1781,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/seedphrase.ts":{"bytes":2345,"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/passcode.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytes":11260,"imports":[{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytes":3794,"imports":[{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"../credentials/signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytes":3821,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytes":8574,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytes":11553,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytes":25434,"imports":[{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/index.ts":{"bytes":929,"imports":[{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"},{"path":"packages/core/halo/credentials/src/credentials/credential-generator.ts","kind":"import-statement","original":"./credential-generator"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytes":3718,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytes":10470,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/index.ts":{"bytes":703,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/presentations/presentation.ts","kind":"import-statement","original":"./presentation"},{"path":"packages/core/halo/credentials/src/presentations/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytes":6028,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytes":11718,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytes":73642,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytes":21767,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"packages/core/halo/credentials/src/graph/credential-graph.ts","kind":"import-statement","original":"../graph/credential-graph"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytes":37745,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytes":909,"imports":[{"path":"packages/core/halo/credentials/src/state-machine/space-state-machine.ts","kind":"import-statement","original":"./space-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/processor/credential-processor.ts":{"bytes":735,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytes":10680,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytes":5520,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/index.ts":{"bytes":785,"imports":[{"path":"packages/core/halo/credentials/src/processor/credential-processor.ts","kind":"import-statement","original":"./credential-processor"},{"path":"packages/core/halo/credentials/src/processor/device-state-machine.ts","kind":"import-statement","original":"./device-state-machine"},{"path":"packages/core/halo/credentials/src/processor/profile-state-machine.ts","kind":"import-statement","original":"./profile-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/index.ts":{"bytes":1093,"imports":[{"path":"packages/core/halo/credentials/src/invitations.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/core/halo/credentials/src/seedphrase.ts","kind":"import-statement","original":"./seedphrase"},{"path":"packages/core/halo/credentials/src/passcode.ts","kind":"import-statement","original":"./passcode"},{"path":"packages/core/halo/credentials/src/presentations/index.ts","kind":"import-statement","original":"./presentations"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"./credentials"},{"path":"packages/core/halo/credentials/src/state-machine/index.ts","kind":"import-statement","original":"./state-machine"},{"path":"packages/core/halo/credentials/src/processor/index.ts","kind":"import-statement","original":"./processor"}],"format":"esm"}},"outputs":{"packages/core/halo/credentials/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":119426},"packages/core/halo/credentials/dist/lib/node/index.cjs":{"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["CredentialGenerator","DeviceStateMachine","FeedStateMachine","InvitationStateMachine","MemberStateMachine","ProfileStateMachine","SIGNATURE_TYPE_ED25519","SpaceStateMachine","canonicalStringify","checkCredentialType","createAdmissionCredentials","createCancelDelegatedSpaceInvitationCredential","createCredential","createCredentialMessage","createCredentialSignerWithChain","createCredentialSignerWithKey","createDelegatedSpaceInvitationCredential","createDeviceAuthorization","credentialTypeFilter","defaultSecretProvider","defaultSecretValidator","generatePasscode","generateSeedPhrase","getCredentialAssertion","getCredentialProofPayload","getPresentationProofPayload","isValidAuthorizedDeviceCredential","keyPairFromSeedPhrase","signPresentation","verifyChain","verifyCredential","verifyCredentialSignature","verifyPresentation","verifyPresentationChain","verifyPresentationSignature"],"entryPoint":"packages/core/halo/credentials/src/index.ts","inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytesInOutput":126},"packages/core/halo/credentials/src/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/seedphrase.ts":{"bytesInOutput":560},"packages/core/halo/credentials/src/passcode.ts":{"bytesInOutput":178},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytesInOutput":2037},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytesInOutput":733},"packages/core/halo/credentials/src/presentations/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytesInOutput":648},"packages/core/halo/credentials/src/credentials/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytesInOutput":2614},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytesInOutput":1762},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytesInOutput":5630},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytesInOutput":578},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytesInOutput":2306},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytesInOutput":8924},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytesInOutput":1545},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytesInOutput":2764},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytesInOutput":5260},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytesInOutput":18877},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/processor/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytesInOutput":2782},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytesInOutput":1204}},"bytes":60939}}}
|
|
1
|
+
{"inputs":{"packages/core/halo/credentials/src/did.ts":{"bytes":3721,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/invitations.ts":{"bytes":1781,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/seedphrase.ts":{"bytes":2345,"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/passcode.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytes":11260,"imports":[{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytes":3794,"imports":[{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"../credentials/signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytes":3821,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytes":8574,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytes":11553,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytes":25434,"imports":[{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/index.ts":{"bytes":929,"imports":[{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"},{"path":"packages/core/halo/credentials/src/credentials/credential-generator.ts","kind":"import-statement","original":"./credential-generator"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytes":3718,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytes":10470,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/index.ts":{"bytes":703,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/presentations/presentation.ts","kind":"import-statement","original":"./presentation"},{"path":"packages/core/halo/credentials/src/presentations/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytes":6028,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytes":11718,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytes":73642,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytes":21767,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"packages/core/halo/credentials/src/graph/credential-graph.ts","kind":"import-statement","original":"../graph/credential-graph"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytes":38445,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytes":909,"imports":[{"path":"packages/core/halo/credentials/src/state-machine/space-state-machine.ts","kind":"import-statement","original":"./space-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/processor/credential-processor.ts":{"bytes":735,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytes":10680,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytes":5520,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/index.ts":{"bytes":785,"imports":[{"path":"packages/core/halo/credentials/src/processor/credential-processor.ts","kind":"import-statement","original":"./credential-processor"},{"path":"packages/core/halo/credentials/src/processor/device-state-machine.ts","kind":"import-statement","original":"./device-state-machine"},{"path":"packages/core/halo/credentials/src/processor/profile-state-machine.ts","kind":"import-statement","original":"./profile-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/index.ts":{"bytes":1172,"imports":[{"path":"packages/core/halo/credentials/src/did.ts","kind":"import-statement","original":"./did"},{"path":"packages/core/halo/credentials/src/invitations.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/core/halo/credentials/src/seedphrase.ts","kind":"import-statement","original":"./seedphrase"},{"path":"packages/core/halo/credentials/src/passcode.ts","kind":"import-statement","original":"./passcode"},{"path":"packages/core/halo/credentials/src/presentations/index.ts","kind":"import-statement","original":"./presentations"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"./credentials"},{"path":"packages/core/halo/credentials/src/state-machine/index.ts","kind":"import-statement","original":"./state-machine"},{"path":"packages/core/halo/credentials/src/processor/index.ts","kind":"import-statement","original":"./processor"}],"format":"esm"}},"outputs":{"packages/core/halo/credentials/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":121391},"packages/core/halo/credentials/dist/lib/node/index.cjs":{"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["CredentialGenerator","DeviceStateMachine","FeedStateMachine","InvitationStateMachine","MemberStateMachine","ProfileStateMachine","SIGNATURE_TYPE_ED25519","SpaceStateMachine","canonicalStringify","checkCredentialType","createAdmissionCredentials","createCancelDelegatedSpaceInvitationCredential","createCredential","createCredentialMessage","createCredentialSignerWithChain","createCredentialSignerWithKey","createDelegatedSpaceInvitationCredential","createDeviceAuthorization","createDidFromIdentityKey","credentialTypeFilter","defaultSecretProvider","defaultSecretValidator","generatePasscode","generateSeedPhrase","getCredentialAssertion","getCredentialProofPayload","getPresentationProofPayload","isValidAuthorizedDeviceCredential","keyPairFromSeedPhrase","signPresentation","verifyChain","verifyCredential","verifyCredentialSignature","verifyPresentation","verifyPresentationChain","verifyPresentationSignature"],"entryPoint":"packages/core/halo/credentials/src/index.ts","inputs":{"packages/core/halo/credentials/src/did.ts":{"bytesInOutput":656},"packages/core/halo/credentials/src/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/invitations.ts":{"bytesInOutput":126},"packages/core/halo/credentials/src/seedphrase.ts":{"bytesInOutput":560},"packages/core/halo/credentials/src/passcode.ts":{"bytesInOutput":178},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytesInOutput":2052},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytesInOutput":733},"packages/core/halo/credentials/src/presentations/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytesInOutput":648},"packages/core/halo/credentials/src/credentials/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytesInOutput":2632},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytesInOutput":1762},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytesInOutput":5630},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytesInOutput":578},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytesInOutput":2306},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytesInOutput":9529},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytesInOutput":1561},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytesInOutput":2764},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytesInOutput":5260},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytesInOutput":18877},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/processor/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytesInOutput":2782},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytesInOutput":1204}},"bytes":62323}}}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
+
// packages/core/halo/credentials/src/did.ts
|
|
4
|
+
import { subtleCrypto } from "@dxos/crypto";
|
|
5
|
+
import { PublicKey, IdentityDid } from "@dxos/keys";
|
|
6
|
+
import { ComplexMap } from "@dxos/util";
|
|
7
|
+
var IDENTITY_DIDS_CACHE = new ComplexMap(PublicKey.hash);
|
|
8
|
+
var createDidFromIdentityKey = async (identityKey) => {
|
|
9
|
+
const cachedValue = IDENTITY_DIDS_CACHE.get(identityKey);
|
|
10
|
+
if (cachedValue !== void 0) {
|
|
11
|
+
return cachedValue;
|
|
12
|
+
}
|
|
13
|
+
const digest = await subtleCrypto.digest("SHA-256", identityKey.asUint8Array());
|
|
14
|
+
const bytes = new Uint8Array(digest).slice(0, IdentityDid.byteLength);
|
|
15
|
+
const identityDid = IdentityDid.encode(bytes);
|
|
16
|
+
IDENTITY_DIDS_CACHE.set(identityKey, identityDid);
|
|
17
|
+
return identityDid;
|
|
18
|
+
};
|
|
19
|
+
|
|
3
20
|
// packages/core/halo/credentials/src/invitations.ts
|
|
4
21
|
var defaultSecretProvider = async () => Buffer.from("0000");
|
|
5
22
|
var defaultSecretValidator = async (invitation, secret) => true;
|
|
@@ -35,7 +52,7 @@ var generatePasscode = (length = 4) => {
|
|
|
35
52
|
|
|
36
53
|
// packages/core/halo/credentials/src/credentials/signing.ts
|
|
37
54
|
import stableStringify from "json-stable-stringify";
|
|
38
|
-
import { PublicKey } from "@dxos/keys";
|
|
55
|
+
import { PublicKey as PublicKey2 } from "@dxos/keys";
|
|
39
56
|
import { Timeframe } from "@dxos/timeframe";
|
|
40
57
|
import { arrayToBuffer } from "@dxos/util";
|
|
41
58
|
var getCredentialProofPayload = (credential) => {
|
|
@@ -70,7 +87,7 @@ var canonicalStringify = (obj) => stableStringify(obj, {
|
|
|
70
87
|
}
|
|
71
88
|
const original = this[key];
|
|
72
89
|
if (value) {
|
|
73
|
-
if (
|
|
90
|
+
if (PublicKey2.isPublicKey(value)) {
|
|
74
91
|
return value.toHex();
|
|
75
92
|
}
|
|
76
93
|
if (Buffer.isBuffer(value)) {
|
|
@@ -135,9 +152,9 @@ var checkCredentialType = (credential, type) => credential.subject.assertion["@t
|
|
|
135
152
|
var credentialTypeFilter = (type) => (credential) => checkCredentialType(credential, type);
|
|
136
153
|
|
|
137
154
|
// packages/core/halo/credentials/src/credentials/credential-factory.ts
|
|
138
|
-
import { subtleCrypto } from "@dxos/crypto";
|
|
155
|
+
import { subtleCrypto as subtleCrypto2 } from "@dxos/crypto";
|
|
139
156
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
140
|
-
import { PublicKey as
|
|
157
|
+
import { PublicKey as PublicKey3 } from "@dxos/keys";
|
|
141
158
|
|
|
142
159
|
// packages/core/halo/credentials/src/credentials/verifier.ts
|
|
143
160
|
import { verifySignature } from "@dxos/crypto";
|
|
@@ -262,7 +279,7 @@ var createCredential = async ({ signer, issuer, subject, assertion, signingKey,
|
|
|
262
279
|
if (chain) {
|
|
263
280
|
credential.proof.chain = chain;
|
|
264
281
|
}
|
|
265
|
-
credential.id =
|
|
282
|
+
credential.id = PublicKey3.from(await subtleCrypto2.digest("SHA-256", signedPayload));
|
|
266
283
|
return credential;
|
|
267
284
|
};
|
|
268
285
|
var createCredentialMessage = (credential) => {
|
|
@@ -607,22 +624,22 @@ var verifyPresentationSignature = async (presentation, proof) => {
|
|
|
607
624
|
};
|
|
608
625
|
|
|
609
626
|
// packages/core/halo/credentials/src/state-machine/space-state-machine.ts
|
|
610
|
-
import { runInContextAsync } from "@dxos/async";
|
|
627
|
+
import { runInContextAsync, synchronized } from "@dxos/async";
|
|
611
628
|
import { Context } from "@dxos/context";
|
|
612
|
-
import { PublicKey as
|
|
629
|
+
import { PublicKey as PublicKey8 } from "@dxos/keys";
|
|
613
630
|
import { log as log3 } from "@dxos/log";
|
|
614
631
|
import { SpaceMember as SpaceMember3 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
615
|
-
import { Callback as Callback4, ComplexMap as
|
|
632
|
+
import { Callback as Callback4, ComplexMap as ComplexMap6, ComplexSet as ComplexSet3 } from "@dxos/util";
|
|
616
633
|
|
|
617
634
|
// packages/core/halo/credentials/src/state-machine/feed-state-machine.ts
|
|
618
635
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
619
|
-
import { PublicKey as
|
|
620
|
-
import { Callback, ComplexMap } from "@dxos/util";
|
|
636
|
+
import { PublicKey as PublicKey4 } from "@dxos/keys";
|
|
637
|
+
import { Callback, ComplexMap as ComplexMap2 } from "@dxos/util";
|
|
621
638
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/state-machine/feed-state-machine.ts";
|
|
622
639
|
var FeedStateMachine = class {
|
|
623
640
|
constructor(_spaceKey) {
|
|
624
641
|
this._spaceKey = _spaceKey;
|
|
625
|
-
this._feeds = new
|
|
642
|
+
this._feeds = new ComplexMap2(PublicKey4.hash);
|
|
626
643
|
this.onFeedAdmitted = new Callback();
|
|
627
644
|
}
|
|
628
645
|
get feeds() {
|
|
@@ -666,13 +683,13 @@ var FeedStateMachine = class {
|
|
|
666
683
|
};
|
|
667
684
|
|
|
668
685
|
// packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts
|
|
669
|
-
import { PublicKey as
|
|
670
|
-
import { Callback as Callback2, ComplexMap as
|
|
686
|
+
import { PublicKey as PublicKey5 } from "@dxos/keys";
|
|
687
|
+
import { Callback as Callback2, ComplexMap as ComplexMap3, ComplexSet } from "@dxos/util";
|
|
671
688
|
var InvitationStateMachine = class {
|
|
672
689
|
constructor() {
|
|
673
|
-
this._invitations = new
|
|
674
|
-
this._redeemedInvitationCredentialIds = new ComplexSet(
|
|
675
|
-
this._cancelledInvitationCredentialIds = new ComplexSet(
|
|
690
|
+
this._invitations = new ComplexMap3(PublicKey5.hash);
|
|
691
|
+
this._redeemedInvitationCredentialIds = new ComplexSet(PublicKey5.hash);
|
|
692
|
+
this._cancelledInvitationCredentialIds = new ComplexSet(PublicKey5.hash);
|
|
676
693
|
this.onDelegatedInvitation = new Callback2();
|
|
677
694
|
this.onDelegatedInvitationRemoved = new Callback2();
|
|
678
695
|
}
|
|
@@ -737,16 +754,16 @@ var InvitationStateMachine = class {
|
|
|
737
754
|
|
|
738
755
|
// packages/core/halo/credentials/src/state-machine/member-state-machine.ts
|
|
739
756
|
import { invariant as invariant5 } from "@dxos/invariant";
|
|
740
|
-
import { PublicKey as
|
|
757
|
+
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
741
758
|
import { log as log2 } from "@dxos/log";
|
|
742
759
|
import { SpaceMember as SpaceMember2 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
743
|
-
import { ComplexMap as
|
|
760
|
+
import { ComplexMap as ComplexMap5 } from "@dxos/util";
|
|
744
761
|
|
|
745
762
|
// packages/core/halo/credentials/src/graph/credential-graph.ts
|
|
746
763
|
import { invariant as invariant4 } from "@dxos/invariant";
|
|
747
|
-
import { PublicKey as
|
|
764
|
+
import { PublicKey as PublicKey6 } from "@dxos/keys";
|
|
748
765
|
import { log } from "@dxos/log";
|
|
749
|
-
import { Callback as Callback3, ComplexMap as
|
|
766
|
+
import { Callback as Callback3, ComplexMap as ComplexMap4, ComplexSet as ComplexSet2 } from "@dxos/util";
|
|
750
767
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/graph/credential-graph.ts";
|
|
751
768
|
var CredentialGraph = class {
|
|
752
769
|
constructor(_stateHandler) {
|
|
@@ -762,9 +779,9 @@ var CredentialGraph = class {
|
|
|
762
779
|
parents: [],
|
|
763
780
|
children: []
|
|
764
781
|
};
|
|
765
|
-
this._vertexByCredentialId = new
|
|
766
|
-
this._subjectToVertex = new
|
|
767
|
-
this._subjectToState = new
|
|
782
|
+
this._vertexByCredentialId = new ComplexMap4(PublicKey6.hash);
|
|
783
|
+
this._subjectToVertex = new ComplexMap4(PublicKey6.hash);
|
|
784
|
+
this._subjectToState = new ComplexMap4(PublicKey6.hash);
|
|
768
785
|
this.onSubjectStateChanged = new Callback3();
|
|
769
786
|
}
|
|
770
787
|
getSubjectState(subjectId) {
|
|
@@ -931,7 +948,7 @@ var CredentialGraph = class {
|
|
|
931
948
|
}
|
|
932
949
|
_replayFailedPaths(paths, pendingPaths, mergeResult, convergedPaths) {
|
|
933
950
|
paths.push(...mergeResult.replay.map((path) => {
|
|
934
|
-
const stateOverrides = path.stateOverrides ?? new
|
|
951
|
+
const stateOverrides = path.stateOverrides ?? new ComplexMap4(PublicKey6.hash);
|
|
935
952
|
mergeResult.stateOverrides.forEach((value, key) => stateOverrides.set(key, value));
|
|
936
953
|
return {
|
|
937
954
|
...mergeResult.from,
|
|
@@ -1023,12 +1040,12 @@ var CredentialGraph = class {
|
|
|
1023
1040
|
]
|
|
1024
1041
|
},
|
|
1025
1042
|
head: choice,
|
|
1026
|
-
credentials: new ComplexSet2(
|
|
1027
|
-
state: new
|
|
1043
|
+
credentials: new ComplexSet2(PublicKey6.hash, path.credentials),
|
|
1044
|
+
state: new ComplexMap4(PublicKey6.hash, [
|
|
1028
1045
|
...path.state.entries()
|
|
1029
1046
|
]),
|
|
1030
|
-
forkIssuers: new ComplexSet2(
|
|
1031
|
-
forkChangedSubjects: new ComplexSet2(
|
|
1047
|
+
forkIssuers: new ComplexSet2(PublicKey6.hash),
|
|
1048
|
+
forkChangedSubjects: new ComplexSet2(PublicKey6.hash),
|
|
1032
1049
|
stateOverrides: path.stateOverrides
|
|
1033
1050
|
};
|
|
1034
1051
|
paths.push(fork);
|
|
@@ -1040,8 +1057,8 @@ var CredentialGraph = class {
|
|
|
1040
1057
|
*/
|
|
1041
1058
|
_setCurrentState(path) {
|
|
1042
1059
|
const changedSubjects = [];
|
|
1043
|
-
const newStateMap = new
|
|
1044
|
-
const newVertexMap = new
|
|
1060
|
+
const newStateMap = new ComplexMap4(PublicKey6.hash);
|
|
1061
|
+
const newVertexMap = new ComplexMap4(PublicKey6.hash);
|
|
1045
1062
|
for (const [subjectKey, subjectVertex] of path.state.entries()) {
|
|
1046
1063
|
const newState = this._stateHandler.createState(subjectVertex.credential, subjectVertex.assertion);
|
|
1047
1064
|
const prevState = this._subjectToState.get(subjectKey);
|
|
@@ -1149,13 +1166,13 @@ var CredentialGraph = class {
|
|
|
1149
1166
|
[forkPoint.head.id]: []
|
|
1150
1167
|
},
|
|
1151
1168
|
stateOverrides: forkPoint.stateOverrides,
|
|
1152
|
-
credentials: new ComplexSet2(
|
|
1153
|
-
forkIssuers: new ComplexSet2(
|
|
1154
|
-
forkChangedSubjects: new ComplexSet2(
|
|
1169
|
+
credentials: new ComplexSet2(PublicKey6.hash, forkPoint.credentials),
|
|
1170
|
+
forkIssuers: new ComplexSet2(PublicKey6.hash, forkPoint.forkIssuers),
|
|
1171
|
+
forkChangedSubjects: new ComplexSet2(PublicKey6.hash, forkPoint.forkChangedSubjects),
|
|
1155
1172
|
state: forkPoint.state.mapValues((v) => v),
|
|
1156
1173
|
head: paths[0].head
|
|
1157
1174
|
};
|
|
1158
|
-
const subjectToBranch = new
|
|
1175
|
+
const subjectToBranch = new ComplexMap4(PublicKey6.hash);
|
|
1159
1176
|
for (const path of paths) {
|
|
1160
1177
|
log("processing a path", () => ({
|
|
1161
1178
|
choices: toChosenPath(path),
|
|
@@ -1283,10 +1300,10 @@ var CredentialGraph = class {
|
|
|
1283
1300
|
return {
|
|
1284
1301
|
head: this._root,
|
|
1285
1302
|
chosenPath: {},
|
|
1286
|
-
forkIssuers: new ComplexSet2(
|
|
1287
|
-
forkChangedSubjects: new ComplexSet2(
|
|
1288
|
-
state: new
|
|
1289
|
-
credentials: new ComplexSet2(
|
|
1303
|
+
forkIssuers: new ComplexSet2(PublicKey6.hash),
|
|
1304
|
+
forkChangedSubjects: new ComplexSet2(PublicKey6.hash),
|
|
1305
|
+
state: new ComplexMap4(PublicKey6.hash),
|
|
1306
|
+
credentials: new ComplexSet2(PublicKey6.hash)
|
|
1290
1307
|
};
|
|
1291
1308
|
}
|
|
1292
1309
|
};
|
|
@@ -1302,7 +1319,7 @@ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/
|
|
|
1302
1319
|
var MemberStateMachine = class {
|
|
1303
1320
|
constructor(_spaceKey) {
|
|
1304
1321
|
this._spaceKey = _spaceKey;
|
|
1305
|
-
this._memberProfiles = new
|
|
1322
|
+
this._memberProfiles = new ComplexMap5(PublicKey7.hash);
|
|
1306
1323
|
this._hashgraph = new CredentialGraph(this);
|
|
1307
1324
|
this.onMemberRoleChanged = this._hashgraph.onSubjectStateChanged;
|
|
1308
1325
|
}
|
|
@@ -1444,6 +1461,12 @@ var MemberStateMachine = class {
|
|
|
1444
1461
|
};
|
|
1445
1462
|
|
|
1446
1463
|
// packages/core/halo/credentials/src/state-machine/space-state-machine.ts
|
|
1464
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
1465
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1466
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1467
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1468
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1469
|
+
}
|
|
1447
1470
|
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/state-machine/space-state-machine.ts";
|
|
1448
1471
|
var SpaceStateMachine = class {
|
|
1449
1472
|
constructor(_spaceKey) {
|
|
@@ -1452,8 +1475,8 @@ var SpaceStateMachine = class {
|
|
|
1452
1475
|
this._feeds = new FeedStateMachine(this._spaceKey);
|
|
1453
1476
|
this._invitations = new InvitationStateMachine();
|
|
1454
1477
|
this._credentials = [];
|
|
1455
|
-
this._credentialsById = new
|
|
1456
|
-
this._processedCredentials = new ComplexSet3(
|
|
1478
|
+
this._credentialsById = new ComplexMap6(PublicKey8.hash);
|
|
1479
|
+
this._processedCredentials = new ComplexSet3(PublicKey8.hash);
|
|
1457
1480
|
this._credentialProcessors = [];
|
|
1458
1481
|
this.onCredentialProcessed = new Callback4();
|
|
1459
1482
|
this.onMemberRoleChanged = this._members.onMemberRoleChanged;
|
|
@@ -1510,7 +1533,6 @@ var SpaceStateMachine = class {
|
|
|
1510
1533
|
/**
|
|
1511
1534
|
* @param credential Message to process.
|
|
1512
1535
|
* @param fromFeed Key of the feed where this credential is recorded.
|
|
1513
|
-
* @synchronized
|
|
1514
1536
|
*/
|
|
1515
1537
|
async process(credential, { sourceFeed, skipVerification }) {
|
|
1516
1538
|
if (credential.id && this._processedCredentials.has(credential.id)) {
|
|
@@ -1674,6 +1696,9 @@ var SpaceStateMachine = class {
|
|
|
1674
1696
|
return role === SpaceMember3.Role.EDITOR || role === SpaceMember3.Role.ADMIN || role === SpaceMember3.Role.OWNER;
|
|
1675
1697
|
}
|
|
1676
1698
|
};
|
|
1699
|
+
_ts_decorate([
|
|
1700
|
+
synchronized
|
|
1701
|
+
], SpaceStateMachine.prototype, "process", null);
|
|
1677
1702
|
var CredentialConsumer = class {
|
|
1678
1703
|
constructor(processor, _onOpen, _onClose) {
|
|
1679
1704
|
this.processor = processor;
|
|
@@ -1708,14 +1733,14 @@ var CredentialConsumer = class {
|
|
|
1708
1733
|
// packages/core/halo/credentials/src/processor/device-state-machine.ts
|
|
1709
1734
|
import { Trigger } from "@dxos/async";
|
|
1710
1735
|
import { invariant as invariant6 } from "@dxos/invariant";
|
|
1711
|
-
import { PublicKey as
|
|
1736
|
+
import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
1712
1737
|
import { log as log4 } from "@dxos/log";
|
|
1713
|
-
import { ComplexMap as
|
|
1738
|
+
import { ComplexMap as ComplexMap7 } from "@dxos/util";
|
|
1714
1739
|
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/processor/device-state-machine.ts";
|
|
1715
1740
|
var DeviceStateMachine = class {
|
|
1716
1741
|
constructor(_params) {
|
|
1717
1742
|
this._params = _params;
|
|
1718
|
-
this.authorizedDeviceKeys = new
|
|
1743
|
+
this.authorizedDeviceKeys = new ComplexMap7(PublicKey9.hash);
|
|
1719
1744
|
this.deviceChainReady = new Trigger();
|
|
1720
1745
|
}
|
|
1721
1746
|
async processCredential(credential) {
|
|
@@ -1848,6 +1873,7 @@ export {
|
|
|
1848
1873
|
createCredentialSignerWithKey,
|
|
1849
1874
|
createDelegatedSpaceInvitationCredential,
|
|
1850
1875
|
createDeviceAuthorization,
|
|
1876
|
+
createDidFromIdentityKey,
|
|
1851
1877
|
credentialTypeFilter,
|
|
1852
1878
|
defaultSecretProvider,
|
|
1853
1879
|
defaultSecretValidator,
|