@dxos/credentials 0.5.9-main.bdf733d → 0.5.9-main.bf3bb8f
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 +20 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +20 -10
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/presentations/signing.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/presentations/signing.ts +19 -7
- package/src/presentations/verifier.test.ts +1 -0
|
@@ -87,15 +87,7 @@ var truncateKey = (key) => {
|
|
|
87
87
|
// packages/core/halo/credentials/src/presentations/signing.ts
|
|
88
88
|
var getPresentationProofPayload = (credentials, proof) => {
|
|
89
89
|
const copy = {
|
|
90
|
-
credentials: credentials.map((credential) =>
|
|
91
|
-
const copy2 = {
|
|
92
|
-
...credential
|
|
93
|
-
};
|
|
94
|
-
if (copy2.parentCredentialIds?.length === 0) {
|
|
95
|
-
delete copy2.parentCredentialIds;
|
|
96
|
-
}
|
|
97
|
-
return copy2;
|
|
98
|
-
}),
|
|
90
|
+
credentials: credentials.map((credential) => removeEmptyParentCredentialIds(credential)),
|
|
99
91
|
proof: {
|
|
100
92
|
...proof,
|
|
101
93
|
value: new Uint8Array(),
|
|
@@ -104,6 +96,21 @@ var getPresentationProofPayload = (credentials, proof) => {
|
|
|
104
96
|
};
|
|
105
97
|
return Buffer.from(canonicalStringify(copy));
|
|
106
98
|
};
|
|
99
|
+
var removeEmptyParentCredentialIds = (credential) => {
|
|
100
|
+
const copy = {
|
|
101
|
+
...credential,
|
|
102
|
+
proof: credential.proof ? {
|
|
103
|
+
...credential.proof,
|
|
104
|
+
chain: credential.proof.chain ? {
|
|
105
|
+
credential: removeEmptyParentCredentialIds(credential.proof.chain.credential)
|
|
106
|
+
} : void 0
|
|
107
|
+
} : void 0
|
|
108
|
+
};
|
|
109
|
+
if (copy.parentCredentialIds?.length === 0) {
|
|
110
|
+
delete copy.parentCredentialIds;
|
|
111
|
+
}
|
|
112
|
+
return copy;
|
|
113
|
+
};
|
|
107
114
|
|
|
108
115
|
// packages/core/halo/credentials/src/credentials/assertions.ts
|
|
109
116
|
var getCredentialAssertion = (credential) => credential.subject.assertion;
|
|
@@ -1655,7 +1662,10 @@ var CredentialConsumer = class {
|
|
|
1655
1662
|
this.processor = processor;
|
|
1656
1663
|
this._onOpen = _onOpen;
|
|
1657
1664
|
this._onClose = _onClose;
|
|
1658
|
-
this._ctx = new Context(
|
|
1665
|
+
this._ctx = new Context(void 0, {
|
|
1666
|
+
F: __dxlog_file5,
|
|
1667
|
+
L: 275
|
|
1668
|
+
});
|
|
1659
1669
|
this._isReadyForLiveCredentials = false;
|
|
1660
1670
|
}
|
|
1661
1671
|
/**
|