diff --git a/CHANGELOG.md b/CHANGELOG.md index f39020e..abd17bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ WIP 2.0.0 (2024-07-23) - add gs1 verification endpoint +- use gs1 endpoint on gs1 credential 1.7.8 (2024-06-13) --- diff --git a/api/src/services/verifier/gs1.ts b/api/src/services/verifier/gs1.ts index a96f999..d1fb16f 100644 --- a/api/src/services/verifier/gs1.ts +++ b/api/src/services/verifier/gs1.ts @@ -14,23 +14,7 @@ import { import { documentLoader } from "../documentLoader/index.js"; import { Verifier } from "./index.js"; -export const gs1CredentialTypes = [ - "OrganizationDataCredential", - "GS1PrefixLicenseCredential", - "GS1CompanyPrefixLicenseCredential", - "KeyCredential", - "ProductDataCredential", -]; -export const gs1CredentialContext = - "https://ref.gs1.org/gs1/vc/license-context"; - -export function isGs1Credential(credential: VerifiableCredential): boolean { - return ( - credential["@context"].includes(gs1CredentialContext) && - credential.type.some((type: string) => gs1CredentialTypes.includes(type)) - ); -} export function getVerifierFunction(challenge?: string, domain?: string) { return async function (verifiable: any) { return await Verifier.verify(verifiable, challenge, domain); diff --git a/api/src/services/verifier/index.ts b/api/src/services/verifier/index.ts index 80105ef..023fe2e 100644 --- a/api/src/services/verifier/index.ts +++ b/api/src/services/verifier/index.ts @@ -16,11 +16,6 @@ import { DataIntegrityProof } from "@digitalbazaar/data-integrity"; import jsigs from "jsonld-signatures"; import { documentLoader } from "../documentLoader/index.js"; -import { - isGs1Credential, - checkGS1Credential, - verifyGS1Credentials, -} from "./gs1.js"; const { createVerifyCryptosuite } = ecdsaSd2023Cryptosuite; const { diff --git a/frontend/src/api.js b/frontend/src/api.js index e067c0b..d9d5bd5 100644 --- a/frontend/src/api.js +++ b/frontend/src/api.js @@ -1,6 +1,6 @@ import axios from 'axios' const axiosInstance = axios.create({ - baseURL: process.env.VERIFIER_API || 'https://ssi.eecc.de/api/verifier', + baseURL: process.env.VERIFIER_API || 'http://localhost:3000/api/verifier', timeout: 5000, headers: { 'Accept': 'application/ld+json,application/json,*/*' diff --git a/frontend/src/components/Credential.vue b/frontend/src/components/Credential.vue index a63ff07..2a266c1 100644 --- a/frontend/src/components/Credential.vue +++ b/frontend/src/components/Credential.vue @@ -6,7 +6,8 @@