Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update the getDlrPassport function to extract link resolver from sustainabilityInfo instead of certificationInfo link type #179

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ services:

mock-global-gs1-resolver-object-store:
image: quay.io/minio/minio:RELEASE.2024-08-17T01-24-54Z-cpuv1
command: server /data --console-address ":9091"
command: server /data --console-address ":9090"
ports:
- '9001:9000'
- '9091:9090'
Expand Down
1 change: 1 addition & 0 deletions packages/services/src/identityProviders/GS1Provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum GS1ServiceEnum {
certificationInfo = 'voc/certificationInfo',
verificationService = 'voc/verificationService',
serviceInfo = 'voc/serviceInfo',
sustainabilityInfo = 'voc/sustainabilityInfo'
}

export class GS1Provider implements IdentityProviderStrategy {
Expand Down
4 changes: 2 additions & 2 deletions packages/services/src/linkResolver.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ export const getDlrPassport = async <T>(dlrUrl: string): Promise<T | null> => {

// Find certificate passports in the DLR data
const certificatePassports = dlrData?.linkset?.find(
(linkSetItem: any) => linkSetItem[`${rootDlrDomain}/${GS1ServiceEnum.certificationInfo}`],
(linkSetItem: any) => linkSetItem[`${rootDlrDomain}/${GS1ServiceEnum.sustainabilityInfo}`],
);
if (!certificatePassports) {
return null;
}

// Extract passport infos from certificate passports
const dlrPassports = certificatePassports[`${rootDlrDomain}/${GS1ServiceEnum.certificationInfo}`];
const dlrPassports = certificatePassports[`${rootDlrDomain}/${GS1ServiceEnum.sustainabilityInfo}`];
if (!dlrPassports) {
return null;
}
Expand Down
Loading