Skip to content

Commit

Permalink
fix: patch anoncreds and update bifold pkgs (#2025)
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce McMath <[email protected]>
  • Loading branch information
bryce-mcmath authored Jun 20, 2024
1 parent e71f1c6 commit 49029d4
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 48 deletions.
25 changes: 13 additions & 12 deletions .yarn/patches/@credo-ts-anoncreds-npm-0.5.3-9fffe9ad63.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/build/anoncreds-rs/AnonCredsRsHolderService.js b/build/anoncreds-rs/AnonCredsRsHolderService.js
index 36304094b5e75dde1d8538a49e2a9ff1093aca22..bae0068d7fbf2e4876f96e1f32d1f4381f2d3e61 100644
index 36304094b5e75dde1d8538a49e2a9ff1093aca22..bcf3ec4ca67f539fbc9e92d6b68937c7fa647326 100644
--- a/build/anoncreds-rs/AnonCredsRsHolderService.js
+++ b/build/anoncreds-rs/AnonCredsRsHolderService.js
@@ -18,6 +18,7 @@ const utils_1 = require("../utils");
Expand Down Expand Up @@ -28,16 +28,15 @@ index 36304094b5e75dde1d8538a49e2a9ff1093aca22..bae0068d7fbf2e4876f96e1f32d1f438
const anonCredsCredentialRepository = agentContext.dependencyManager.resolve(repository_1.AnonCredsCredentialRepository);
const anonCredsCredentialRecord = await anonCredsCredentialRepository.getByCredentialId(agentContext, options.id);
agentContext.config.logger.warn([
@@ -416,6 +417,8 @@ let AnonCredsRsHolderService = class AnonCredsRsHolderService {
@@ -416,6 +417,7 @@ let AnonCredsRsHolderService = class AnonCredsRsHolderService {
throw new error_1.AnonCredsRsError(`Referent not found in proof request`);
}
const $and = [];
+ const useUnqualifiedIdentifiers = (0, proofRequest_1.proofRequestUsesUnqualifiedIdentifiers)(proofRequest)
+
+ const useUnqualifiedIdentifiers = (0, proofRequest_1.proofRequestUsesUnqualifiedIdentifiers)(proofRequest);
// Make sure the attribute(s) that are requested are present using the marker tag
const attributes = (_b = requestedAttribute.names) !== null && _b !== void 0 ? _b : [requestedAttribute.name];
const attributeQuery = {};
@@ -445,7 +448,7 @@ let AnonCredsRsHolderService = class AnonCredsRsHolderService {
@@ -445,7 +447,7 @@ let AnonCredsRsHolderService = class AnonCredsRsHolderService {
}
const credentialWithMetadata = credentials.map((credentialRecord) => {
return {
Expand All @@ -47,7 +46,7 @@ index 36304094b5e75dde1d8538a49e2a9ff1093aca22..bae0068d7fbf2e4876f96e1f32d1f438
};
});
diff --git a/build/formats/AnonCredsCredentialFormatService.js b/build/formats/AnonCredsCredentialFormatService.js
index 32b00024498dab50a3482df27e6f97671009678e..ab0ba692cad260e902b9a5746e0632f362ef6b30 100644
index 32b00024498dab50a3482df27e6f97671009678e..bd492add83af41486ef9901e8b8ef590264628b3 100644
--- a/build/formats/AnonCredsCredentialFormatService.js
+++ b/build/formats/AnonCredsCredentialFormatService.js
@@ -203,7 +203,7 @@ class AnonCredsCredentialFormatService {
Expand All @@ -59,11 +58,10 @@ index 32b00024498dab50a3482df27e6f97671009678e..ab0ba692cad260e902b9a5746e0632f3
credentialOffer,
credentialRequest,
credentialValues: (0, credential_1.convertAttributesToCredentialValues)(credentialAttributes),
@@ -211,6 +211,19 @@ class AnonCredsCredentialFormatService {
@@ -211,6 +211,17 @@ class AnonCredsCredentialFormatService {
revocationRegistryIndex,
revocationStatusList,
});
+
+ // If the credential is revocable, store the revocation identifiers in the credential record
+ if (credential.rev_reg_id) {
+ credentialRecord.metadata.add<AnonCredsCredentialMetadata>(AnonCredsCredentialMetadataKey, {
Expand All @@ -75,7 +73,6 @@ index 32b00024498dab50a3482df27e6f97671009678e..ab0ba692cad260e902b9a5746e0632f3
+ anonCredsCredentialRevocationId: credentialRevocationId,
+ })
+ }
+
const format = new core_1.CredentialFormatSpec({
attachmentId,
format: ANONCREDS_CREDENTIAL,
Expand Down Expand Up @@ -147,18 +144,21 @@ index ffa72b308239894b65fc796254e5c458299065fe..0702fb0d2a552434f79c0ecdc1343572
return getUnqualifiedSchemaId(namespaceIdentifier, schemaName, schemaVersion);
diff --git a/build/utils/proofRequest.js b/build/utils/proofRequest.js
new file mode 100644
index 0000000000000000000000000000000000000000..0310d8806e11b26ec5a06b287316ebbe200fb939
index 0000000000000000000000000000000000000000..93208de78a7f13d64b756824c725d0b0bf263236
--- /dev/null
+++ b/build/utils/proofRequest.js
@@ -0,0 +1,21 @@
@@ -0,0 +1,24 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.proofRequestUsesUnqualifiedIdentifiers = void 0;
+const indyIdentifiers_1 = require("./indyIdentifiers");
+
+function proofRequestUsesUnqualifiedIdentifiers(proofRequest) {
+ // We assume that if any identifier is unqualified, all of them are unqualified as well
+ return Object.values(proofRequest.requested_attributes).some((attribute) =>
+ return [
+ ...Object.values(proofRequest.requested_attributes),
+ ...Object.values(proofRequest.requested_predicates),
+ ].some((attribute) =>
+ attribute.restrictions?.some(
+ (restriction) =>
+ (restriction.cred_def_id && (0, indyIdentifiers_1.isUnqualifiedCredentialDefinitionId)(restriction.cred_def_id)) ||
Expand All @@ -172,6 +172,7 @@ index 0000000000000000000000000000000000000000..0310d8806e11b26ec5a06b287316ebbe
+ )
+}
+exports.proofRequestUsesUnqualifiedIdentifiers = proofRequestUsesUnqualifiedIdentifiers;
\ No newline at end of file
diff --git a/build/utils/w3cAnonCredsUtils.js b/build/utils/w3cAnonCredsUtils.js
index ffd736f2261e9187b00e471c2ed1b2f4863960b9..6dfb1488a086516b9ffbaa28b454708eb76d49e0 100644
--- a/build/utils/w3cAnonCredsUtils.js
Expand Down
5 changes: 3 additions & 2 deletions PATCH_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
### Patches
#### @credo-ts-anoncreds-npm-0.5.3-9fffe9ad63.patch
Three part patch (can likely be removed after upgrading to 0.5.4) from these three PRs:
Four part patch (can likely be removed after upgrading to 0.5.4) from these four PRs:
- [x] https://github.com/openwallet-foundation/credo-ts/pull/1891
- [x] https://github.com/openwallet-foundation/credo-ts/pull/1887/files
- [x] https://github.com/openwallet-foundation/credo-ts/pull/1887
- [x] https://github.com/openwallet-foundation/credo-ts/pull/1866
- [x] https://github.com/openwallet-foundation/credo-ts/pull/1907

#### @credo-ts-core-npm-0.5.3-39fe4d2bdd.patch
Can likely be removed after upgrading to 0.5.4, from this PR:
Expand Down
4 changes: 2 additions & 2 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ PODS:
- React-jsinspector (0.72.5)
- React-logger (0.72.5):
- glog
- "react-native-attestation (1.0.0-alpha.248+fcb998fb)":
- "react-native-attestation (1.0.0-alpha.252+c1658055)":
- RCT-Folly (= 2021.07.22.00)
- React-Core
- react-native-config (1.5.0):
Expand Down Expand Up @@ -931,7 +931,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: ff70a72027dea5cc7d71cfcc6fad7f599f63987a
React-jsinspector: aef73cbd43b70675f572214d10fa438c89bf11ba
React-logger: 2e4aee3e11b3ec4fa6cfd8004610bbb3b8d6cca4
react-native-attestation: c385daecc5b8ec82a654c69f0b6684884d73e692
react-native-attestation: 9d0ae1765a8939380636c93cabf9e57135cff1d4
react-native-config: 5330c8258265c1e5fdb8c009d2cabd6badd96727
react-native-encrypted-storage: db300a3f2f0aba1e818417c1c0a6be549038deb7
react-native-get-random-values: a6ea6a8a65dc93e96e24a11105b1a9c8cfe1d72a
Expand Down
10 changes: 5 additions & 5 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
"@formatjs/intl-relativetimeformat": "9.3.1",
"@hyperledger/anoncreds-react-native": "0.2.2",
"@hyperledger/aries-askar-react-native": "0.2.1",
"@hyperledger/aries-bifold-core": "1.0.0-alpha.250",
"@hyperledger/aries-bifold-remote-logs": "1.0.0-alpha.250",
"@hyperledger/aries-bifold-verifier": "1.0.0-alpha.250",
"@hyperledger/aries-oca": "1.0.0-alpha.250",
"@hyperledger/aries-react-native-attestation": "1.0.0-alpha.250",
"@hyperledger/aries-bifold-core": "1.0.0-alpha.252",
"@hyperledger/aries-bifold-remote-logs": "1.0.0-alpha.252",
"@hyperledger/aries-bifold-verifier": "1.0.0-alpha.252",
"@hyperledger/aries-oca": "1.0.0-alpha.252",
"@hyperledger/aries-react-native-attestation": "1.0.0-alpha.252",
"@hyperledger/indy-vdr-react-native": "0.2.2",
"@react-native-async-storage/async-storage": "1.15.11",
"@react-native-community/masked-view": "0.1.11",
Expand Down
54 changes: 27 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3378,7 +3378,7 @@ __metadata:

"@credo-ts/anoncreds@patch:@credo-ts/anoncreds@npm%3A0.5.3#~/.yarn/patches/@credo-ts-anoncreds-npm-0.5.3-9fffe9ad63.patch":
version: 0.5.3
resolution: "@credo-ts/anoncreds@patch:@credo-ts/anoncreds@npm%3A0.5.3#~/.yarn/patches/@credo-ts-anoncreds-npm-0.5.3-9fffe9ad63.patch::version=0.5.3&hash=556a5b"
resolution: "@credo-ts/anoncreds@patch:@credo-ts/anoncreds@npm%3A0.5.3#~/.yarn/patches/@credo-ts-anoncreds-npm-0.5.3-9fffe9ad63.patch::version=0.5.3&hash=4ca641"
dependencies:
"@astronautlabs/jsonpath": "npm:^1.1.2"
"@credo-ts/core": "npm:0.5.3"
Expand All @@ -3389,7 +3389,7 @@ __metadata:
reflect-metadata: "npm:^0.1.13"
peerDependencies:
"@hyperledger/anoncreds-shared": ^0.2.2
checksum: d513f874ffd23089a61eeca3627d39b48b99c6aa8bf6f9d12ca840a7852c7df1304d89d1ab298373b381700140f162cce02f1255c638ec9039b8d22c5375fd5f
checksum: 471099ba6b679c40240b054e700b4c0df3f67ce785ac8463857f25c269afe48e279b0d0c7ca427d9e4d13b6c4fb4a5f565ad9cd49185a2bd4c3dc04b070f5ffa
languageName: node
linkType: hard

Expand Down Expand Up @@ -4321,9 +4321,9 @@ __metadata:
languageName: node
linkType: hard

"@hyperledger/aries-bifold-core@npm:1.0.0-alpha.250":
version: 1.0.0-alpha.250
resolution: "@hyperledger/aries-bifold-core@npm:1.0.0-alpha.250"
"@hyperledger/aries-bifold-core@npm:1.0.0-alpha.252":
version: 1.0.0-alpha.252
resolution: "@hyperledger/aries-bifold-core@npm:1.0.0-alpha.252"
peerDependencies:
"@credo-ts/anoncreds": 0.5.3
"@credo-ts/askar": 0.5.3
Expand Down Expand Up @@ -4396,57 +4396,57 @@ __metadata:
uuid: ^9.0.0
bin:
bifold: bin/bifold
checksum: cc6213911fd48e8908faec95e263d0193779963b99387fc3a8b7cdb88d0770ec180f90cba2c734e77d851d14ad16f92c69f4023e18a0ae40f99420ea2df66217
checksum: 586744cfb31d6777144cdd4364641a615329294bf15dfde3a70e615cf01169e762ba9b65ea4d7250df42314a1ad9ebe91877fbd8052c5296d797dc3a994bb277
languageName: node
linkType: hard

"@hyperledger/aries-bifold-remote-logs@npm:1.0.0-alpha.250":
version: 1.0.0-alpha.250
resolution: "@hyperledger/aries-bifold-remote-logs@npm:1.0.0-alpha.250"
"@hyperledger/aries-bifold-remote-logs@npm:1.0.0-alpha.252":
version: 1.0.0-alpha.252
resolution: "@hyperledger/aries-bifold-remote-logs@npm:1.0.0-alpha.252"
peerDependencies:
"@credo-ts/core": 0.5.3
axios: ^1.4.0
buffer: ^6.0.3
react: ^18.2.0
react-native: ^0.72.5
react-native-logs: ^5.1.0
checksum: 9b8ee669689b6427f47819acbfc865101b252fe8e7b78cb0e1ebe15dc51362911643f0d38cecd776eb91675c21359ffb83e685c98e4e7a031ee6e5f12c0569db
checksum: 362bcecd8b325a2091b6330bd1f7252f93c434ba514c54fcd72cf0e794607a3300f8b862f2c09e9c31c3fac17f231d74111d60a055bc7227bba771a5bfad6564
languageName: node
linkType: hard

"@hyperledger/aries-bifold-verifier@npm:1.0.0-alpha.250":
version: 1.0.0-alpha.250
resolution: "@hyperledger/aries-bifold-verifier@npm:1.0.0-alpha.250"
"@hyperledger/aries-bifold-verifier@npm:1.0.0-alpha.252":
version: 1.0.0-alpha.252
resolution: "@hyperledger/aries-bifold-verifier@npm:1.0.0-alpha.252"
peerDependencies:
"@credo-ts/anoncreds": 0.5.3
"@credo-ts/core": 0.5.3
"@credo-ts/react-hooks": ^0.6.0
"@hyperledger/anoncreds-shared": 0.2.2
react: ^18.2.0
checksum: 37ec69c110ae3d5632259b560b85e3a4daeefc888fb7fc8441664934c82731e97020142c7c24beda552d9b3539f652c9b14fbc95710595440e3686cac3a8603d
checksum: 8909cd13feae5309be242a5daabddd21ab74ad3ce298e826e73617cfb25ae4421a2f35eece2fc399ae3a37df9e06d7fdd3a616080da0b5f550076bc809ab2074
languageName: node
linkType: hard

"@hyperledger/aries-oca@npm:1.0.0-alpha.250":
version: 1.0.0-alpha.250
resolution: "@hyperledger/aries-oca@npm:1.0.0-alpha.250"
"@hyperledger/aries-oca@npm:1.0.0-alpha.252":
version: 1.0.0-alpha.252
resolution: "@hyperledger/aries-oca@npm:1.0.0-alpha.252"
dependencies:
"@credo-ts/anoncreds": "npm:0.5.3"
"@credo-ts/core": "npm:0.5.3"
axios: "npm:^1.4.0"
lodash.startcase: "npm:^4.4.0"
react-native-fs: "npm:^2.16.6"
checksum: c4ceef89c1b80798c42022a77bcc04a1834a620136aa9a5b6c464c5c51334e5c9a6f77742219787dcdcf5df4c9243fffce4e1e0e0a54c2b414f571dfdb2bd3a3
checksum: 5570dd68ee94c4360f7229220b14322073306a4e8a285ff83af7cd2128ad1af90517ee8e9d1695343224f43b05448ddddb642867281ec001c0a7472de1fec91f
languageName: node
linkType: hard

"@hyperledger/aries-react-native-attestation@npm:1.0.0-alpha.250":
version: 1.0.0-alpha.250
resolution: "@hyperledger/aries-react-native-attestation@npm:1.0.0-alpha.250"
"@hyperledger/aries-react-native-attestation@npm:1.0.0-alpha.252":
version: 1.0.0-alpha.252
resolution: "@hyperledger/aries-react-native-attestation@npm:1.0.0-alpha.252"
peerDependencies:
react: "*"
react-native: "*"
checksum: 547c95ced0b06a4366187684cd64270d9e4215e41b2e23de0cc734005e9d43606b07217db22c8cbddd988b50ca8a5415228f82f976e183040e3bb87ab86f2cc0
checksum: 16bbb43736ea37d19d8c16abd253c6b1fb1a2b62b823e9426113e97e4acdd84c6ee953e2f3a8de6a117510671f398f6ede1f764395a3f461d72c24e3a6b72cf5
languageName: node
linkType: hard

Expand Down Expand Up @@ -8961,11 +8961,11 @@ __metadata:
"@formatjs/intl-relativetimeformat": "npm:9.3.1"
"@hyperledger/anoncreds-react-native": "npm:0.2.2"
"@hyperledger/aries-askar-react-native": "npm:0.2.1"
"@hyperledger/aries-bifold-core": "npm:1.0.0-alpha.250"
"@hyperledger/aries-bifold-remote-logs": "npm:1.0.0-alpha.250"
"@hyperledger/aries-bifold-verifier": "npm:1.0.0-alpha.250"
"@hyperledger/aries-oca": "npm:1.0.0-alpha.250"
"@hyperledger/aries-react-native-attestation": "npm:1.0.0-alpha.250"
"@hyperledger/aries-bifold-core": "npm:1.0.0-alpha.252"
"@hyperledger/aries-bifold-remote-logs": "npm:1.0.0-alpha.252"
"@hyperledger/aries-bifold-verifier": "npm:1.0.0-alpha.252"
"@hyperledger/aries-oca": "npm:1.0.0-alpha.252"
"@hyperledger/aries-react-native-attestation": "npm:1.0.0-alpha.252"
"@hyperledger/indy-vdr-react-native": "npm:0.2.2"
"@react-native-async-storage/async-storage": "npm:1.15.11"
"@react-native-community/masked-view": "npm:0.1.11"
Expand Down

0 comments on commit 49029d4

Please sign in to comment.