@verii/server-credentialagent 1.1.0-pre.1770078755 → 1.1.0-pre.1770084266
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/e2e/org-registration-and-issuing.e2e.test.js +10 -10
- package/migrate-mongo.config.js +0 -7
- package/migrations/20210317133137-add-index-to-offers-repo.js +2 -2
- package/migrations/20210416145639-add-index-to-revocation-list.js +1 -1
- package/migrations/20210719120225-add_unique_did_index_to_tenant.js +1 -1
- package/migrations/20230524053029-add-vendorUserIdMappings-index.js +1 -1
- package/migrations/20230616111907-add-configuration-type-index.js +1 -1
- package/package.json +42 -41
- package/src/controllers/holder/get-exchange-progress/controller.js +1 -1
- package/src/controllers/holder/inspect/get-presentation-request/controller.js +3 -4
- package/src/controllers/holder/inspect/submit-presentation/controller.js +2 -2
- package/src/controllers/holder/issue/get-credential-manifest/controller.js +11 -12
- package/src/controllers/holder/issue/offers/controller.js +8 -8
- package/src/controllers/holder/issue/offers/credential-offers/controller.js +30 -28
- package/src/controllers/holder/issue/submit-identification/autohooks.js +1 -1
- package/src/controllers/holder/issue/submit-identification/controller.js +2 -2
- package/src/controllers/holder/oauth/controller.js +6 -7
- package/src/controllers/operator/tenants/_tenantId/check-credentials/controller-v0.8.js +6 -5
- package/src/controllers/operator/tenants/_tenantId/controller-v0.8.js +8 -8
- package/src/controllers/operator/tenants/_tenantId/disclosures/_id/controller-v0.8.js +14 -14
- package/src/controllers/operator/tenants/_tenantId/disclosures/_id/feeds/controller-v0.8.js +6 -6
- package/src/controllers/operator/tenants/_tenantId/disclosures/controller-v0.8.js +4 -4
- package/src/controllers/operator/tenants/_tenantId/exchanges/_exchangeId/controller-v0.8.js +3 -3
- package/src/controllers/operator/tenants/_tenantId/exchanges/controller-v0.8.js +6 -6
- package/src/controllers/operator/tenants/_tenantId/issued-credentials/controller-v0.8.js +14 -14
- package/src/controllers/operator/tenants/_tenantId/keys/controller-v0.8.js +7 -7
- package/src/controllers/operator/tenants/_tenantId/offer-data/controller-v0.8.js +3 -4
- package/src/controllers/operator/tenants/_tenantId/offers/controller-v0.8.js +13 -13
- package/src/controllers/operator/tenants/_tenantId/users/controller-v0.8.js +6 -5
- package/src/controllers/operator/tenants/_tenantId/vc-api/credentials/controller-v0.8.js +6 -6
- package/src/controllers/operator/tenants/controller-v0.8.js +7 -7
- package/src/controllers/root/controller.js +12 -12
- package/src/controllers/saasoperator/groups/_id/controller.js +4 -4
- package/src/controllers/saasoperator/groups/controller.js +2 -2
- package/src/entities/allocations/repos/repo.js +1 -1
- package/src/entities/deep-links/domains/velocity-protocol-uri-to-http-uri.js +1 -1
- package/src/entities/disclosures/domains/get-disclosure-configuration-type.js +2 -2
- package/src/entities/disclosures/domains/parse-body-to-disclosure.js +1 -1
- package/src/entities/disclosures/domains/validate-by-identification-method.js +2 -2
- package/src/entities/disclosures/domains/validate-commercial-entity.js +2 -1
- package/src/entities/disclosures/domains/validate-disclosure-by-configuration-type.js +1 -1
- package/src/entities/disclosures/domains/validate-disclosure-default-issuing.js +5 -5
- package/src/entities/disclosures/domains/validate-disclosure.js +1 -1
- package/src/entities/disclosures/domains/validate-presentation-definition.js +2 -2
- package/src/entities/disclosures/factories/disclosure-factory.js +2 -2
- package/src/entities/disclosures/repos/repo.js +2 -2
- package/src/entities/exchanges/adapters/sign-exchange-response.js +3 -2
- package/src/entities/exchanges/domains/build-exchange-progress.js +1 -1
- package/src/entities/exchanges/domains/ensure-exchange-state-valid.js +1 -1
- package/src/entities/exchanges/orchestrators/build-exchange-request-deep-link.js +3 -3
- package/src/entities/exchanges/repos/exchange-state-repo-extension.js +3 -3
- package/src/entities/exchanges/repos/repo.js +1 -1
- package/src/entities/feeds/factories/feed-factory.js +1 -1
- package/src/entities/feeds/repos/repo.js +1 -1
- package/src/entities/groups/orchestrators/find-group-or-error.js +1 -1
- package/src/entities/groups/orchestrators/validate-group.js +1 -1
- package/src/entities/groups/repos/delete-tenant-extension.js +1 -1
- package/src/entities/groups/repos/repo.js +1 -1
- package/src/entities/groups/repos/update-or-error-extension.js +1 -1
- package/src/entities/keys/domains/is-matching-private-key-kid.js +1 -1
- package/src/entities/keys/factories/key-factory.js +1 -1
- package/src/entities/keys/orchestrators/validate-did-doc-keys.js +2 -1
- package/src/entities/metadata-list-allocations/repos/repo.js +1 -1
- package/src/entities/offers/domains/build-deeplink-url.js +12 -12
- package/src/entities/offers/domains/build-offer.js +2 -2
- package/src/entities/offers/domains/build-qr-code-url.js +5 -5
- package/src/entities/offers/domains/filter-object-ids.js +2 -2
- package/src/entities/offers/domains/post-validation-offers-handler.js +1 -1
- package/src/entities/offers/domains/prepare-linked-credentials-for-holder.js +1 -1
- package/src/entities/offers/domains/resolve-subject.js +7 -7
- package/src/entities/offers/domains/validate-offer-commercial-entity.js +1 -0
- package/src/entities/offers/domains/validate-offer.js +6 -5
- package/src/entities/offers/factories/offer-factory.js +5 -5
- package/src/entities/offers/orchestrators/create-verifiable-credentials.js +9 -9
- package/src/entities/offers/orchestrators/finalize-exchange.js +2 -2
- package/src/entities/offers/orchestrators/load-credential-refs.js +3 -3
- package/src/entities/offers/orchestrators/load-credential-types-map.js +2 -2
- package/src/entities/offers/orchestrators/prepare-offers.js +1 -1
- package/src/entities/offers/orchestrators/trigger-issued-credentials-webhook.js +2 -2
- package/src/entities/offers/repos/clean-pii-extension.js +1 -1
- package/src/entities/offers/repos/repo.js +5 -5
- package/src/entities/presentations/domains/build-identity-doc.js +7 -4
- package/src/entities/presentations/domains/build-vendor-data.js +1 -1
- package/src/entities/presentations/domains/check-payment-requirement.js +1 -1
- package/src/entities/presentations/domains/extract-fields-from-id-credential.js +1 -1
- package/src/entities/presentations/domains/validate-presentation.js +5 -5
- package/src/entities/presentations/orchestrators/create-presentation-request.js +6 -5
- package/src/entities/presentations/orchestrators/deduplicate-disclosure-exchange.js +2 -2
- package/src/entities/presentations/orchestrators/handle-presentation-submission.js +2 -2
- package/src/entities/presentations/orchestrators/match-identity-on-exchange.js +4 -4
- package/src/entities/presentations/orchestrators/share-identification-credentials.js +4 -3
- package/src/entities/presentations/orchestrators/share-presentation.js +12 -12
- package/src/entities/redirect/orchestrators/load-org-info.js +2 -1
- package/src/entities/revocation-list-allocations/repos/repo.js +1 -1
- package/src/entities/schemas/orchestrators/load-schema-validation.js +6 -6
- package/src/entities/tenants/domains/extract-service.js +1 -1
- package/src/entities/tenants/domains/validate-service-ids.js +2 -2
- package/src/entities/tenants/factories/tenant-factory.js +1 -1
- package/src/entities/tenants/orchestrators/add-primary-address-to-tenant.js +1 -1
- package/src/entities/tenants/orchestrators/create-tenant.js +4 -4
- package/src/entities/tenants/orchestrators/refresh-tenant-dids.js +1 -1
- package/src/entities/tenants/orchestrators/set-tenant-default-issuing-disclosure.js +1 -1
- package/src/entities/tenants/repos/repo.js +1 -1
- package/src/entities/tokens/adapters/access-token.js +1 -1
- package/src/entities/users/repos/find-or-insert-vendor-user-repo-extension.js +1 -1
- package/src/entities/users/repos/repo.js +1 -1
- package/src/fetchers/operator/inspection-fetcher.js +1 -1
- package/src/fetchers/operator/vendor-errors-handler.js +6 -6
- package/src/fetchers/operator/webhook-auth-header.js +1 -1
- package/src/plugins/ensure-disclosure-configuration-type-plugin.js +1 -1
- package/src/plugins/ensure-tenant-default-issuing-disclosure-id-plugin.js +3 -3
- package/src/plugins/exchange-error-handler-plugin.js +1 -1
- package/src/plugins/exchange-loader-plugin.js +1 -0
- package/src/plugins/group-loader-plugin.js +1 -1
- package/src/plugins/tenant-loader-plugin.js +2 -2
- package/src/plugins/validate-cao-plugin.js +2 -2
- package/src/plugins/verify-access-token-plugin.js +2 -2
- package/test/combined/app-redirect.test.js +17 -17
- package/test/combined/helpers/credentialagent-build-fastify.js +1 -1
- package/test/combined/helpers/nock-registrar-app-schema-name.js +3 -2
- package/test/combined/helpers/nock-registrar-get-organization-verified-profile.js +3 -3
- package/test/combined/validate-cao-plugin.test.js +6 -6
- package/test/helpers/jwt-vc-expectation.js +3 -3
- package/test/holder/credential-manifest-controller.test.js +154 -153
- package/test/holder/e2e-issuing-controller.test.js +10 -10
- package/test/holder/get-exchange-progress-controller.test.js +2 -2
- package/test/holder/get-presentation-request.test.js +57 -57
- package/test/holder/helpers/credential-type-metadata.js +3 -3
- package/test/holder/helpers/credentialagent-holder-build-fastify.js +1 -1
- package/test/holder/helpers/generate-presentation.js +7 -7
- package/test/holder/helpers/generate-test-access-token.js +1 -1
- package/test/holder/helpers/jwt-vc-expectation.js +3 -3
- package/test/holder/issuing-controller.test.js +297 -264
- package/test/holder/oauth-token-controller.test.js +16 -17
- package/test/holder/presentation-submission.test.js +89 -103
- package/test/holder/submit-identification.test.js +209 -209
- package/test/operator/check-credentials-controller-v0.8.test.js +22 -22
- package/test/operator/credentials-revoke.test.js +13 -13
- package/test/operator/disclosures-controller-v0.8.test.js +168 -172
- package/test/operator/exchanges-controller-v0.8.test.js +10 -11
- package/test/operator/exchanges-id-controller-v0.8.test.js +0 -1
- package/test/operator/feeds-controller-v0.8.test.js +19 -20
- package/test/operator/generate-push-gateway-token.test.js +1 -1
- package/test/operator/groups-controller.test.js +2 -2
- package/test/operator/groups-id-controller.test.js +7 -7
- package/test/operator/helpers/credentialagent-operator-build-fastify.js +1 -1
- package/test/operator/helpers/generate-primary-and-add-operator-to-primary.js +3 -4
- package/test/operator/issued-credentials-controller-v0.8.test.js +8 -9
- package/test/operator/keys-controller-v0.8.test.js +39 -39
- package/test/operator/offer-data-controller-v0.8.test.js +9 -8
- package/test/operator/offers-controller-v0.8.test.js +120 -121
- package/test/operator/set-configuration-type-modifier.test.js +6 -8
- package/test/operator/tenant-controller-v0.8.test.js +12 -13
- package/test/operator/tenants-controller-v0.8.test.js +58 -64
- package/test/operator/users-controller-v0.8.test.js +2 -3
- package/test/operator/vc-api-credentials.test.js +34 -34
- package/test/operator/vendor-errors-handler.test.js +10 -10
|
@@ -76,7 +76,7 @@ dotenv.config({
|
|
|
76
76
|
'..',
|
|
77
77
|
'samples',
|
|
78
78
|
'sample-registrar-server',
|
|
79
|
-
'.localdev.env'
|
|
79
|
+
'.localdev.env',
|
|
80
80
|
),
|
|
81
81
|
processEnv: e2eEnv,
|
|
82
82
|
});
|
|
@@ -192,7 +192,7 @@ describe('org registration and issuing e2e', () => {
|
|
|
192
192
|
'Content-Type': 'application/json',
|
|
193
193
|
Authorization: `Bearer ${authJson.access_token}`,
|
|
194
194
|
},
|
|
195
|
-
}
|
|
195
|
+
},
|
|
196
196
|
).then((r) => r.json());
|
|
197
197
|
|
|
198
198
|
// json response checks
|
|
@@ -214,7 +214,7 @@ describe('org registration and issuing e2e', () => {
|
|
|
214
214
|
headers: {
|
|
215
215
|
'Content-Type': 'application/json',
|
|
216
216
|
},
|
|
217
|
-
}
|
|
217
|
+
},
|
|
218
218
|
);
|
|
219
219
|
const quantity = 100;
|
|
220
220
|
const expiry = addMonths(3, new Date());
|
|
@@ -244,13 +244,13 @@ describe('org registration and issuing e2e', () => {
|
|
|
244
244
|
Authorization: `Bearer ${fineractAuthJson.access_token}`,
|
|
245
245
|
'fineract-platform-tenantid': 'default',
|
|
246
246
|
},
|
|
247
|
-
}
|
|
247
|
+
},
|
|
248
248
|
);
|
|
249
249
|
expect(createVoucherResponse.status).toEqual(200);
|
|
250
250
|
await expect(createVoucherResponse.json()).resolves.toEqual({
|
|
251
251
|
clientId: parseInt(
|
|
252
252
|
createFullOrganizationResponse.ids.fineractClientId,
|
|
253
|
-
10
|
|
253
|
+
10,
|
|
254
254
|
),
|
|
255
255
|
officeId: 1,
|
|
256
256
|
resourceId: expect.any(Number),
|
|
@@ -265,7 +265,7 @@ describe('org registration and issuing e2e', () => {
|
|
|
265
265
|
Authorization: `Bearer ${fineractAuthJson.access_token}`,
|
|
266
266
|
'fineract-platform-tenantid': 'default',
|
|
267
267
|
},
|
|
268
|
-
}
|
|
268
|
+
},
|
|
269
269
|
);
|
|
270
270
|
await expect(balanceQuery2Response.json()).resolves.toEqual({
|
|
271
271
|
balance: 100,
|
|
@@ -282,7 +282,7 @@ describe('org registration and issuing e2e', () => {
|
|
|
282
282
|
KeyPurposes.EXCHANGES,
|
|
283
283
|
KeyPurposes.ISSUING_METADATA,
|
|
284
284
|
].includes(first(purposes)),
|
|
285
|
-
keys
|
|
285
|
+
keys,
|
|
286
286
|
),
|
|
287
287
|
};
|
|
288
288
|
|
|
@@ -297,7 +297,7 @@ describe('org registration and issuing e2e', () => {
|
|
|
297
297
|
'Content-Type': 'application/json',
|
|
298
298
|
Authorization: `Bearer ${OPERATOR_API_TOKEN}`,
|
|
299
299
|
},
|
|
300
|
-
}
|
|
300
|
+
},
|
|
301
301
|
);
|
|
302
302
|
expect(createTenantResponse.status).toEqual(201);
|
|
303
303
|
const createTenantJson = await createTenantResponse.json();
|
|
@@ -441,7 +441,7 @@ describe('org registration and issuing e2e', () => {
|
|
|
441
441
|
authorization: `Bearer ${OPERATOR_API_TOKEN}`,
|
|
442
442
|
},
|
|
443
443
|
body: JSON.stringify(disclosure),
|
|
444
|
-
}
|
|
444
|
+
},
|
|
445
445
|
);
|
|
446
446
|
|
|
447
447
|
expect(createDisclosureResponse.status).toEqual(201);
|
|
@@ -466,7 +466,7 @@ const initMintBundle = async () => {
|
|
|
466
466
|
contractAddress: e2eEnv.COUPON_CONTRACT_ADDRESS,
|
|
467
467
|
rpcProvider,
|
|
468
468
|
},
|
|
469
|
-
{ log: console, traceId: nanoid() }
|
|
469
|
+
{ log: console, traceId: nanoid() },
|
|
470
470
|
);
|
|
471
471
|
|
|
472
472
|
return mint;
|
package/migrate-mongo.config.js
CHANGED
|
@@ -19,13 +19,6 @@ const env = require('env-var');
|
|
|
19
19
|
const config = {
|
|
20
20
|
mongodb: {
|
|
21
21
|
url: env.get('MONGO_URI').required(true).asString(),
|
|
22
|
-
|
|
23
|
-
options: {
|
|
24
|
-
useNewUrlParser: true, // removes a deprecation warning when connecting
|
|
25
|
-
useUnifiedTopology: true, // removes a deprecating warning when connecting
|
|
26
|
-
// connectTimeoutMS: 3600000, // increase connection timeout to 1 hour
|
|
27
|
-
// socketTimeoutMS: 3600000, // increase socket timeout to 1 hour
|
|
28
|
-
},
|
|
29
22
|
},
|
|
30
23
|
|
|
31
24
|
migrationsDir: 'migrations',
|
|
@@ -41,12 +41,12 @@ module.exports = {
|
|
|
41
41
|
],
|
|
42
42
|
{
|
|
43
43
|
sparse: true,
|
|
44
|
-
}
|
|
44
|
+
},
|
|
45
45
|
);
|
|
46
46
|
},
|
|
47
47
|
|
|
48
48
|
down: async (db) => {
|
|
49
|
-
db.collection('offers').dropIndexes({
|
|
49
|
+
await db.collection('offers').dropIndexes({
|
|
50
50
|
exchangeIdIndex: 1,
|
|
51
51
|
issuerIndex: 1,
|
|
52
52
|
offerIdIndex: 1,
|
|
@@ -30,7 +30,7 @@ module.exports = {
|
|
|
30
30
|
console.log(`${resultsArray.length} duplicates found.`);
|
|
31
31
|
// eslint-disable-next-line no-console
|
|
32
32
|
console.log(
|
|
33
|
-
'Please remove the following duplicate tenants before re-running the migration'
|
|
33
|
+
'Please remove the following duplicate tenants before re-running the migration',
|
|
34
34
|
);
|
|
35
35
|
each((result) => {
|
|
36
36
|
// eslint-disable-next-line no-console
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verii/server-credentialagent",
|
|
3
|
-
"version": "1.1.0-pre.
|
|
3
|
+
"version": "1.1.0-pre.1770084266",
|
|
4
4
|
"description": "Credential Agent application",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": "https://github.com/LFDT-Verii/core",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"start:dev": "node --throw-deprecation src/standalone.js",
|
|
16
16
|
"start-operator": "node src/main-operator.js",
|
|
17
17
|
"start-holder": "node src/main-holder.js",
|
|
18
|
-
"lint": "eslint
|
|
18
|
+
"lint": "eslint .",
|
|
19
19
|
"lint:ci": "eslint . --format json >> eslint-results.json",
|
|
20
|
-
"lint:fix": "eslint --fix
|
|
20
|
+
"lint:fix": "eslint --fix .",
|
|
21
21
|
"migrate:status": "./node_modules/.bin/migrate-mongo status --file migrate-mongo.config.js",
|
|
22
22
|
"migrate:create": "./node_modules/.bin/migrate-mongo create --file migrate-mongo.config.js",
|
|
23
23
|
"migrate:up": "./node_modules/.bin/migrate-mongo up --file migrate-mongo.config.js",
|
|
@@ -40,31 +40,31 @@
|
|
|
40
40
|
"@fastify/view": "^11.0.0",
|
|
41
41
|
"@spencejs/spence-factories": "^0.10.2",
|
|
42
42
|
"@spencejs/spence-mongo-repos": "^0.10.2",
|
|
43
|
-
"@verii/auth": "1.1.0-pre.
|
|
44
|
-
"@verii/base-contract-io": "1.1.0-pre.
|
|
45
|
-
"@verii/blockchain-functions": "1.1.0-pre.
|
|
46
|
-
"@verii/common-fetchers": "1.1.0-pre.
|
|
47
|
-
"@verii/common-functions": "1.1.0-pre.
|
|
48
|
-
"@verii/common-schemas": "1.1.0-pre.
|
|
49
|
-
"@verii/config": "1.1.0-pre.
|
|
50
|
-
"@verii/contract-permissions": "1.1.0-pre.
|
|
51
|
-
"@verii/crypto": "1.1.0-pre.
|
|
52
|
-
"@verii/csv-parser": "1.1.0-pre.
|
|
53
|
-
"@verii/db-kms": "1.1.0-pre.
|
|
54
|
-
"@verii/did-doc": "1.1.0-pre.
|
|
55
|
-
"@verii/fastify-plugins": "1.1.0-pre.
|
|
56
|
-
"@verii/http-client": "1.1.0-pre.
|
|
57
|
-
"@verii/jwt": "1.1.0-pre.
|
|
58
|
-
"@verii/metadata-registration": "1.1.0-pre.
|
|
59
|
-
"@verii/organizations-registry": "1.1.0-pre.
|
|
60
|
-
"@verii/rest-queries": "1.1.0-pre.
|
|
61
|
-
"@verii/server-provider": "1.1.0-pre.
|
|
62
|
-
"@verii/spencer-mongo-extensions": "1.1.0-pre.
|
|
63
|
-
"@verii/test-regexes": "1.1.0-pre.
|
|
64
|
-
"@verii/validation": "1.1.0-pre.
|
|
65
|
-
"@verii/vc-checks": "1.1.0-pre.
|
|
66
|
-
"@verii/verii-issuing": "1.1.0-pre.
|
|
67
|
-
"@verii/verii-verification": "1.1.0-pre.
|
|
43
|
+
"@verii/auth": "1.1.0-pre.1770084266",
|
|
44
|
+
"@verii/base-contract-io": "1.1.0-pre.1770084266",
|
|
45
|
+
"@verii/blockchain-functions": "1.1.0-pre.1770084266",
|
|
46
|
+
"@verii/common-fetchers": "1.1.0-pre.1770084266",
|
|
47
|
+
"@verii/common-functions": "1.1.0-pre.1770084266",
|
|
48
|
+
"@verii/common-schemas": "1.1.0-pre.1770084266",
|
|
49
|
+
"@verii/config": "1.1.0-pre.1770084266",
|
|
50
|
+
"@verii/contract-permissions": "1.1.0-pre.1770084266",
|
|
51
|
+
"@verii/crypto": "1.1.0-pre.1770084266",
|
|
52
|
+
"@verii/csv-parser": "1.1.0-pre.1770084266",
|
|
53
|
+
"@verii/db-kms": "1.1.0-pre.1770084266",
|
|
54
|
+
"@verii/did-doc": "1.1.0-pre.1770084266",
|
|
55
|
+
"@verii/fastify-plugins": "1.1.0-pre.1770084266",
|
|
56
|
+
"@verii/http-client": "1.1.0-pre.1770084266",
|
|
57
|
+
"@verii/jwt": "1.1.0-pre.1770084266",
|
|
58
|
+
"@verii/metadata-registration": "1.1.0-pre.1770084266",
|
|
59
|
+
"@verii/organizations-registry": "1.1.0-pre.1770084266",
|
|
60
|
+
"@verii/rest-queries": "1.1.0-pre.1770084266",
|
|
61
|
+
"@verii/server-provider": "1.1.0-pre.1770084266",
|
|
62
|
+
"@verii/spencer-mongo-extensions": "1.1.0-pre.1770084266",
|
|
63
|
+
"@verii/test-regexes": "1.1.0-pre.1770084266",
|
|
64
|
+
"@verii/validation": "1.1.0-pre.1770084266",
|
|
65
|
+
"@verii/vc-checks": "1.1.0-pre.1770084266",
|
|
66
|
+
"@verii/verii-issuing": "1.1.0-pre.1770084266",
|
|
67
|
+
"@verii/verii-verification": "1.1.0-pre.1770084266",
|
|
68
68
|
"ajv": "8.17.1",
|
|
69
69
|
"canonicalize": "^2.1.0",
|
|
70
70
|
"date-fns": "~4.1.0",
|
|
@@ -83,29 +83,30 @@
|
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@spencejs/spence-config": "0.10.2",
|
|
86
|
-
"@verii/endpoints-organizations-registrar": "1.1.0-pre.
|
|
87
|
-
"@verii/sample-data": "1.1.0-pre.
|
|
86
|
+
"@verii/endpoints-organizations-registrar": "1.1.0-pre.1770084266",
|
|
87
|
+
"@verii/sample-data": "1.1.0-pre.1770084266",
|
|
88
88
|
"@verii/test-regexes": "0.5.0-build",
|
|
89
|
-
"@verii/tests-helpers": "1.1.0-pre.
|
|
89
|
+
"@verii/tests-helpers": "1.1.0-pre.1770084266",
|
|
90
90
|
"cheerio": "1.2.0",
|
|
91
91
|
"dotenv": "16.6.1",
|
|
92
|
-
"eslint": "
|
|
93
|
-
"eslint-config-airbnb-
|
|
94
|
-
"eslint-config-prettier": "
|
|
95
|
-
"eslint-plugin-autofix": "
|
|
96
|
-
"eslint-plugin-better-mutation": "1.
|
|
92
|
+
"eslint": "9.39.2",
|
|
93
|
+
"eslint-config-airbnb-extended": "3.0.1",
|
|
94
|
+
"eslint-config-prettier": "10.1.8",
|
|
95
|
+
"eslint-plugin-autofix": "2.2.0",
|
|
96
|
+
"eslint-plugin-better-mutation": "2.1.0",
|
|
97
97
|
"eslint-plugin-import": "2.32.0",
|
|
98
98
|
"eslint-plugin-prefer-arrow-functions": "3.9.1",
|
|
99
|
-
"eslint-plugin-prettier": "
|
|
100
|
-
"eslint-watch": "
|
|
99
|
+
"eslint-plugin-prettier": "5.5.5",
|
|
100
|
+
"eslint-watch": "8.0.0",
|
|
101
101
|
"expect": "30.2.0",
|
|
102
|
+
"globals": "16.5.0",
|
|
102
103
|
"jest-json-schema": "6.1.0",
|
|
103
104
|
"jose": "5.10.0",
|
|
104
|
-
"migrate-mongo": "
|
|
105
|
+
"migrate-mongo": "14.0.7",
|
|
105
106
|
"nanoid-dictionary": "5.0.0",
|
|
106
107
|
"nodemon": "3.1.11",
|
|
107
|
-
"prettier": "
|
|
108
|
+
"prettier": "3.8.1",
|
|
108
109
|
"qs": "6.14.1"
|
|
109
110
|
},
|
|
110
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "53570389d95350e797d52f6bfd77d07e945f9ceb"
|
|
111
112
|
}
|
|
@@ -75,7 +75,7 @@ const controller = async (fastify) => {
|
|
|
75
75
|
protocolMetadata: {
|
|
76
76
|
protocol: ExchangeProtocols.VNF_API,
|
|
77
77
|
},
|
|
78
|
-
})
|
|
78
|
+
}),
|
|
79
79
|
);
|
|
80
80
|
// eslint-disable-next-line better-mutation/no-mutation
|
|
81
81
|
req.exchange = exchange; // exchange is added onto the request for the exchange error handler
|
|
@@ -83,17 +83,16 @@ const controller = async (fastify) => {
|
|
|
83
83
|
const presentationRequest = await createPresentationRequest(
|
|
84
84
|
disclosure,
|
|
85
85
|
exchange,
|
|
86
|
-
req
|
|
86
|
+
req,
|
|
87
87
|
);
|
|
88
88
|
|
|
89
|
-
// eslint-disable-next-line camelcase
|
|
90
89
|
return {
|
|
91
90
|
presentation_request:
|
|
92
91
|
!isProd && req.query.format === 'json'
|
|
93
92
|
? presentationRequest
|
|
94
93
|
: await signExchangeResponse(presentationRequest, {}, req),
|
|
95
94
|
};
|
|
96
|
-
}
|
|
95
|
+
},
|
|
97
96
|
);
|
|
98
97
|
};
|
|
99
98
|
|
|
@@ -44,7 +44,7 @@ const controller = async (fastify) => {
|
|
|
44
44
|
// eslint-disable-next-line better-mutation/no-mutation
|
|
45
45
|
req.body.vp = await verifyVerifiablePresentationJwt(
|
|
46
46
|
req.body.jwt_vp ?? req.body.vp_jwt,
|
|
47
|
-
req
|
|
47
|
+
req,
|
|
48
48
|
);
|
|
49
49
|
},
|
|
50
50
|
schema: fastify.autoSchema({
|
|
@@ -82,7 +82,7 @@ const controller = async (fastify) => {
|
|
|
82
82
|
},
|
|
83
83
|
async (req) => {
|
|
84
84
|
return handlePresentationSubmission(req.body.vp, req);
|
|
85
|
-
}
|
|
85
|
+
},
|
|
86
86
|
);
|
|
87
87
|
};
|
|
88
88
|
|
|
@@ -85,23 +85,23 @@ const credentialManifestController = async (fastify) => {
|
|
|
85
85
|
pushDelegate,
|
|
86
86
|
credentialTypes,
|
|
87
87
|
id,
|
|
88
|
-
req
|
|
88
|
+
req,
|
|
89
89
|
);
|
|
90
90
|
const disclosure = await repos.disclosures.findById(
|
|
91
|
-
exchange.disclosureId
|
|
91
|
+
exchange.disclosureId,
|
|
92
92
|
);
|
|
93
93
|
|
|
94
94
|
// eslint-disable-next-line better-mutation/no-mutation
|
|
95
95
|
req.exchange = exchange; // added onto the request for the exchange error handler
|
|
96
96
|
await ensureExchangeStateValid(
|
|
97
97
|
ExchangeErrorCodeState.EXCHANGE_INVALID,
|
|
98
|
-
req
|
|
98
|
+
req,
|
|
99
99
|
);
|
|
100
100
|
|
|
101
101
|
const presentationRequest = await createPresentationRequest(
|
|
102
102
|
disclosure,
|
|
103
103
|
exchange,
|
|
104
|
-
req
|
|
104
|
+
req,
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
const credentialTypeDescriptors = await Promise.all(
|
|
@@ -109,10 +109,10 @@ const credentialManifestController = async (fastify) => {
|
|
|
109
109
|
(type) =>
|
|
110
110
|
getCredentialTypeDescriptor(
|
|
111
111
|
{ type, locale, includeDisplay: true },
|
|
112
|
-
req
|
|
112
|
+
req,
|
|
113
113
|
),
|
|
114
|
-
credentialTypes
|
|
115
|
-
)
|
|
114
|
+
credentialTypes,
|
|
115
|
+
),
|
|
116
116
|
);
|
|
117
117
|
|
|
118
118
|
const credentialManifest = {
|
|
@@ -121,14 +121,13 @@ const credentialManifestController = async (fastify) => {
|
|
|
121
121
|
issuer: { id: tenant.did },
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
// eslint-disable-next-line camelcase
|
|
125
124
|
return {
|
|
126
125
|
issuing_request:
|
|
127
126
|
!isProd && req.query.format === 'json'
|
|
128
127
|
? credentialManifest
|
|
129
128
|
: await signExchangeResponse(credentialManifest, {}, req),
|
|
130
129
|
};
|
|
131
|
-
}
|
|
130
|
+
},
|
|
132
131
|
);
|
|
133
132
|
};
|
|
134
133
|
|
|
@@ -149,7 +148,7 @@ const findOrCreateExchange = async (
|
|
|
149
148
|
pushDelegate,
|
|
150
149
|
credentialTypes,
|
|
151
150
|
disclosureId,
|
|
152
|
-
context
|
|
151
|
+
context,
|
|
153
152
|
) => {
|
|
154
153
|
const { repos } = context;
|
|
155
154
|
|
|
@@ -162,7 +161,7 @@ const findOrCreateExchange = async (
|
|
|
162
161
|
protocolMetadata: {
|
|
163
162
|
protocol: ExchangeProtocols.VNF_API,
|
|
164
163
|
},
|
|
165
|
-
}
|
|
164
|
+
},
|
|
166
165
|
);
|
|
167
166
|
}
|
|
168
167
|
|
|
@@ -186,7 +185,7 @@ const findOrCreateExchange = async (
|
|
|
186
185
|
protocol: ExchangeProtocols.VNF_API,
|
|
187
186
|
},
|
|
188
187
|
},
|
|
189
|
-
[ExchangeStates.CREDENTIAL_MANIFEST_REQUESTED]
|
|
188
|
+
[ExchangeStates.CREDENTIAL_MANIFEST_REQUESTED],
|
|
190
189
|
);
|
|
191
190
|
};
|
|
192
191
|
|
|
@@ -35,7 +35,7 @@ const controller = async (fastify) => {
|
|
|
35
35
|
const { addDocSchema } = fastify;
|
|
36
36
|
|
|
37
37
|
fastify.addHook('preHandler', async (req) =>
|
|
38
|
-
ensureExchangeStateValid(ExchangeErrorCodeState.EXCHANGE_INVALID, req)
|
|
38
|
+
ensureExchangeStateValid(ExchangeErrorCodeState.EXCHANGE_INVALID, req),
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
addDocSchema(newOfferRelatedResourceSchema);
|
|
@@ -86,7 +86,7 @@ const controller = async (fastify) => {
|
|
|
86
86
|
|
|
87
87
|
await repos.exchanges.addState(
|
|
88
88
|
exchange._id,
|
|
89
|
-
ExchangeStates.CLAIMING_IN_PROGRESS
|
|
89
|
+
ExchangeStates.CLAIMING_IN_PROGRESS,
|
|
90
90
|
);
|
|
91
91
|
|
|
92
92
|
await rejectOffers(exchange, rejectedOfferIds, req);
|
|
@@ -94,16 +94,16 @@ const controller = async (fastify) => {
|
|
|
94
94
|
const signedCredentials = await approveOffers(
|
|
95
95
|
approvedOfferIds,
|
|
96
96
|
body.proof,
|
|
97
|
-
req
|
|
97
|
+
req,
|
|
98
98
|
);
|
|
99
99
|
|
|
100
100
|
await finalizeExchange(
|
|
101
101
|
exchange,
|
|
102
102
|
concat(approvedOfferIds, rejectedOfferIds),
|
|
103
|
-
req
|
|
103
|
+
req,
|
|
104
104
|
);
|
|
105
105
|
return signedCredentials;
|
|
106
|
-
}
|
|
106
|
+
},
|
|
107
107
|
);
|
|
108
108
|
|
|
109
109
|
const rejectOffers = async (exchange, offerIds, context) => {
|
|
@@ -130,7 +130,7 @@ const approveOffers = async (offerIds, proof, context) => {
|
|
|
130
130
|
}
|
|
131
131
|
log.info(
|
|
132
132
|
{ credentialSubjectId: subject?.id, offers },
|
|
133
|
-
'issuing these offers'
|
|
133
|
+
'issuing these offers',
|
|
134
134
|
);
|
|
135
135
|
|
|
136
136
|
checkOffersToBeApproved(offers);
|
|
@@ -141,13 +141,13 @@ const approveOffers = async (offerIds, proof, context) => {
|
|
|
141
141
|
const initCheckOffers = (prop, errorMessageSuffix) => (offers) => {
|
|
142
142
|
const errorOfferIds = flow(
|
|
143
143
|
filter((offer) => !!offer[prop]),
|
|
144
|
-
map('_id')
|
|
144
|
+
map('_id'),
|
|
145
145
|
)(offers);
|
|
146
146
|
|
|
147
147
|
if (!isEmpty(errorOfferIds)) {
|
|
148
148
|
throw newError(
|
|
149
149
|
400,
|
|
150
|
-
buildCheckOffersErrorMessage(errorOfferIds, errorMessageSuffix)
|
|
150
|
+
buildCheckOffersErrorMessage(errorOfferIds, errorMessageSuffix),
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
153
|
};
|