@icure/api 5.0.11 → 5.0.14
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/icc-api/model/AuthenticationResponse.d.ts +3 -0
- package/icc-api/model/AuthenticationResponse.js.map +1 -1
- package/icc-x-api/icc-crypto-x-api.js +8 -6
- package/icc-x-api/icc-crypto-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.js +10 -2
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationResponse.js","sourceRoot":"","sources":["../../../icc-api/model/AuthenticationResponse.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,MAAa,sBAAsB;IACjC,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAA8B,EAAE,IAAI,CAAC,CAAA;IACrD,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthenticationResponse.js","sourceRoot":"","sources":["../../../icc-api/model/AuthenticationResponse.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,MAAa,sBAAsB;IACjC,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAA8B,EAAE,IAAI,CAAC,CAAA;IACrD,CAAC;CASF;AAZD,wDAYC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\n\nexport class AuthenticationResponse {\n constructor(json: JSON | any) {\n Object.assign(this as AuthenticationResponse, json)\n }\n\n groupId?: string\n userId?: string\n dataOwnerId?: string\n healthcarePartyId?: string\n reason?: string\n successful?: boolean\n username?: string\n}\n"]}
|
|
@@ -56,7 +56,6 @@ class IccCryptoXApi {
|
|
|
56
56
|
emptyHcpCache(hcpartyId) {
|
|
57
57
|
delete this.hcPartyKeysRequestsCache[hcpartyId];
|
|
58
58
|
delete this.dataOwnerCache[hcpartyId];
|
|
59
|
-
delete this.dataOwnerCache[hcpartyId];
|
|
60
59
|
}
|
|
61
60
|
/**
|
|
62
61
|
* Gets all delegate encrypted HcParty keys of the delegate with the given `delegateHcPartyId`, and for each key the delegator id
|
|
@@ -574,7 +573,10 @@ class IccCryptoXApi {
|
|
|
574
573
|
const [publicKeyFingerprint, encryptedAesExchangeKey] = candidates[candidates.findIndex(([k, v]) => publicKeys.some((pk) => pk.endsWith(k)))];
|
|
575
574
|
return Object.assign(Object.assign({}, map), { [e[0]]: { [publicKeyFingerprint]: encryptedAesExchangeKey } });
|
|
576
575
|
}, {});
|
|
577
|
-
return !owner.publicKey ||
|
|
576
|
+
return !owner.publicKey ||
|
|
577
|
+
mapOfAesExchangeKeys[owner.publicKey] ||
|
|
578
|
+
!((_b = owner.hcPartyKeys) === null || _b === void 0 ? void 0 : _b[delegateId]) ||
|
|
579
|
+
publicKeys.find((p) => p == owner.publicKey) == undefined
|
|
578
580
|
? mapOfAesExchangeKeys
|
|
579
581
|
: Object.assign(Object.assign({}, mapOfAesExchangeKeys), { [owner.publicKey]: { [owner.publicKey.slice(-32)]: owner.hcPartyKeys[delegateId][0] } });
|
|
580
582
|
});
|
|
@@ -703,9 +705,9 @@ class IccCryptoXApi {
|
|
|
703
705
|
this.throwDetailedExceptionForInvalidParameter('child.id', child.id, 'addDelegationsAndEncryptionKeys', arguments);
|
|
704
706
|
return (secretDelegationKey
|
|
705
707
|
? this.extendedDelegationsAndCryptedForeignKeys(child, parent, ownerId, delegateId, secretDelegationKey)
|
|
706
|
-
: Promise.resolve({ delegations: {}, cryptedForeignKeys: {} }))
|
|
708
|
+
: Promise.resolve({ modifiedObject: child, delegations: {}, cryptedForeignKeys: {}, secretId: null }))
|
|
707
709
|
.then((extendedChildObjectSPKsAndCFKs) => secretEncryptionKey
|
|
708
|
-
? this.appendEncryptionKeys(
|
|
710
|
+
? this.appendEncryptionKeys(extendedChildObjectSPKsAndCFKs.modifiedObject, ownerId, delegateId, secretEncryptionKey).then(
|
|
709
711
|
//TODO: extendedDelegationsAndCryptedForeignKeys and appendEncryptionKeys can be done in parallel
|
|
710
712
|
(extendedChildObjectEKs) => ({
|
|
711
713
|
extendedSPKsAndCFKs: extendedChildObjectSPKsAndCFKs,
|
|
@@ -716,7 +718,7 @@ class IccCryptoXApi {
|
|
|
716
718
|
extendedEKs: { encryptionKeys: {} },
|
|
717
719
|
}))
|
|
718
720
|
.then(({ extendedSPKsAndCFKs: extendedChildObjectSPKsAndCFKs, extendedEKs: extendedChildObjectEKs }) => {
|
|
719
|
-
return _.assign(
|
|
721
|
+
return _.assign(extendedChildObjectSPKsAndCFKs.modifiedObject, {
|
|
720
722
|
// Conservative version ... We might want to be more aggressive with the deduplication of keys
|
|
721
723
|
// For each delegate, we are going to concatenate to the src (the new delegations), the object in dest (the current delegations)
|
|
722
724
|
// for which we do not find an equivalent delegation (same delegator, same delegate)
|
|
@@ -1361,7 +1363,7 @@ class IccCryptoXApi {
|
|
|
1361
1363
|
if (!selectedPublicKey) {
|
|
1362
1364
|
throw new Error(`Invalid owner, no public key, keypairs have not be set for ${ownerId}`);
|
|
1363
1365
|
}
|
|
1364
|
-
if ((owner.hcPartyKeys || {})[delegateId] ||
|
|
1366
|
+
if (((owner.hcPartyKeys || {})[delegateId] && owner.publicKey && availablePublicKeysFingerprints.includes(owner.publicKey.slice(-32))) ||
|
|
1365
1367
|
Object.values(owner.aesExchangeKeys || {}).some((x) => x[delegateId] && Object.keys(x[delegateId]).some((k) => availablePublicKeysFingerprints.includes(k)))) {
|
|
1366
1368
|
return owner;
|
|
1367
1369
|
}
|