From 7854b09e3a2e7e471a64299c9e5c9aa29de6add0 Mon Sep 17 00:00:00 2001 From: Ashley Harwood Date: Tue, 17 Jun 2025 02:41:34 +1000 Subject: [PATCH] chore: update dependent services --- README.md | 2 + app-config.json | 62 ++--- docker-compose.e2e.yml | 18 +- docker-compose.yml | 16 +- documentation/docs/migration-guides/v0.6.0.md | 259 +++++++++++++----- .../identity-resolution-service.md | 4 + .../services/process-aggregation-event.md | 2 +- .../services/process-association-event.md | 2 +- .../process-digital-conformity-credential.md | 2 +- .../process-digital-facility-record.md | 2 +- .../process-digital-identity-anchor.md | 2 +- .../docs/mock-apps/services/process-dpp.md | 2 +- .../services/process-object-event.md | 2 +- .../services/process-traceability-event.md | 2 +- .../services/process-transaction-event.md | 2 +- .../process-transformation-event-only.md | 2 +- .../services/process-transformation-event.md | 2 +- e2e/constant.ts | 18 +- e2e/cypress/fixtures/app-config.json | 56 ++-- .../support/commands/issue-commands.ts | 2 +- .../components/src/constants/app-config.json | 62 ++--- .../mock-app/src/constants/app-config.json | 62 ++--- .../src/__tests__/linkResolver.test.ts | 7 + .../services/src/__tests__/mocks/constants.ts | 12 +- .../services/src/__tests__/processDPP.test.ts | 1 + .../src/__tests__/transformationEvent.test.ts | 2 + .../src/epcisEvents/aggregationEvent.ts | 1 + .../src/epcisEvents/associationEvent.ts | 1 + .../services/src/epcisEvents/objectEvent.ts | 1 + .../src/epcisEvents/transactionEvent.ts | 1 + .../src/epcisEvents/transformationEvent.ts | 2 + .../epcisEvents/transformationEventOnly.ts | 1 + packages/services/src/linkResolver.service.ts | 54 +++- packages/services/src/processDPP.service.ts | 1 + ...cessDigitalConformityCredential.service.ts | 1 + .../processDigitalFacilityRecord.service.ts | 1 + .../processDigitalIdentityAnchor.service.ts | 1 + seeding/idr-data.sh | 8 +- seeding/mock-gs1-data.sh | 6 +- seeding/mock-gs1-link-resolver.json | 6 +- version.json | 4 +- 41 files changed, 437 insertions(+), 257 deletions(-) diff --git a/README.md b/README.md index a992fdcc7..43bdc0109 100644 --- a/README.md +++ b/README.md @@ -86,11 +86,13 @@ The Identity Resolver and Mock Global GS1 Resolver services require seed data to ```bash # Set environment variables export IDR_SERVICE_HOST=localhost # IDR service host +export IDR_SERVICE_API_VERSION=1.0.0 # IDR API version export IDR_SERVICE_PORT=3000 # IDR service port export IDR_SERVICE_API_KEY=test123 # IDR service API key export IDR_SERVICE_DOMAIN=http://localhost:3000 # IDR service domain export MOCK_GS1_SERVICE_HOST=localhost # Mock GS1 service host +export MOCK_GS1_SERVICE_API_VERSION=1.0.0 # Mock GS1 service API version export MOCK_GS1_SERVICE_PORT=3001 # Mock GS1 service port export MOCK_GS1_SERVICE_API_KEY=test456 # Mock GS1 service API key diff --git a/app-config.json b/app-config.json index dda8ae916..eea446444 100644 --- a/app-config.json +++ b/app-config.json @@ -108,13 +108,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -497,13 +497,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -800,13 +800,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -839,9 +839,9 @@ "id": "example:product/1234", "product": { "type": ["Product"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", + "id": "https://id.gs1.org/01/09359502000034/21/12345", "name": "EV battery 300Ah", - "registeredId": "09520123456788.21.12345", + "registeredId": "09359502000034", "idScheme": { "type": ["IdentifierScheme"], "id": "https://id.gs1.org/01/", @@ -893,7 +893,7 @@ }, "productionDate": "2024-04-25", "countryOfProduction": "AU", - "serialNumber": "12345678", + "serialNumber": "12345", "dimensions": { "weight": { "value": 10, @@ -1144,13 +1144,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/credentials", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1274,13 +1274,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1403,13 +1403,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1541,13 +1541,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1675,13 +1675,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1812,13 +1812,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1841,7 +1841,7 @@ ], "identifyProvider": { "type": "gs1", - "url": "http://localhost:3001", + "url": "http://localhost:3001/api/1.0.0", "namespace": "gs1" }, "identifierSchemes": [ diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml index 7edadd5f3..53eb76c89 100644 --- a/docker-compose.e2e.yml +++ b/docker-compose.e2e.yml @@ -33,7 +33,7 @@ services: restart: always storage-service: - image: ghcr.io/uncefact/project-identity-resolver:sha-e87d4fc@sha256:54ee7f3adaab9650052b99dbe19b3f5bbd2aa2fe7588410c5f66d1941e3752ce + image: ghcr.io/uncefact/project-identity-resolver:latest@sha256:06a69d27ee0547cc0e3ce56243b0d3fbff164f804e586de4c78e580b61d971ca ports: - 3334:3334 environment: @@ -45,7 +45,7 @@ services: - STORAGE_TYPE=local identity-resolver-service: - image: ghcr.io/pyx-industries/pyx-identity-resolver:sha-3b4ce08-local@sha256:91b2a9b324d8253e217b6501bf7c715b725551a744891eb24e7e71b9e9a1d69a + image: ghcr.io/pyx-industries/pyx-identity-resolver:sha-1f21512-local@sha256:af3cb7f2cffdbac501832ee484215cecc8f8d6ac3f571c9f239d61d8cbc74050 ports: - '3000:3000' environment: @@ -60,8 +60,8 @@ services: - API_KEY=test123 - APP_ENDPOINT=http://localhost:3000 - APP_NAME=IDR-1 - - RESOLVER_DOMAIN=http://localhost:3000 - - LINK_TYPE_VOC_DOMAIN=http://localhost:3000/voc + - RESOLVER_DOMAIN=http://localhost:3000/api/1.0.0 + - LINK_TYPE_VOC_DOMAIN=http://localhost:3000/api/1.0.0/voc - PORT=3000 depends_on: - identity-resolver-service-object-store @@ -79,7 +79,7 @@ services: - ./minio_data/identity-resolver-service-object-store/data-test:/data mock-global-gs1-resolver: - image: ghcr.io/pyx-industries/pyx-identity-resolver:sha-fa017fb-local@sha256:cd514863bdaf65ab1b47b8e71669a0245b041c861285a83fa7cf0a65789d4e58 + image: ghcr.io/pyx-industries/pyx-identity-resolver:sha-1f21512-local@sha256:af3cb7f2cffdbac501832ee484215cecc8f8d6ac3f571c9f239d61d8cbc74050 ports: - '3001:3001' environment: @@ -94,8 +94,8 @@ services: - API_KEY=test456 - APP_ENDPOINT=http://localhost:3001 - APP_NAME=IDR-2 - - RESOLVER_DOMAIN=http://localhost:3001 - - LINK_TYPE_VOC_DOMAIN=http://localhost:3001/voc + - RESOLVER_DOMAIN=http://localhost:3001/api/1.0.0 + - LINK_TYPE_VOC_DOMAIN=http://localhost:3001/api/1.0.0/voc - PORT=3001 depends_on: - mock-global-gs1-resolver-object-store @@ -110,19 +110,21 @@ services: - MINIO_ROOT_USER=minioadmin - MINIO_ROOT_PASSWORD=minioadmin volumes: - - ./minio_data/mock-global-gs1-resolver-object-store:/data + - ./minio_data/mock-global-gs1-resolver-object-store/data-test:/data seeding-data: image: alpine:3.20.3 environment: # IDR service environment variables - IDR_SERVICE_HOST=identity-resolver-service + - IDR_SERVICE_API_VERSION=1.0.0 - IDR_SERVICE_PORT=3000 - IDR_SERVICE_API_KEY=test123 # Mock GS1 service environment variables - IDR_SERVICE_DOMAIN=http://localhost:3000 - MOCK_GS1_SERVICE_HOST=mock-global-gs1-resolver + - MOCK_GS1_SERVICE_API_VERSION=1.0.0 - MOCK_GS1_SERVICE_PORT=3001 - MOCK_GS1_SERVICE_API_KEY=test456 command: diff --git a/docker-compose.yml b/docker-compose.yml index fb614a3ce..da1139c41 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,7 +46,7 @@ services: restart: always storage-service: - image: ghcr.io/uncefact/project-identity-resolver:sha-e87d4fc@sha256:54ee7f3adaab9650052b99dbe19b3f5bbd2aa2fe7588410c5f66d1941e3752ce + image: ghcr.io/uncefact/project-identity-resolver:latest@sha256:06a69d27ee0547cc0e3ce56243b0d3fbff164f804e586de4c78e580b61d971ca ports: - 3334:3334 environment: @@ -59,7 +59,7 @@ services: identity-resolver-service: # Replace with local or deployed image - image: ghcr.io/pyx-industries/pyx-identity-resolver:sha-3b4ce08-local@sha256:91b2a9b324d8253e217b6501bf7c715b725551a744891eb24e7e71b9e9a1d69a + image: ghcr.io/pyx-industries/pyx-identity-resolver:sha-1f21512-local@sha256:af3cb7f2cffdbac501832ee484215cecc8f8d6ac3f571c9f239d61d8cbc74050 ports: - '3000:3000' environment: @@ -74,8 +74,8 @@ services: - API_KEY=test123 - APP_ENDPOINT=http://localhost:3000 - APP_NAME=IDR-1 - - RESOLVER_DOMAIN=http://localhost:3000 - - LINK_TYPE_VOC_DOMAIN=http://localhost:3000/voc + - RESOLVER_DOMAIN=http://localhost:3000/api/1.0.0 + - LINK_TYPE_VOC_DOMAIN=http://localhost:3000/api/1.0.0/voc - PORT=3000 depends_on: - identity-resolver-service-object-store @@ -94,7 +94,7 @@ services: mock-global-gs1-resolver: # Replace with local or deployed image - image: ghcr.io/pyx-industries/pyx-identity-resolver:sha-fa017fb-local@sha256:cd514863bdaf65ab1b47b8e71669a0245b041c861285a83fa7cf0a65789d4e58 + image: ghcr.io/pyx-industries/pyx-identity-resolver:sha-1f21512-local@sha256:af3cb7f2cffdbac501832ee484215cecc8f8d6ac3f571c9f239d61d8cbc74050 ports: - '3001:3001' environment: @@ -109,8 +109,8 @@ services: - API_KEY=test456 - APP_ENDPOINT=http://localhost:3001 - APP_NAME=IDR-2 - - RESOLVER_DOMAIN=http://localhost:3001 - - LINK_TYPE_VOC_DOMAIN=http://localhost:3001/voc + - RESOLVER_DOMAIN=http://localhost:3001/api/1.0.0 + - LINK_TYPE_VOC_DOMAIN=http://localhost:3001/api/1.0.0/voc - PORT=3001 depends_on: - mock-global-gs1-resolver-object-store @@ -132,12 +132,14 @@ services: environment: # IDR service environment variables - IDR_SERVICE_HOST=identity-resolver-service + - IDR_SERVICE_API_VERSION=1.0.0 - IDR_SERVICE_PORT=3000 - IDR_SERVICE_API_KEY=test123 # Mock GS1 service environment variables - IDR_SERVICE_DOMAIN=http://localhost:3000 - MOCK_GS1_SERVICE_HOST=mock-global-gs1-resolver + - MOCK_GS1_SERVICE_API_VERSION=1.0.0 - MOCK_GS1_SERVICE_PORT=3001 - MOCK_GS1_SERVICE_API_KEY=test456 command: diff --git a/documentation/docs/migration-guides/v0.6.0.md b/documentation/docs/migration-guides/v0.6.0.md index e58ad5b8c..9082b4706 100644 --- a/documentation/docs/migration-guides/v0.6.0.md +++ b/documentation/docs/migration-guides/v0.6.0.md @@ -9,13 +9,138 @@ import Disclaimer from '.././\_disclaimer.mdx'; ## Overview -This guide covers the migration from UNTP (UN Transparency Protocol) version 0.5.0 to 0.6.0 across all supported data models within the Reference Implementation. The update introduces several structural changes and improvements to schema definitions, data validation patterns, and JSON-LD contexts. +This guide outlines: +- The migration from UNTP (UN Transparency Protocol) version 0.5.0 to 0.6.0 across all supported data models in the Reference Implementation. This update introduces structural changes, enhanced schema definitions, improved data validation patterns, and updated JSON-LD contexts. +- Functional updates to the Reference Implementation, including updates to dependent services, credential rendering, and configuration changes. + +## Functional Updates + +### Dependent Service Updates + +The Reference Implementation now uses the following updated services: +- **Storage Service**: v1.0.1 ([Repository](https://github.com/uncefact/project-identity-resolver.git)) +- **VCkit Service**: v1.1.0 ([Repository](https://github.com/uncefact/project-vckit.git)) +- **Identity Resolver Service**: v1.0.0 ([Repository](https://github.com/pyx-industries/pyx-identity-resolver.git)) + +The `docker-compose` configuration has been updated to use the corresponding images for these service versions. Refer to the respective changelogs in each service’s repository for detailed information. + + +#### Key Changes for Existing Implementations + +1. **Storage Service Configuration** + + The Storage Service configuration URL has been updated: - + **Previous Configuration:** + ```json + "storage": { + "url": "http://localhost:3334/v1/documents", + "params": { + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + } + ``` -## Digital Facility Record (DFR) + **New Configuration:** + ```json + "storage": { + "url": "http://localhost:3334/api/1.0.0/documents", + "params": { + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + } + ``` -### Summary of Changes + **Note**: The `url` has changed from `/v1/documents` to `/api/1.0.0/documents`. + +2. **Identity Resolver (IDR) Service Configuration** + + The IDR Service configuration URL and `linkRegisterPath` have been updated: + + **Previous Configuration:** + ```json + "dlr": { + "dlrAPIUrl": "http://localhost:3000", + "dlrAPIKey": "test123", + "namespace": "gs1", + "linkRegisterPath": "/api/resolver" + } + ``` + + **New Configuration:** + ```json + "dlr": { + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", + "dlrAPIKey": "test123", + "namespace": "gs1", + "linkRegisterPath": "resolver" + } + ``` + + **Note**: The `dlrAPIUrl` now includes the `/api/1.0.0` path, and the `linkRegisterPath` no longer has a leading `/`. + +3. **Identity Provider Configuration (Mock IDR GS1 Register)** + + The Identity Provider configuration URL has been updated: + + **Previous Configuration:** + ```json + "identifyProvider": { + "type": "gs1", + "url": "http://localhost:3001", + "namespace": "gs1" + } + ``` + + **New Configuration:** + ```json + "identifyProvider": { + "type": "gs1", + "url": "http://localhost:3001/api/1.0.0", + "namespace": "gs1" + } + ``` + + **Note**: The `url` now includes the `/api/1.0.0` path. + +These URL updates ensure the system remains stable when underlying service API versions change. + + +#### Seed Script Updates + +The IDR Service and Mock GS1 IDR Service seed scripts have been updated to reflect the new link structure. To ensure compatibility: +- Update any custom or additional seed scripts to align with the new URL structures (`/api/1.0.0`). +- Clear all data in the corresponding object store (e.g., delete the `minio_data` directory or reset the cloud-based object store) to ensure the system uses the new URLs. + +API versions are now included in the seed scripts. If you are using Docker Compose, this is handled automatically. Otherwise, refer to the seed script section in the repository's README. + + +### VCkit Render Package Update + +The `@uncefact/vckit-renderer` package has been updated from version `1.0.0-next.50` to `1.0.0-next.59`. + +This update addresses an issue where the previous implementation used malformed IRIs to extract render templates from credentials (see [details here](https://github.com/uncefact/project-vckit/pull/279)). With UNTP v0.6.0 and the updated package, the system now uses valid IRIs for rendering. + +**Important**: Credentials issued with previous versions will no longer render. You must use the v0.6.0 data models for credentials to render correctly with the this latest version of the Reference Implementation. + + +## Data Model Updates + +### Digital Facility Record (DFR) + +#### Summary of Changes The main changes for Digital Facility Records in UNTP 0.6.0 include: @@ -24,9 +149,9 @@ The main changes for Digital Facility Records in UNTP 0.6.0 include: - **Updated JSON-LD contexts**: New vocabulary context path structure with improved semantic mappings and vocabulary organisation - **Schema refinements**: Better property organisation, improved abstraction, and enhanced data model consistency -### Data Model Changes +#### Data Model Changes -#### 1. JSON-LD Context +##### 1. JSON-LD Context **Before (0.5.0):** @@ -46,7 +171,7 @@ The main changes for Digital Facility Records in UNTP 0.6.0 include: ] ``` -#### 2. Credential Subject Structure +##### 2. Credential Subject Structure The `credentialSubject` property has been restructured from a direct `Facility` reference to a `FacilityRecord` that contains the facility. @@ -81,7 +206,7 @@ After (0.6.0): } ``` -#### 3. Issuer Identifier Structure +##### 3. Issuer Identifier Structure The issuer identifier `otherIdentifier` property has been replaced with a new `issuerAlsoKnownAs` property. @@ -131,7 +256,7 @@ After (0.6.0): } ``` -#### 4. Facility Structure +##### 4. Facility Structure **Key Changes:** @@ -224,9 +349,9 @@ After (0.6.0): } ``` -### Reference Implementation Updates +#### Reference Implementation Updates -#### 1. Schema URL Updates +##### 1. Schema URL Updates **Before (0.5.0):** @@ -244,7 +369,7 @@ After (0.6.0): } ``` -#### 2. Context Configuration in Services +##### 2. Context Configuration in Services **Before (0.5.0):** @@ -262,7 +387,7 @@ After (0.6.0): } ``` -#### 3. Form Data Structure Updates +##### 3. Form Data Structure Updates If you're passing pre-populated data into the JsonForm component, update the data structure to conform to the new FacilityRecord schema: @@ -307,7 +432,7 @@ If you're passing pre-populated data into the JsonForm component, update the dat } ``` -#### 4. Render Template Updates +##### 4. Render Template Updates Update the render template to use the new 0.6.0 compliant template. The updated template can be found at: @@ -339,7 +464,7 @@ packages/mock-app/src/templates/v0.6.0/digital_facility_record/template.hbs ] ``` -#### 5. VCkit Issuer Structure Updates +##### 5. VCkit Issuer Structure Updates Update the VCkit issuer configuration to use the new identifier structure: @@ -391,15 +516,15 @@ Update the VCkit issuer configuration to use the new identifier structure: } ``` -## Digital Identity Anchor (DIA) +### Digital Identity Anchor (DIA) -### Summary of Changes +#### Summary of Changes The main change to the Digital Identity Anchor in UNTP 0.6.0 is the same change present for the other UNTP credentials: the credential issuer's `otherIdentifier` field was changed in name and format. See the [details above](#digital-facility-record-dfr), together with the other smaller changes that are mostly version number updates. -### Data Model Changes +#### Data Model Changes -#### 1. JSON-LD Context Updates +##### 1. JSON-LD Context Updates **Before (0.2.1):** @@ -419,7 +544,7 @@ The main change to the Digital Identity Anchor in UNTP 0.6.0 is the same change ] ``` -#### 2. Issuer Identifier Structure Changes +##### 2. Issuer Identifier Structure Changes The issuer identifier `otherIdentifier` property has been replaced with a new `issuerAlsoKnownAs` property. @@ -469,7 +594,7 @@ After (0.6.0): } ``` -#### 3. RegisteredIdentity Structure Updates +##### 3. RegisteredIdentity Structure Updates **Key Changes:** @@ -513,9 +638,9 @@ After (0.6.0): } ``` -### Reference Implementation Updates +#### Reference Implementation Updates -#### 1. Schema URL Updates +##### 1. Schema URL Updates **Before (0.2.1):** @@ -533,7 +658,7 @@ After (0.6.0): } ``` -#### 2. Context Configuration in Services +##### 2. Context Configuration in Services **Before (0.2.1):** @@ -551,7 +676,7 @@ After (0.6.0): } ``` -#### 3. Form Data Structure Updates +##### 3. Form Data Structure Updates If you're passing pre-populated data into the JsonForm component, update the data structure to conform to the new schema: @@ -587,7 +712,7 @@ If you're passing pre-populated data into the JsonForm component, update the dat } ``` -#### 4. Render Template Updates +##### 4. Render Template Updates Update the render template to use the new 0.6.0 compliant template. The updated template can be found at: @@ -619,7 +744,7 @@ packages/mock-app/src/templates/v0.6.0/digital_identity_anchor/template.hbs ] ``` -#### 5. VCKit Issuer Structure Updates +##### 5. VCKit Issuer Structure Updates Update the VCKit issuer configuration to use the new identifier structure: @@ -671,9 +796,9 @@ Update the VCKit issuer configuration to use the new identifier structure: } ``` -## Digital Conformity Credential (DCC) +### Digital Conformity Credential (DCC) -### Summary of Changes +#### Summary of Changes The main changes to the Digital Conformity Credential in UNTP 0.6.0 include: @@ -685,9 +810,9 @@ The main changes to the Digital Conformity Credential in UNTP 0.6.0 include: - **Updated JSON-LD context**: The context URL is updated to reflect version 0.6.0. - **Schema refinements**: Improved validation patterns and consistency with other UNTP credentials. See the [details above](#digital-facility-record-dfr). -### Data Model Changes +#### Data Model Changes -#### 1. JSON-LD Context Updates +##### 1. JSON-LD Context Updates **Before (0.5.0):** @@ -707,7 +832,7 @@ The main changes to the Digital Conformity Credential in UNTP 0.6.0 include: ] ``` -#### 2. Issuer Identifier Structure Changes +##### 2. Issuer Identifier Structure Changes The issuer identifier `otherIdentifier` property has been replaced with a new `issuerAlsoKnownAs` property, simplifying the structure by removing the `idScheme` reference. @@ -757,7 +882,7 @@ After (0.6.0): } ``` -#### 3. Party Structure Changes +##### 3. Party Structure Changes **Key Changes:** @@ -803,7 +928,7 @@ After (0.6.0): } ``` -#### 4. Assessment Structure Updates +##### 4. Assessment Structure Updates **Key Changes:** @@ -1007,9 +1132,9 @@ After (0.6.0): } ``` -### Reference Implementation Updates +#### Reference Implementation Updates -#### 1. Schema URL Updates +##### 1. Schema URL Updates **Before (0.5.0):** @@ -1027,7 +1152,7 @@ After (0.6.0): } ``` -#### 2. Context Configuration in Services +##### 2. Context Configuration in Services **Before (0.5.0):** @@ -1045,7 +1170,7 @@ After (0.6.0): } ``` -#### 3. Form Data Structure Updates +##### 3. Form Data Structure Updates If you're passing pre-populated data into the JsonForm component, update the data structure to conform to the new schema, reflecting the simplified party structures, new verification structures, and updated auditor structure. @@ -1174,7 +1299,7 @@ If you're passing pre-populated data into the JsonForm component, update the dat } ``` -#### 4. Render Template Updates +##### 4. Render Template Updates Update the render template to use the new 0.6.0 compliant template. The updated template can be found at: @@ -1206,7 +1331,7 @@ packages/mock-app/src/templates/v0.6.0/digital_conformity_credential/template.hb ] ``` -#### 5. VCkit Issuer Structure Updates +##### 5. VCkit Issuer Structure Updates Update the VCkit issuer configuration to use the new `issuerAlsoKnownAs` structure: @@ -1258,9 +1383,9 @@ Update the VCkit issuer configuration to use the new `issuerAlsoKnownAs` structu } ``` -## Digital Product Passport (DPP) +### Digital Product Passport (DPP) -### Summary of Changes +#### Summary of Changes The main changes to the Digital Product Passport in UNTP 0.6.0 include: @@ -1273,9 +1398,9 @@ The main changes to the Digital Product Passport in UNTP 0.6.0 include: - **Updated JSON-LD context**: The context URL is updated to reflect version 0.6.0. - **Schema refinements**: Improved validation patterns, including stricter type constraints and date-time formats, for consistency with other UNTP credentials. See the [details above](#digital-facility-record-dfr). -### Data Model Changes +#### Data Model Changes -#### 1. JSON-LD Context Updates +##### 1. JSON-LD Context Updates **Before (0.5.0):** @@ -1295,7 +1420,7 @@ The main changes to the Digital Product Passport in UNTP 0.6.0 include: ] ``` -#### 2. Credential Subject Structure +##### 2. Credential Subject Structure The `credentialSubject` has been restructured to use a `ProductPassport` type, which encapsulates a `product` object and additional metadata like `granularityLevel` and claims. @@ -1339,7 +1464,7 @@ After (0.6.0): } ``` -#### 3. Issuer Identifier Structure +##### 3. Issuer Identifier Structure The issuer’s `otherIdentifier` property is replaced with `issuerAlsoKnownAs`, simplifying the structure by removing the `idScheme` reference. @@ -1389,7 +1514,7 @@ After (0.6.0): } ``` -#### 4. Product Structure Changes +##### 4. Product Structure Changes **Key Changes:** @@ -1498,7 +1623,7 @@ After (0.6.0): } ``` -#### 5. Material Structure Changes +##### 5. Material Structure Changes **Key Changes:** @@ -1665,7 +1790,7 @@ After (0.6.0): } ``` -#### 6. Criterion Structure Enhancements +##### 6. Criterion Structure Enhancements `Criterion` now includes additional fields: `description`, `conformityTopic`, `status`, `subCriterion`, `thresholdValue` (replacing `thresholdValues`), `performanceLevel`, and `tags`. The `thresholdValues` property has been renamed to `thresholdValue` to reflect a singular metric focus per criterion. The `subCriterion` property allows for hierarchical structuring, enabling a criterion to reference subordinate criteria. @@ -1754,9 +1879,9 @@ After (0.6.0): } ``` -### Reference Implementation Updates +#### Reference Implementation Updates -#### 1. Schema URL Updates +##### 1. Schema URL Updates **Before (0.5.0):** @@ -1774,7 +1899,7 @@ After (0.6.0): } ``` -#### 2. Context Configuration in Services +##### 2. Context Configuration in Services **Before (0.5.0):** @@ -1792,7 +1917,7 @@ After (0.6.0): } ``` -#### 3. Form Data Structure Updates +##### 3. Form Data Structure Updates Update the data structure for the JsonForm component to conform to the new `ProductPassport` schema, reflecting the restructured `credentialSubject`, simplified identifiers, and new fields. @@ -1935,7 +2060,7 @@ Update the data structure for the JsonForm component to conform to the new `Prod } ``` -#### 4. Render Template Updates +##### 4. Render Template Updates Update the render template to use the new 0.6.0 compliant template. The updated template can be found at: @@ -1967,7 +2092,7 @@ packages/mock-app/src/templates/v0.6.0/digital_product_passport/template.hbs ] ``` -#### 5. VCkit Issuer Structure Updates +##### 5. VCkit Issuer Structure Updates Update the VCkit issuer configuration to use the new `issuerAlsoKnownAs` structure: @@ -2019,9 +2144,9 @@ Update the VCkit issuer configuration to use the new `issuerAlsoKnownAs` structu } ``` -## Digital Traceability Event (DTE) +### Digital Traceability Event (DTE) -### Summary of Changes +#### Summary of Changes The main changes to the Digital Traceability Event (DTE) in UNTP 0.6.0 include: @@ -2030,9 +2155,9 @@ The main changes to the Digital Traceability Event (DTE) in UNTP 0.6.0 include: - **Updated JSON-LD context**: The context URL is updated to reflect version 0.6.0. - **Schema refinements**: Improved validation patterns, including stricter type constraints and date-time formats, for consistency with other UNTP credentials. See the [details above](#digital-facility-record-dfr). -### Data Model Changes +#### Data Model Changes -#### 1. JSON-LD Context Updates +##### 1. JSON-LD Context Updates **Before (0.5.0):** @@ -2052,7 +2177,7 @@ The main changes to the Digital Traceability Event (DTE) in UNTP 0.6.0 include: ] ``` -#### 2. Issuer Identifier Structure +##### 2. Issuer Identifier Structure The issuer’s `otherIdentifier` property is replaced with `issuerAlsoKnownAs`, simplifying the structure by removing the `idScheme` reference. @@ -2102,7 +2227,7 @@ After (0.6.0): } ``` -#### 3. TransactionEvent Party Structure +##### 3. TransactionEvent Party Structure **Key Changes:** @@ -2160,9 +2285,9 @@ After (0.6.0): } ``` -### Reference Implementation Updates +#### Reference Implementation Updates -#### 1. Schema URL Updates +##### 1. Schema URL Updates The schema URL depends on the specific event type being issued (e.g., TransactionEvent, ObjectEvent, AssociationEvent, AggregationEvent, TransformationEvent). Below is an example for **TransactionEvent**. @@ -2200,7 +2325,7 @@ The schema URL depends on the specific event type being issued (e.g., Transactio } ``` -#### 2. Context Configuration in Services +##### 2. Context Configuration in Services **Before (0.5.0):** @@ -2218,7 +2343,7 @@ The schema URL depends on the specific event type being issued (e.g., Transactio } ``` -#### 3. Form Data Structure Updates (Transaction Event) +##### 3. Form Data Structure Updates (Transaction Event) Update the data structure for the JsonForm component to conform to the new TransactionEvent schema, reflecting the renamed sourceParty and destinationParty properties. @@ -2272,7 +2397,7 @@ Update the data structure for the JsonForm component to conform to the new Trans } ``` -#### 4. Render Template Updates +##### 4. Render Template Updates Update the render template to use the new 0.6.0 compliant template. The updated template can be found at: @@ -2304,7 +2429,7 @@ packages/mock-app/src/templates/v0.6.0/digital_traceability_event/template.hbs ] ``` -#### 5. VCkit Issuer Structure Updates +##### 5. VCkit Issuer Structure Updates Update the VCkit issuer configuration to use the new `issuerAlsoKnownAs` structure: diff --git a/documentation/docs/mock-apps/dependent-services/identity-resolution-service.md b/documentation/docs/mock-apps/dependent-services/identity-resolution-service.md index ad025bbe9..470b668bd 100644 --- a/documentation/docs/mock-apps/dependent-services/identity-resolution-service.md +++ b/documentation/docs/mock-apps/dependent-services/identity-resolution-service.md @@ -71,12 +71,14 @@ If you are running the seed script directly on your host machine, set the necess ```bash # Identity Resolver (IDR) Service Configuration export IDR_SERVICE_HOST=localhost # IDR service host +export IDR_SERVICE_API_VERSION=1.0.0 # IDR API version export IDR_SERVICE_PORT=3000 # IDR service port export IDR_SERVICE_API_KEY=test123 # IDR service API key export IDR_SERVICE_DOMAIN=http://localhost:3000 # IDR service domain # Mock GS1 Service Configuration export MOCK_GS1_SERVICE_HOST=localhost # Mock GS1 service host +export MOCK_GS1_SERVICE_API_VERSION=1.0.0 # Mock GS1 service API version export MOCK_GS1_SERVICE_PORT=3001 # Mock GS1 service port export MOCK_GS1_SERVICE_API_KEY=test456 # Mock GS1 service API key ``` @@ -102,12 +104,14 @@ services: environment: # IDR service environment variables - IDR_SERVICE_HOST=identity-resolver-service + - IDR_SERVICE_API_VERSION=1.0.0 - IDR_SERVICE_PORT=3000 - IDR_SERVICE_API_KEY=test123 - IDR_SERVICE_DOMAIN=http://localhost:3000 # Mock GS1 service environment variables - MOCK_GS1_SERVICE_HOST=mock-global-gs1-resolver + - MOCK_GS1_SERVICE_API_VERSION=1.0.0 - MOCK_GS1_SERVICE_PORT=3001 - MOCK_GS1_SERVICE_API_KEY=test456 ``` diff --git a/documentation/docs/mock-apps/services/process-aggregation-event.md b/documentation/docs/mock-apps/services/process-aggregation-event.md index 4bc85fcd3..38b7ac40b 100644 --- a/documentation/docs/mock-apps/services/process-aggregation-event.md +++ b/documentation/docs/mock-apps/services/process-aggregation-event.md @@ -75,7 +75,7 @@ P-->>C: Return VC and resolver URL "dlrAPIUrl": "https://dlr.example.com/api", "dlrAPIKey": "dlr-api-key-12345", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "identifierKeyPath": "/0/id" } diff --git a/documentation/docs/mock-apps/services/process-association-event.md b/documentation/docs/mock-apps/services/process-association-event.md index 669f30c8c..34fdc7d9e 100644 --- a/documentation/docs/mock-apps/services/process-association-event.md +++ b/documentation/docs/mock-apps/services/process-association-event.md @@ -71,7 +71,7 @@ P-->>C: Return association event VC and resolver URL "dlrAPIUrl": "https://dlr.example.com/api", "dlrAPIKey": "dlr-api-key-12345", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "identifierKeyPath": "/0/id" } diff --git a/documentation/docs/mock-apps/services/process-digital-conformity-credential.md b/documentation/docs/mock-apps/services/process-digital-conformity-credential.md index 1c27f00c1..b522f35b9 100644 --- a/documentation/docs/mock-apps/services/process-digital-conformity-credential.md +++ b/documentation/docs/mock-apps/services/process-digital-conformity-credential.md @@ -71,7 +71,7 @@ P-->>C: Return digital conformity credential VC and resolver URL "dlrAPIUrl": "https://dlr.example.com/api", "dlrAPIKey": "dlr-api-key-12345", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "identifierKeyPath": "/id" } diff --git a/documentation/docs/mock-apps/services/process-digital-facility-record.md b/documentation/docs/mock-apps/services/process-digital-facility-record.md index 4ed974a0d..f81ad7527 100644 --- a/documentation/docs/mock-apps/services/process-digital-facility-record.md +++ b/documentation/docs/mock-apps/services/process-digital-facility-record.md @@ -75,7 +75,7 @@ P-->>C: Return digital facility record VC and resolver URL "dlrAPIUrl": "https://dlr.example.com/api", "dlrAPIKey": "dlr-api-key-12345", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "identifierKeyPath": "/id" } diff --git a/documentation/docs/mock-apps/services/process-digital-identity-anchor.md b/documentation/docs/mock-apps/services/process-digital-identity-anchor.md index 8a539fe0b..28f476e33 100644 --- a/documentation/docs/mock-apps/services/process-digital-identity-anchor.md +++ b/documentation/docs/mock-apps/services/process-digital-identity-anchor.md @@ -75,7 +75,7 @@ P-->>C: Return digital identity anchor VC and resolver URL "dlrAPIUrl": "https://dlr.example.com/api", "dlrAPIKey": "dlr-api-key-12345", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "identifierKeyPath": "/id" } diff --git a/documentation/docs/mock-apps/services/process-dpp.md b/documentation/docs/mock-apps/services/process-dpp.md index c541d5f25..1156a012d 100644 --- a/documentation/docs/mock-apps/services/process-dpp.md +++ b/documentation/docs/mock-apps/services/process-dpp.md @@ -80,7 +80,7 @@ P-->>C: Return VC and resolver URL "dlrAPIUrl": "https://dlr.example.com", "dlrAPIKey": "5555555555555", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { "url": "http://localhost:3334/v1/documents", diff --git a/documentation/docs/mock-apps/services/process-object-event.md b/documentation/docs/mock-apps/services/process-object-event.md index ca1a6410a..f8c1084de 100644 --- a/documentation/docs/mock-apps/services/process-object-event.md +++ b/documentation/docs/mock-apps/services/process-object-event.md @@ -75,7 +75,7 @@ P-->>C: Return object event VC and resolver URL "dlrAPIUrl": "https://dlr.example.com/api", "dlrAPIKey": "dlr-api-key-12345", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "identifierKeyPath": "/0/id" } diff --git a/documentation/docs/mock-apps/services/process-traceability-event.md b/documentation/docs/mock-apps/services/process-traceability-event.md index 0e69f25e7..5c388a2e9 100644 --- a/documentation/docs/mock-apps/services/process-traceability-event.md +++ b/documentation/docs/mock-apps/services/process-traceability-event.md @@ -69,7 +69,7 @@ P-->>C: Return event VC and resolver URL "dlrAPIUrl": "https://dlr.example.com/api", "dlrAPIKey": "dlr-api-key-12345", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "identifierKeyPath": "/0/id", "eventTypePath": "/0/type/0" diff --git a/documentation/docs/mock-apps/services/process-transaction-event.md b/documentation/docs/mock-apps/services/process-transaction-event.md index 2b6d666ed..022147f84 100644 --- a/documentation/docs/mock-apps/services/process-transaction-event.md +++ b/documentation/docs/mock-apps/services/process-transaction-event.md @@ -77,7 +77,7 @@ P-->>C: Return VC and resolver URL "dlrAPIUrl": "https://dlr.example.com/api", "dlrAPIKey": "dlr-api-key-12345", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "identifierKeyPath": "/0/transactionId", "localStorageParams": { diff --git a/documentation/docs/mock-apps/services/process-transformation-event-only.md b/documentation/docs/mock-apps/services/process-transformation-event-only.md index 2f49799a8..e3f85e02a 100644 --- a/documentation/docs/mock-apps/services/process-transformation-event-only.md +++ b/documentation/docs/mock-apps/services/process-transformation-event-only.md @@ -71,7 +71,7 @@ P-->>C: Return transformation event VC and resolver URL "dlrAPIUrl": "https://dlr.example.com/api", "dlrAPIKey": "dlr-api-key-12345", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "identifierKeyPath": "/0/id" } diff --git a/documentation/docs/mock-apps/services/process-transformation-event.md b/documentation/docs/mock-apps/services/process-transformation-event.md index 065685f2a..1e0deb9e3 100644 --- a/documentation/docs/mock-apps/services/process-transformation-event.md +++ b/documentation/docs/mock-apps/services/process-transformation-event.md @@ -71,7 +71,7 @@ P-->>C: Return EPCIS VC "dlrAPIUrl": "https://dlr.example.com/api", "dlrAPIKey": "dlr-api-key-12345", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { "url": "http://localhost:3334/v1/documents", diff --git a/e2e/constant.ts b/e2e/constant.ts index c7a16cc98..abb1f505b 100644 --- a/e2e/constant.ts +++ b/e2e/constant.ts @@ -19,12 +19,12 @@ export const ISSUE_OBJECT_EVENT = 'Generate Object Event'; export const ISSUE_ASSOCIATION_EVENT = 'Generate Association Event'; export const ISSUE_AGGREGATION_EVENT = 'Generate Aggregation Event'; -export const DPP_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/21/12345?linkType=gs1:sustainabilityInfo'; -export const DCC_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/6789/21/12345678?linkType=gs1:certificationInfo'; -export const DFR_LINK_TYPE = 'http://localhost:3000/gs1/gln/1321202290648?linkType=gs1:locationInfo'; -export const DIA_LINK_TYPE = 'http://localhost:3000/gs1/01/09359502000010?linkType=gs1:registryEntry'; -export const TRANSACTION_EVENT_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/00001?linkType=gs1:traceability'; -export const TRANSFORMATION_EVENT_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/00005?linkType=gs1:traceability'; -export const OBJECT_EVENT_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/00002?linkType=gs1:traceability'; -export const ASSOCIATION_EVENT_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/00003?linkType=gs1:traceability'; -export const AGGREGATION_EVENT_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/00004?linkType=gs1:traceability'; +export const DPP_LINK_TYPE = 'http://localhost:3000/api/1.0.0/gs1/01/09520123456788/21/12345?linkType=gs1:sustainabilityInfo'; +export const DCC_LINK_TYPE = 'http://localhost:3000/api/1.0.0/gs1/01/09520123456788/10/6789/21/12345678?linkType=gs1:certificationInfo'; +export const DFR_LINK_TYPE = 'http://localhost:3000/api/1.0.0/gs1/gln/1321202290648?linkType=gs1:locationInfo'; +export const DIA_LINK_TYPE = 'http://localhost:3000/api/1.0.0/gs1/01/09359502000010?linkType=gs1:registryEntry'; +export const TRANSACTION_EVENT_LINK_TYPE = 'http://localhost:3000/api/1.0.0/gs1/01/09520123456788/10/00001?linkType=gs1:traceability'; +export const TRANSFORMATION_EVENT_LINK_TYPE = 'http://localhost:3000/api/1.0.0/gs1/01/09520123456788/10/00005?linkType=gs1:traceability'; +export const OBJECT_EVENT_LINK_TYPE = 'http://localhost:3000/api/1.0.0/gs1/01/09520123456788/10/00002?linkType=gs1:traceability'; +export const ASSOCIATION_EVENT_LINK_TYPE = 'http://localhost:3000/api/1.0.0/gs1/01/09520123456788/10/00003?linkType=gs1:traceability'; +export const AGGREGATION_EVENT_LINK_TYPE = 'http://localhost:3000/api/1.0.0/gs1/01/09520123456788/10/00004?linkType=gs1:traceability'; diff --git a/e2e/cypress/fixtures/app-config.json b/e2e/cypress/fixtures/app-config.json index 1b8036d06..d4bc15bfb 100644 --- a/e2e/cypress/fixtures/app-config.json +++ b/e2e/cypress/fixtures/app-config.json @@ -1392,13 +1392,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1566,13 +1566,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -2850,13 +2850,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -4382,13 +4382,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/credentials", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -4835,13 +4835,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -5292,13 +5292,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -5727,13 +5727,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -6175,13 +6175,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -6619,13 +6619,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -6648,7 +6648,7 @@ ], "identifyProvider": { "type": "gs1", - "url": "http://localhost:3001", + "url": "http://localhost:3001/api/1.0.0", "namespace": "gs1" }, "identifierSchemes": [ diff --git a/e2e/cypress/support/commands/issue-commands.ts b/e2e/cypress/support/commands/issue-commands.ts index d3f194045..cca4bdf21 100644 --- a/e2e/cypress/support/commands/issue-commands.ts +++ b/e2e/cypress/support/commands/issue-commands.ts @@ -42,7 +42,7 @@ Cypress.Commands.add( ISSUE_BITSTRING_STATUS_LIST: '/agent/issueBitstringStatusList', VCKit_URL: appService?.vckit?.vckitAPIUrl + '/credentials/issue', STORAGE_URL: appService?.storage?.url, - IDR_URL: appService?.dlr?.dlrAPIUrl + appService?.dlr?.linkRegisterPath, + IDR_URL: `${appService?.dlr?.dlrAPIUrl}/${appService?.dlr?.linkRegisterPath}`, }; cy.interceptAPI('POST', API_ENDPOINT.ISSUE_BITSTRING_STATUS_LIST, 'issueBitStringStatusList'); diff --git a/packages/components/src/constants/app-config.json b/packages/components/src/constants/app-config.json index dda8ae916..eea446444 100644 --- a/packages/components/src/constants/app-config.json +++ b/packages/components/src/constants/app-config.json @@ -108,13 +108,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -497,13 +497,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -800,13 +800,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -839,9 +839,9 @@ "id": "example:product/1234", "product": { "type": ["Product"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", + "id": "https://id.gs1.org/01/09359502000034/21/12345", "name": "EV battery 300Ah", - "registeredId": "09520123456788.21.12345", + "registeredId": "09359502000034", "idScheme": { "type": ["IdentifierScheme"], "id": "https://id.gs1.org/01/", @@ -893,7 +893,7 @@ }, "productionDate": "2024-04-25", "countryOfProduction": "AU", - "serialNumber": "12345678", + "serialNumber": "12345", "dimensions": { "weight": { "value": 10, @@ -1144,13 +1144,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/credentials", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1274,13 +1274,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1403,13 +1403,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1541,13 +1541,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1675,13 +1675,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1812,13 +1812,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1841,7 +1841,7 @@ ], "identifyProvider": { "type": "gs1", - "url": "http://localhost:3001", + "url": "http://localhost:3001/api/1.0.0", "namespace": "gs1" }, "identifierSchemes": [ diff --git a/packages/mock-app/src/constants/app-config.json b/packages/mock-app/src/constants/app-config.json index dda8ae916..eea446444 100644 --- a/packages/mock-app/src/constants/app-config.json +++ b/packages/mock-app/src/constants/app-config.json @@ -108,13 +108,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -497,13 +497,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -800,13 +800,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -839,9 +839,9 @@ "id": "example:product/1234", "product": { "type": ["Product"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", + "id": "https://id.gs1.org/01/09359502000034/21/12345", "name": "EV battery 300Ah", - "registeredId": "09520123456788.21.12345", + "registeredId": "09359502000034", "idScheme": { "type": ["IdentifierScheme"], "id": "https://id.gs1.org/01/", @@ -893,7 +893,7 @@ }, "productionDate": "2024-04-25", "countryOfProduction": "AU", - "serialNumber": "12345678", + "serialNumber": "12345", "dimensions": { "weight": { "value": 10, @@ -1144,13 +1144,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/credentials", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1274,13 +1274,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1403,13 +1403,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1541,13 +1541,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1675,13 +1675,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1812,13 +1812,13 @@ "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { - "dlrAPIUrl": "http://localhost:3000", + "dlrAPIUrl": "http://localhost:3000/api/1.0.0", "dlrAPIKey": "test123", "namespace": "gs1", - "linkRegisterPath": "/api/resolver" + "linkRegisterPath": "resolver" }, "storage": { - "url": "http://localhost:3334/v1/documents", + "url": "http://localhost:3334/api/1.0.0/documents", "params": { "bucket": "verifiable-credentials" }, @@ -1841,7 +1841,7 @@ ], "identifyProvider": { "type": "gs1", - "url": "http://localhost:3001", + "url": "http://localhost:3001/api/1.0.0", "namespace": "gs1" }, "identifierSchemes": [ diff --git a/packages/services/src/__tests__/linkResolver.test.ts b/packages/services/src/__tests__/linkResolver.test.ts index 4f153ff3e..53c78402c 100644 --- a/packages/services/src/__tests__/linkResolver.test.ts +++ b/packages/services/src/__tests__/linkResolver.test.ts @@ -32,6 +32,7 @@ describe('create link resolve service', () => { verificationPage: 'https://verify.com/dev/verifyCredential', linkType: LinkType.epcisLinkType, dlrAPIUrl: 'https://dlr.com', + linkRegisterPath: 'resolver', dlrAPIKey: 'dlr-key', namespace: 'gtin', qualifierPath: '', @@ -46,6 +47,7 @@ describe('create link resolve service', () => { mockValue.linkType, mockValue.verificationPage, mockValue.dlrAPIUrl, + mockValue.linkRegisterPath, mockValue.dlrAPIKey, mockValue.namespace, ); @@ -78,6 +80,7 @@ describe('create link resolve service', () => { verificationPage: 'https://verify.com/dev/verifyCredential', linkType: LinkType.epcisLinkType, dlrAPIUrl: 'https://dlr.com', + linkRegisterPath: 'resolver', dlrAPIKey: 'dlr-key', namespace: 'gtin', qualifierPath: '/10/ABC123', @@ -92,6 +95,7 @@ describe('create link resolve service', () => { mockValue.linkType, mockValue.verificationPage, mockValue.dlrAPIUrl, + mockValue.linkRegisterPath, mockValue.dlrAPIKey, mockValue.namespace, mockValue.qualifierPath, @@ -125,6 +129,7 @@ describe('create link resolve service', () => { verificationPage: 'https://verify.com/dev/verifyCredential', linkType: LinkType.epcisLinkType, dlrAPIUrl: 'https://dlr.com', + linkRegisterPath: 'resolver', dlrAPIKey: 'dlr-key', namespace: 'gtin', qualifierPath: '/10/ABC123', @@ -139,6 +144,7 @@ describe('create link resolve service', () => { mockValue.linkType, mockValue.verificationPage, mockValue.dlrAPIUrl, + mockValue.linkRegisterPath, mockValue.dlrAPIKey, mockValue.namespace, mockValue.qualifierPath, @@ -163,6 +169,7 @@ describe('create link resolve service', () => { linkResponses: [], qualifierPath: '', dlrAPIUrl: 'https://dlr.com', + linkRegisterPath: 'resolver', dlrAPIKey: 'dlr-key', namespace: 'gtin', }); diff --git a/packages/services/src/__tests__/mocks/constants.ts b/packages/services/src/__tests__/mocks/constants.ts index ac473e7e6..f866b5bd9 100644 --- a/packages/services/src/__tests__/mocks/constants.ts +++ b/packages/services/src/__tests__/mocks/constants.ts @@ -43,7 +43,7 @@ export const contextTransformationEvent = { dlrAPIUrl: 'http://localhost', dlrAPIKey: '5555555555555', namespace: 'gs1', - linkRegisterPath: '/api/resolver', + linkRegisterPath: 'resolver', }, storage: { url: 'https://storage.example.com', @@ -143,7 +143,7 @@ export const contextDPP = { dlrAPIUrl: 'http://dlr.example.com', dlrAPIKey: '1234', namespace: 'gs1', - linkRegisterPath: '/api/resolver', + linkRegisterPath: 'resolver', }, storage: { url: 'https://storage.example.com', @@ -235,7 +235,7 @@ export const traceabilityEventContext = { dlrAPIUrl: 'https://dlr.example.com/api', dlrAPIKey: 'dlr-api-key-12345', namespace: 'gs1', - linkRegisterPath: '/api/resolver', + linkRegisterPath: 'resolver', }, identifierKeyPath: '/0/id', }; @@ -256,7 +256,7 @@ export const digitalIdentityAnchorContext = { dlrAPIUrl: 'http://dlr.example.com', dlrAPIKey: '1234', namespace: 'gs1', - linkRegisterPath: '/api/resolver', + linkRegisterPath: 'resolver', }, storage: { url: 'https://storage.example.com', @@ -281,7 +281,7 @@ export const digitalFacilityRecordContext = { dlrAPIUrl: 'http://dlr.example.com', dlrAPIKey: '1234', namespace: 'gs1', - linkRegisterPath: '/api/resolver', + linkRegisterPath: 'resolver', }, storage: { url: 'https://storage.example.com', @@ -306,7 +306,7 @@ export const digitalConformityCredentialContext = { dlrAPIUrl: 'http://dlr.example.com', dlrAPIKey: '1234', namespace: 'gs1', - linkRegisterPath: '/api/resolver', + linkRegisterPath: 'resolver', }, storage: { url: 'https://storage.example.com', diff --git a/packages/services/src/__tests__/processDPP.test.ts b/packages/services/src/__tests__/processDPP.test.ts index c1f535426..d9c307f26 100644 --- a/packages/services/src/__tests__/processDPP.test.ts +++ b/packages/services/src/__tests__/processDPP.test.ts @@ -125,6 +125,7 @@ describe('processDPP', () => { LinkType.sustainabilityInfo, dppContext.dlrVerificationPage, dlrContext.dlrAPIUrl, + dlrContext.linkRegisterPath, dlrContext.dlrAPIKey, dlrContext.namespace, dataDPP.qualifierPath, diff --git a/packages/services/src/__tests__/transformationEvent.test.ts b/packages/services/src/__tests__/transformationEvent.test.ts index 61f848a8c..918b9cd97 100644 --- a/packages/services/src/__tests__/transformationEvent.test.ts +++ b/packages/services/src/__tests__/transformationEvent.test.ts @@ -238,6 +238,7 @@ describe('Transformation event', () => { dlrAPIUrl: 'https://dlr.example.com', dlrAPIKey: 'test-api-key', namespace: 'test-namespace', + linkRegisterPath: 'resolver', }; const mockTransformationEventCredential = { mappingFields: [ @@ -293,6 +294,7 @@ describe('Transformation event', () => { dlrAPIUrl: 'https://dlr.example.com', dlrAPIKey: 'test-api-key', namespace: 'test-namespace', + linkRegisterPath: 'resolver', }; const mockTransformationEventCredential = { mappingFields: [ diff --git a/packages/services/src/epcisEvents/aggregationEvent.ts b/packages/services/src/epcisEvents/aggregationEvent.ts index 7bf29038a..cd5d2efbf 100644 --- a/packages/services/src/epcisEvents/aggregationEvent.ts +++ b/packages/services/src/epcisEvents/aggregationEvent.ts @@ -57,6 +57,7 @@ export const processAggregationEvent: IService = async ( LinkType.traceability, traceabilityEvent.dlrVerificationPage, dlr.dlrAPIUrl, + dlr.linkRegisterPath, dlr.dlrAPIKey, dlr.namespace, qualifierPath, diff --git a/packages/services/src/epcisEvents/associationEvent.ts b/packages/services/src/epcisEvents/associationEvent.ts index 6efa9aae4..9e4caddf3 100644 --- a/packages/services/src/epcisEvents/associationEvent.ts +++ b/packages/services/src/epcisEvents/associationEvent.ts @@ -66,6 +66,7 @@ export const processAssociationEvent: IService = async ( LinkType.traceability, traceabilityEvent.dlrVerificationPage, dlr.dlrAPIUrl, + dlr.linkRegisterPath, dlr.dlrAPIKey, dlr.namespace, qualifierPath, diff --git a/packages/services/src/epcisEvents/objectEvent.ts b/packages/services/src/epcisEvents/objectEvent.ts index d18d4b4a4..9232145cb 100644 --- a/packages/services/src/epcisEvents/objectEvent.ts +++ b/packages/services/src/epcisEvents/objectEvent.ts @@ -66,6 +66,7 @@ export const processObjectEvent: IService = async ( LinkType.traceability, traceabilityEvent.dlrVerificationPage, dlr.dlrAPIUrl, + dlr.linkRegisterPath, dlr.dlrAPIKey, dlr.namespace, qualifierPath, diff --git a/packages/services/src/epcisEvents/transactionEvent.ts b/packages/services/src/epcisEvents/transactionEvent.ts index 647c23574..56be15e8c 100644 --- a/packages/services/src/epcisEvents/transactionEvent.ts +++ b/packages/services/src/epcisEvents/transactionEvent.ts @@ -58,6 +58,7 @@ export const processTransactionEvent: IService = async ( LinkType.traceability, traceabilityEvent.dlrVerificationPage, dlr.dlrAPIUrl, + dlr.linkRegisterPath, dlr.dlrAPIKey, dlr.namespace, qualifierPath, diff --git a/packages/services/src/epcisEvents/transformationEvent.ts b/packages/services/src/epcisEvents/transformationEvent.ts index 80c1b3e87..e334f61cf 100644 --- a/packages/services/src/epcisEvents/transformationEvent.ts +++ b/packages/services/src/epcisEvents/transformationEvent.ts @@ -83,6 +83,7 @@ export const processTransformationEvent: IService = async ( LinkType.traceability, epcisTransformationEventContext.dlrVerificationPage, dlrContext.dlrAPIUrl, + dlrContext.linkRegisterPath, dlrContext.dlrAPIKey, dlrContext.namespace, transformationEventQualifierPath, @@ -110,6 +111,7 @@ export const processTransformationEvent: IService = async ( LinkType.sustainabilityInfo, dppContext.dlrVerificationPage, dlrContext.dlrAPIUrl, + dlrContext.linkRegisterPath, dlrContext.dlrAPIKey, dlrContext.namespace, qualifierPath, diff --git a/packages/services/src/epcisEvents/transformationEventOnly.ts b/packages/services/src/epcisEvents/transformationEventOnly.ts index 0bcfd561a..1b21bcb17 100644 --- a/packages/services/src/epcisEvents/transformationEventOnly.ts +++ b/packages/services/src/epcisEvents/transformationEventOnly.ts @@ -66,6 +66,7 @@ export const processTransformationEventOnly: IService = async ( LinkType.traceability, traceabilityEvent.dlrVerificationPage, dlr.dlrAPIUrl, + dlr.linkRegisterPath, dlr.dlrAPIKey, dlr.namespace, qualifierPath, diff --git a/packages/services/src/linkResolver.service.ts b/packages/services/src/linkResolver.service.ts index de89c0f44..f02432720 100644 --- a/packages/services/src/linkResolver.service.ts +++ b/packages/services/src/linkResolver.service.ts @@ -102,7 +102,7 @@ export const createLinkResolver = async (arg: ICreateLinkResolver): Promise 0 + ? `${dlrAPIUrl}/${linkRegisterPath}` + : dlrAPIUrl; + privateAPI.setBearerTokenAuthorizationHeaders(arg.dlrAPIKey || ''); - await privateAPI.post(`${dlrAPIUrl}${linkRegisterPath}`, params); + await privateAPI.post(url, params); const linkTypeQuery = responseLinkType === 'all' ? 'all' : `${namespace}:${responseLinkType}`; const path = qualifierPath.includes('?') @@ -181,6 +186,7 @@ export const registerLinkResolver = async ( linkType: LinkType, verificationPage: string, dlrAPIUrl: string, + linkRegisterPath: string | undefined, dlrAPIKey: string, namespace: string, qualifierPath?: string, @@ -218,6 +224,7 @@ export const registerLinkResolver = async ( return await createLinkResolver({ dlrAPIUrl, + linkRegisterPath, namespace, linkResolver, linkResponses, @@ -226,42 +233,59 @@ export const registerLinkResolver = async ( responseLinkType, }); }; + /** * Function to fetch the DLR passport data from the provided DLR URL. * @param dlrUrl The DLR URL from which to fetch the passport data. * @returns The DLR passport data if found, otherwise returns null. */ export const getDlrPassport = async (dlrUrl: string): Promise => { + // Extract the root domain from the DLR URL const rootDlrDomain = extractDomain(dlrUrl); - // Fetch DLR data from the provided DLR URL + // Fetch the linkset const dlrData = await privateAPI.get(dlrUrl); - if (!dlrData) { + if (!dlrData?.linkset) { return null; } - // Find certificate passports in the DLR data - const certificatePassports = dlrData?.linkset?.find( - (linkSetItem: any) => linkSetItem[`${rootDlrDomain}/${GS1ServiceEnum.sustainabilityInfo}`], + // Define the suffix we care about (Product Passport Link Type) + const serviceSuffix = `/${GS1ServiceEnum.sustainabilityInfo}`; + + // Find the first linkset entry whose key matches the domain + suffix + const certificatePassports = dlrData.linkset.find((item: any) => + Object.keys(item).some(key => + key.includes(rootDlrDomain) && + key.endsWith(serviceSuffix) + ) ); if (!certificatePassports) { return null; } - // Extract passport infos from certificate passports - const dlrPassports = certificatePassports[`${rootDlrDomain}/${GS1ServiceEnum.sustainabilityInfo}`]; - if (!dlrPassports) { + // Extract the key + const passportKey = Object + .keys(certificatePassports) + .find(key => + key.includes(rootDlrDomain) && + key.endsWith(serviceSuffix) + ); + if (!passportKey) { return null; } - // Find DLR passport with MIME type text/html - const dlrPassport = dlrPassports.find((passportItem: any) => passportItem?.type === MimeTypeEnum.textHtml); - if (!dlrPassport) { + // Grab the array of passports + const dlrPassports = certificatePassports[passportKey]; + if (!Array.isArray(dlrPassports)) { return null; } - // Return the found DLR passport - return dlrPassport; + // Return the first text/html passport we find (Human-friendly format) + const dlrPassport = (dlrPassports).find( + p => p.type === MimeTypeEnum.textHtml + ); + + return (dlrPassport as T) ?? null; }; /** diff --git a/packages/services/src/processDPP.service.ts b/packages/services/src/processDPP.service.ts index d44c45564..b9889f9b2 100644 --- a/packages/services/src/processDPP.service.ts +++ b/packages/services/src/processDPP.service.ts @@ -62,6 +62,7 @@ export const processDPP: IService = async (data: any, context: IDppContext): Pro LinkType.sustainabilityInfo, dppContext.dlrVerificationPage, linkResolverContext.dlrAPIUrl, + linkResolverContext.linkRegisterPath, linkResolverContext.dlrAPIKey, linkResolverContext.namespace, qualifierPath, diff --git a/packages/services/src/processDigitalConformityCredential.service.ts b/packages/services/src/processDigitalConformityCredential.service.ts index abfa52f42..dd735ee87 100644 --- a/packages/services/src/processDigitalConformityCredential.service.ts +++ b/packages/services/src/processDigitalConformityCredential.service.ts @@ -67,6 +67,7 @@ export const processDigitalConformityCredential: IService = async ( LinkType.certificationLinkType, digitalConformityCredential.dlrVerificationPage, dlr.dlrAPIUrl, + dlr.linkRegisterPath, dlr.dlrAPIKey, dlr.namespace, qualifierPath, diff --git a/packages/services/src/processDigitalFacilityRecord.service.ts b/packages/services/src/processDigitalFacilityRecord.service.ts index 3757cdbe9..59c658ee3 100644 --- a/packages/services/src/processDigitalFacilityRecord.service.ts +++ b/packages/services/src/processDigitalFacilityRecord.service.ts @@ -67,6 +67,7 @@ export const processDigitalFacilityRecord: IService = async ( LinkType.locationInfo, digitalFacilityRecord.dlrVerificationPage, dlr.dlrAPIUrl, + dlr.linkRegisterPath, dlr.dlrAPIKey, dlr.namespace, qualifierPath, diff --git a/packages/services/src/processDigitalIdentityAnchor.service.ts b/packages/services/src/processDigitalIdentityAnchor.service.ts index 366759a12..c1376c30c 100644 --- a/packages/services/src/processDigitalIdentityAnchor.service.ts +++ b/packages/services/src/processDigitalIdentityAnchor.service.ts @@ -67,6 +67,7 @@ export const processDigitalIdentityAnchor: IService = async ( LinkType.registryEntry, digitalIdentityAnchor.dlrVerificationPage, dlr.dlrAPIUrl, + dlr.linkRegisterPath, dlr.dlrAPIKey, dlr.namespace, qualifierPath, diff --git a/seeding/idr-data.sh b/seeding/idr-data.sh index 049a46c06..154778b7c 100755 --- a/seeding/idr-data.sh +++ b/seeding/idr-data.sh @@ -28,7 +28,7 @@ while true; do fi # Make the health check request and store the status - HEALTH_STATUS=$(curl -s http://${IDR_SERVICE_HOST}:${IDR_SERVICE_PORT}/health-check | grep -o '"status":"OK"') + HEALTH_STATUS=$(curl -s http://${IDR_SERVICE_HOST}:${IDR_SERVICE_PORT}/api/${IDR_SERVICE_API_VERSION}/health-check | grep -o '"status":"OK"') if [ "$HEALTH_STATUS" = '"status":"OK"' ]; then echo "${SERVICE_NAME} service is healthy!" break @@ -43,21 +43,21 @@ echo "${SERVICE_NAME} service is seeding data…" # Execute create identifier request with JSON data from a file curl -X POST \ - http://${IDR_SERVICE_HOST}:${IDR_SERVICE_PORT}/api/identifiers \ + http://${IDR_SERVICE_HOST}:${IDR_SERVICE_PORT}/api/${IDR_SERVICE_API_VERSION}/identifiers \ -H 'accept: application/json' \ -H "Authorization: Bearer ${IDR_SERVICE_API_KEY}" \ -H 'Content-Type: application/json' \ -d @"$GS1_IDENTIFIER_FILE" curl -X POST \ - http://${IDR_SERVICE_HOST}:${IDR_SERVICE_PORT}/api/identifiers \ + http://${IDR_SERVICE_HOST}:${IDR_SERVICE_PORT}/api/${IDR_SERVICE_API_VERSION}/identifiers \ -H 'accept: application/json' \ -H "Authorization: Bearer ${IDR_SERVICE_API_KEY}" \ -H 'Content-Type: application/json' \ -d @"$NLIS_IDENTIFIER_FILE" curl -X POST \ - http://${IDR_SERVICE_HOST}:${IDR_SERVICE_PORT}/api/identifiers \ + http://${IDR_SERVICE_HOST}:${IDR_SERVICE_PORT}/api/${IDR_SERVICE_API_VERSION}/identifiers \ -H 'accept: application/json' \ -H "Authorization: Bearer ${IDR_SERVICE_API_KEY}" \ -H 'Content-Type: application/json' \ diff --git a/seeding/mock-gs1-data.sh b/seeding/mock-gs1-data.sh index 999401e04..8fa0ecc65 100755 --- a/seeding/mock-gs1-data.sh +++ b/seeding/mock-gs1-data.sh @@ -24,7 +24,7 @@ while true; do fi # Make the health check request - HEALTH_STATUS=$(curl -s http://${MOCK_GS1_SERVICE_HOST}:${MOCK_GS1_SERVICE_PORT}/health-check | grep -o '"status":"OK"') + HEALTH_STATUS=$(curl -s http://${MOCK_GS1_SERVICE_HOST}:${MOCK_GS1_SERVICE_PORT}/api/${MOCK_GS1_SERVICE_API_VERSION}/health-check | grep -o '"status":"OK"') if [ "$HEALTH_STATUS" = '"status":"OK"' ]; then echo "${SERVICE_NAME} service is healthy!" break @@ -39,7 +39,7 @@ echo "${SERVICE_NAME} service is seeding data…" # Execute create identifier request curl -X POST \ - http://${MOCK_GS1_SERVICE_HOST}:${MOCK_GS1_SERVICE_PORT}/api/identifiers \ + http://${MOCK_GS1_SERVICE_HOST}:${MOCK_GS1_SERVICE_PORT}/api/${MOCK_GS1_SERVICE_API_VERSION}/identifiers \ -H 'accept: application/json' \ -H "Authorization: Bearer ${MOCK_GS1_SERVICE_API_KEY}" \ -H 'Content-Type: application/json' \ @@ -51,7 +51,7 @@ printf "\n" # Loop through JSON file and make curl requests for each identification jq -c '.[]' "$IDENTIFICATIONS_FILE" | while read -r IDENTIFICATION; do curl -X POST \ - "http://${MOCK_GS1_SERVICE_HOST}:${MOCK_GS1_SERVICE_PORT}/api/resolver" \ + "http://${MOCK_GS1_SERVICE_HOST}:${MOCK_GS1_SERVICE_PORT}/api/${MOCK_GS1_SERVICE_API_VERSION}/resolver" \ -H 'accept: application/json' \ -H "Authorization: Bearer ${MOCK_GS1_SERVICE_API_KEY}" \ -H 'Content-Type: application/json' \ diff --git a/seeding/mock-gs1-link-resolver.json b/seeding/mock-gs1-link-resolver.json index 72cbfeab4..d2a2832be 100755 --- a/seeding/mock-gs1-link-resolver.json +++ b/seeding/mock-gs1-link-resolver.json @@ -18,7 +18,7 @@ "ianaLanguage": "en", "context": "us", "title": "Digital Identity Resolver Service", - "targetUrl": "http://localhost:3000/gs1", + "targetUrl": "http://localhost:3000/api/1.0.0/gs1", "mimeType": "text/plain" } ] @@ -42,7 +42,7 @@ "ianaLanguage": "en", "context": "us", "title": "Digital Identity Resolver Service", - "targetUrl": "http://localhost:3000/gs1", + "targetUrl": "http://localhost:3000/api/1.0.0/gs1", "mimeType": "text/plain" } ] @@ -66,7 +66,7 @@ "ianaLanguage": "en", "context": "us", "title": "Digital Identity Resolver Service", - "targetUrl": "http://localhost:3000/gs1", + "targetUrl": "http://localhost:3000/api/1.0.0/gs1", "mimeType": "text/plain" } ] diff --git a/version.json b/version.json index 497da1f0a..65090f900 100644 --- a/version.json +++ b/version.json @@ -4,11 +4,11 @@ "dependencies": { "vckit": { "repoUrl": "https://github.com/uncefact/project-vckit.git", - "versions": ["1.0.0"] + "versions": ["1.1.0"] }, "storage-service": { "repoUrl": "https://github.com/uncefact/project-identity-resolver.git", - "versions": ["1.0.0"] + "versions": ["1.0.1"] }, "idr": { "repoUrl": "https://github.com/pyx-industries/pyx-identity-resolver.git",