@dxos/credentials 0.5.9-main.07b4bad → 0.5.9-main.1c1903d
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 +16 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +16 -9
- 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;
|