Skip to content

Commit 96989fe

Browse files
authored
feat(deps): upgrade proxy and credo packages, patches, ledger (#29)
Signed-off-by: Bryce McMath <bryce.j.mcmath@gmail.com>
1 parent ebb73e3 commit 96989fe

8 files changed

+458
-811
lines changed

.github/workflows/main.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ env:
1212

1313
jobs:
1414
lint:
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-22.04
1616
name: Linting
1717
steps:
1818
- uses: actions/checkout@v4
1919

2020
- uses: actions/setup-python@v4
2121
with:
22-
python-version: '3.7.1'
22+
python-version: '3.10'
2323

2424
- name: Setup NodeJS
2525
uses: actions/setup-node@v4
2626
with:
27-
node-version: '18'
27+
node-version: '20'
2828

2929
- name: Install dependencies
3030
run: |
@@ -40,18 +40,18 @@ jobs:
4040
yarn lint:check
4141
4242
test:
43-
runs-on: ubuntu-20.04
43+
runs-on: ubuntu-22.04
4444
name: Testing
4545
steps:
4646
- uses: actions/checkout@v4
4747

4848
- uses: actions/setup-python@v4
4949
with:
50-
python-version: '3.7.1'
50+
python-version: '3.10'
5151

5252
- uses: actions/setup-node@v4
5353
with:
54-
node-version: '18'
54+
node-version: '20'
5555

5656
- name: Install dependencies
5757
run: |
@@ -73,7 +73,7 @@ jobs:
7373
build:
7474
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
7575
needs: [lint, test]
76-
runs-on: ubuntu-20.04
76+
runs-on: ubuntu-22.04
7777
permissions:
7878
contents: read
7979
packages: write
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/build/utils/proofRequest.js b/build/utils/proofRequest.js
2+
index f4ce51a890f0ac41ed1d9806f0350a2114890625..550fa2acb0c91a47cf47f743e0780955ccf8f12d 100644
3+
--- a/build/utils/proofRequest.js
4+
+++ b/build/utils/proofRequest.js
5+
@@ -7,12 +7,27 @@ function proofRequestUsesUnqualifiedIdentifiers(proofRequest) {
6+
return [
7+
...Object.values(proofRequest.requested_attributes),
8+
...Object.values(proofRequest.requested_predicates),
9+
- ].some((attribute) => attribute.restrictions?.some((restriction) => (restriction.cred_def_id && (0, indyIdentifiers_1.isUnqualifiedCredentialDefinitionId)(restriction.cred_def_id)) ||
10+
- (restriction.schema_id && (0, indyIdentifiers_1.isUnqualifiedSchemaId)(restriction.schema_id)) ||
11+
- (restriction.issuer_did && (0, indyIdentifiers_1.isUnqualifiedIndyDid)(restriction.issuer_did)) ||
12+
- (restriction.issuer_id && (0, indyIdentifiers_1.isUnqualifiedIndyDid)(restriction.issuer_id)) ||
13+
- (restriction.schema_issuer_did && (0, indyIdentifiers_1.isUnqualifiedIndyDid)(restriction.schema_issuer_did)) ||
14+
- (restriction.schema_issuer_id && (0, indyIdentifiers_1.isUnqualifiedIndyDid)(restriction.schema_issuer_id)) ||
15+
- (restriction.rev_reg_id && (0, indyIdentifiers_1.isUnqualifiedRevocationRegistryId)(restriction.rev_reg_id))));
16+
+ ].some((attribute) => {
17+
+ var _a;
18+
+ return (_a = attribute.restrictions) === null || _a === void 0 ? void 0 : _a.some((restriction) => (
19+
+ // no qualified identifiers
20+
+ !restriction.cred_def_id &&
21+
+ !restriction.schema_id &&
22+
+ !restriction.issuer_did &&
23+
+ !restriction.issuer_id &&
24+
+ !restriction.schema_issuer_did &&
25+
+ !restriction.schema_issuer_id &&
26+
+ !restriction.rev_reg_id
27+
+ ) ||
28+
+ // any unqualified identifier
29+
+ (restriction.cred_def_id && (0, indyIdentifiers_1.isUnqualifiedCredentialDefinitionId)(restriction.cred_def_id)) ||
30+
+ (restriction.schema_id && (0, indyIdentifiers_1.isUnqualifiedSchemaId)(restriction.schema_id)) ||
31+
+ (restriction.issuer_did && (0, indyIdentifiers_1.isUnqualifiedIndyDid)(restriction.issuer_did)) ||
32+
+ (restriction.issuer_id && (0, indyIdentifiers_1.isUnqualifiedIndyDid)(restriction.issuer_id)) ||
33+
+ (restriction.schema_issuer_did && (0, indyIdentifiers_1.isUnqualifiedIndyDid)(restriction.schema_issuer_did)) ||
34+
+ (restriction.schema_issuer_id && (0, indyIdentifiers_1.isUnqualifiedIndyDid)(restriction.schema_issuer_id)) ||
35+
+ (restriction.rev_reg_id && (0, indyIdentifiers_1.isUnqualifiedRevocationRegistryId)(restriction.rev_reg_id))
36+
+ )
37+
+ });
38+
}
39+
//# sourceMappingURL=proofRequest.js.map
40+
\ No newline at end of file
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
diff --git a/build/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.js b/build/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.js
2+
index 55686de9c2bc38ef66eb59862bbac8d110cb242e..ebf8278aa296d9f1dc45763d6f054b2ea6423dd9 100644
3+
--- a/build/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.js
4+
+++ b/build/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.js
5+
@@ -48,22 +48,57 @@ let RevocationNotificationService = class RevocationNotificationService {
6+
},
7+
],
8+
};
9+
- this.logger.trace(`Getting record by query for revocation notification:`, query);
10+
- const credentialRecord = await this.credentialRepository.getSingleByQuery(agentContext, query);
11+
- credentialRecord.revocationNotification = new RevocationNotification_1.RevocationNotification(comment);
12+
- await this.credentialRepository.update(agentContext, credentialRecord);
13+
+ this.logger.trace(`Getting Credential Exchange record by query for revocation notification:`, query)
14+
+ let credentialExchangeRecord = await this.credentialRepository.findSingleByQuery(agentContext, query)
15+
+
16+
+ if (!credentialExchangeRecord) {
17+
+ const w3cCredentialQuery = {
18+
+ $or: [
19+
+ {
20+
+ anonCredsRevocationRegistryId,
21+
+ anonCredsCredentialRevocationId,
22+
+ },
23+
+ {
24+
+ anonCredsUnqualifiedRevocationRegistryId: anonCredsRevocationRegistryId,
25+
+ anonCredsCredentialRevocationId,
26+
+ },
27+
+ ],
28+
+ }
29+
+ this.logger.trace(
30+
+ `Credential Exchange Record not found. Getting W3C credential record by query for revocation notification:`,
31+
+ w3cCredentialQuery
32+
+ )
33+
+
34+
+ const w3cCredentialRepository = agentContext.dependencyManager.resolve(vc_1.W3cCredentialRepository)
35+
+ const w3cCredentialRecord = await w3cCredentialRepository.getSingleByQuery(agentContext, w3cCredentialQuery)
36+
+
37+
+ // Find credential exchange record associated with this credential
38+
+ credentialExchangeRecord =
39+
+ (await this.credentialRepository.getAll(agentContext)).find((record) =>
40+
+ record.credentials.find((item) => item.credentialRecordId === w3cCredentialRecord.id)
41+
+ ) ?? null
42+
+ }
43+
+
44+
+ if (!credentialExchangeRecord) {
45+
+ throw new CredoError_1.CredoError(
46+
+ `No associated Credential Exchange record found for revocation id ${anonCredsCredentialRevocationId}`
47+
+ )
48+
+ }
49+
+
50+
+ credentialExchangeRecord.revocationNotification = new RevocationNotification_1.RevocationNotification(comment);
51+
+ await this.credentialRepository.update(agentContext, credentialExchangeRecord);
52+
this.logger.trace('Emitting RevocationNotificationReceivedEvent');
53+
this.eventEmitter.emit(agentContext, {
54+
type: CredentialEvents_1.CredentialEventTypes.RevocationNotificationReceived,
55+
payload: {
56+
// Clone record to prevent mutations after emitting event.
57+
- credentialRecord: credentialRecord.clone(),
58+
+ credentialRecord: credentialExchangeRecord.clone(),
59+
},
60+
});
61+
}
62+
/**
63+
* Process a received {@link V1RevocationNotificationMessage}. This will create a
64+
- * {@link RevocationNotification} and store it in the corresponding {@link CredentialRecord}
65+
+ * {@link RevocationNotification} and store it in the corresponding {@link CredentialExchangeRecord}
66+
*
67+
* @param messageContext message context of RevocationNotificationMessageV1
68+
*/
69+
@@ -102,7 +137,7 @@ let RevocationNotificationService = class RevocationNotificationService {
70+
}
71+
/**
72+
* Process a received {@link V2RevocationNotificationMessage}. This will create a
73+
- * {@link RevocationNotification} and store it in the corresponding {@link CredentialRecord}
74+
+ * {@link RevocationNotification} and store it in the corresponding {@link CredentialExchangeRecord}
75+
*
76+
* @param messageContext message context of RevocationNotificationMessageV2
77+
*/
78+
diff --git a/build/modules/dif-presentation-exchange/DifPresentationExchangeService.js b/build/modules/dif-presentation-exchange/DifPresentationExchangeService.js
79+
index f1723e774dc337b8ceae11cf5765d222fd07ea24..9c5db89eec796e1df88e77104b282d22c3b8f4b4 100644
80+
--- a/build/modules/dif-presentation-exchange/DifPresentationExchangeService.js
81+
+++ b/build/modules/dif-presentation-exchange/DifPresentationExchangeService.js
82+
@@ -177,7 +177,18 @@ let DifPresentationExchangeService = class DifPresentationExchangeService {
83+
presentationSubmission.descriptor_map.push(...descriptorMap);
84+
});
85+
return {
86+
- verifiablePresentations: verifiablePresentationResultsWithFormat.flatMap((resultWithFormat) => resultWithFormat.verifiablePresentationResult.verifiablePresentations.map((vp) => (0, utils_2.getVerifiablePresentationFromEncoded)(agentContext, vp))),
87+
+ verifiablePresentations: verifiablePresentationResultsWithFormat.flatMap((resultWithFormat) => {
88+
+ if (resultWithFormat.verifiablePresentationResult.verifiablePresentations) {
89+
+ return resultWithFormat.verifiablePresentationResult.verifiablePresentations.map((vp) =>
90+
+ (0, utils_2.getVerifiablePresentationFromEncoded)(agentContext, vp)
91+
+ )
92+
+ } else {
93+
+ return (0, utils_2.getVerifiablePresentationFromEncoded)(
94+
+ agentContext,
95+
+ resultWithFormat.verifiablePresentationResult.verifiablePresentation
96+
+ )
97+
+ }
98+
+ }),
99+
presentationSubmission,
100+
presentationSubmissionLocation: verifiablePresentationResultsWithFormat[0].verifiablePresentationResult.presentationSubmissionLocation,
101+
};
102+
diff --git a/build/transport/WsOutboundTransport.js b/build/transport/WsOutboundTransport.js
103+
index ab9df20f9fedc4def4f486b9431ac669e899e609..ed898fd92d4a18d0110a77345687f9c1eecebf7b 100644
104+
--- a/build/transport/WsOutboundTransport.js
105+
+++ b/build/transport/WsOutboundTransport.js
106+
@@ -43,7 +43,16 @@ class WsOutboundTransport {
107+
this.transportTable.forEach((socket) => {
108+
socket.removeEventListener('message', this.handleMessageEvent);
109+
if (socket.readyState !== this.WebSocketClass.CLOSED) {
110+
- stillOpenSocketClosingPromises.push(new Promise((resolve) => socket.once('close', resolve)));
111+
+ stillOpenSocketClosingPromises.push(
112+
+ new Promise((resolve) => {
113+
+ const closeHandler = () => {
114+
+ socket.removeEventListener('close', closeHandler)
115+
+ resolve()
116+
+ }
117+
+
118+
+ socket.addEventListener('close', closeHandler)
119+
+ })
120+
+ );
121+
socket.close();
122+
}
123+
});
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/build/anoncreds/utils/transform.js b/build/anoncreds/utils/transform.js
2+
index 3c9de91bd269b61d1654335b26f5b5cc815ae03b..da9de37135ee95486fd20f015968cb9e06d3b292 100644
3+
--- a/build/anoncreds/utils/transform.js
4+
+++ b/build/anoncreds/utils/transform.js
5+
@@ -12,7 +12,7 @@ function anonCredsRevocationStatusListFromIndyVdr(revocationRegistryDefinitionId
6+
// Check whether the highest delta index is supported in the `maxCredNum` field of the
7+
// revocation registry definition. This will likely also be checked on other levels as well
8+
// by the ledger or the indy-vdr library itself
9+
- if (Math.max(...delta.issued, ...delta.revoked) >= revocationRegistryDefinition.value.maxCredNum) {
10+
+ if (Math.max(...delta.issued, ...delta.revoked) > revocationRegistryDefinition.value.maxCredNum) {
11+
throw new core_1.CredoError(`Highest delta index '${Math.max(...delta.issued, ...delta.revoked)}' is too large for the Revocation registry maxCredNum '${revocationRegistryDefinition.value.maxCredNum}' `);
12+
}
13+
// 0 means unrevoked, 1 means revoked
14+
diff --git a/build/pool/IndyVdrPool.js b/build/pool/IndyVdrPool.js
15+
index 7c157d6754dcba7526100f67dbed3c86b335b0cc..56437364edcb3d16e998fb4766d7b14cae63430f 100644
16+
--- a/build/pool/IndyVdrPool.js
17+
+++ b/build/pool/IndyVdrPool.js
18+
@@ -17,7 +17,7 @@ class IndyVdrPool {
19+
}
20+
connect() {
21+
if (this._pool) {
22+
- throw new error_1.IndyVdrError('Cannot connect to pool, already connected.');
23+
+ return;
24+
}
25+
this._pool = new indy_vdr_shared_1.PoolCreate({
26+
parameters: {

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Setup
2-
FROM node:18-buster AS base
2+
FROM node:20-buster AS base
33

44
# Setup env variable for yarn
55
ENV YARN_VERSION=4.3.1
66

7-
# Update dependencies, add python to the base image, install and use yarn 4.x
7+
# Update dependencies, install and use yarn 4.x
88
RUN apt-get update && \
9-
apt-get install python3=3.7.3-1 && \
109
corepack enable && \
1110
corepack prepare yarn@${YARN_VERSION}
1211

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@
2222
"test:e2e": "jest --config ./test/jest-e2e.json"
2323
},
2424
"dependencies": {
25-
"@credo-ts/anoncreds": "0.5.11",
26-
"@credo-ts/askar": "0.5.11",
27-
"@credo-ts/core": "0.5.11",
28-
"@credo-ts/indy-vdr": "0.5.11",
29-
"@credo-ts/node": "0.5.11",
25+
"@credo-ts/anoncreds": "0.5.15",
26+
"@credo-ts/askar": "0.5.15",
27+
"@credo-ts/core": "0.5.15",
28+
"@credo-ts/indy-vdr": "0.5.15",
29+
"@credo-ts/node": "0.5.15",
3030
"@hyperledger/anoncreds-nodejs": "0.2.4",
3131
"@hyperledger/anoncreds-shared": "0.2.4",
3232
"@hyperledger/aries-askar-nodejs": "0.2.3",
3333
"@hyperledger/aries-askar-shared": "0.2.3",
34-
"@hyperledger/indy-vdr-nodejs": "patch:@hyperledger/indy-vdr-nodejs@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-nodejs-npm-0.2.2-2e02c2a0aa.patch",
35-
"@hyperledger/indy-vdr-shared": "patch:@hyperledger/indy-vdr-shared@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-shared-npm-0.2.2-b989282fc6.patch",
34+
"@hyperledger/indy-vdr-nodejs": "0.2.2",
35+
"@hyperledger/indy-vdr-shared": "0.2.2",
3636
"@nestjs/common": "^10.3.9",
3737
"@nestjs/core": "^10.3.9",
3838
"@nestjs/platform-express": "^10.0.0",
3939
"@nestjs/throttler": "^5.2.0",
40-
"credo-ts-indy-vdr-proxy-server": "0.2.0",
40+
"credo-ts-indy-vdr-proxy-server": "0.2.1",
4141
"dotenv": "^16.4.5",
4242
"reflect-metadata": "^0.2.0",
4343
"rxjs": "^7.8.1"
@@ -84,7 +84,10 @@
8484
},
8585
"packageManager": "yarn@4.3.1",
8686
"resolutions": {
87-
"@hyperledger/indy-vdr-nodejs@npm:^0.2.2": "patch:@hyperledger/indy-vdr-nodejs@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-nodejs-npm-0.2.2-2e02c2a0aa.patch",
88-
"@hyperledger/indy-vdr-shared@npm:0.2.2": "patch:@hyperledger/indy-vdr-shared@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-shared-npm-0.2.2-b989282fc6.patch"
87+
"@hyperledger/indy-vdr-nodejs@npm:0.2.2": "patch:@hyperledger/indy-vdr-nodejs@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-nodejs-npm-0.2.2-2e02c2a0aa.patch",
88+
"@hyperledger/indy-vdr-shared@npm:0.2.2": "patch:@hyperledger/indy-vdr-shared@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-shared-npm-0.2.2-b989282fc6.patch",
89+
"@credo-ts/anoncreds@npm:0.5.15": "patch:@credo-ts/anoncreds@npm%3A0.5.15#~/.yarn/patches/@credo-ts-anoncreds-npm-0.5.15-133fba94e7.patch",
90+
"@credo-ts/core@npm:0.5.15": "patch:@credo-ts/core@npm%3A0.5.15#~/.yarn/patches/@credo-ts-core-npm-0.5.15-1831bdf602.patch",
91+
"@credo-ts/indy-vdr@npm:0.5.15": "patch:@credo-ts/indy-vdr@npm%3A0.5.15#~/.yarn/patches/@credo-ts-indy-vdr-npm-0.5.15-a85ed1c19e.patch"
8992
}
9093
}

res/app.config.json

Lines changed: 2 additions & 23 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)