Skip to content

Commit b17fbc5

Browse files
authored
Merge pull request #240 from SolidLabResearch/development
Merging for v2.1.1
2 parents cfb2bc6 + e438fda commit b17fbc5

File tree

8 files changed

+43147
-45014
lines changed

8 files changed

+43147
-45014
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.1.1] - 2025-10-14
11+
12+
### Changed
13+
14+
- Verifiable credentials use VC prototyping library now (#238).
15+
1016
## [2.1.0] - 2025-09-25
1117

1218
### Added
@@ -284,4 +290,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
284290
[1.7.0]: https://github.com/SolidLabResearch/miravi-a-linked-data-viewer/releases/tag/v1.7.0
285291
[2.0.0]: https://github.com/SolidLabResearch/miravi-a-linked-data-viewer/releases/tag/v2.0.0
286292
[2.1.0]: https://github.com/SolidLabResearch/miravi-a-linked-data-viewer/releases/tag/v2.1.0
287-
[Unreleased]: https://github.com/SolidLabResearch/miravi-a-linked-data-viewer/compare/v2.1.0...HEAD
293+
[2.1.1]: https://github.com/SolidLabResearch/miravi-a-linked-data-viewer/releases/tag/v2.1.1
294+
[Unreleased]: https://github.com/SolidLabResearch/miravi-a-linked-data-viewer/compare/v2.1.1...HEAD

main/src/components/ActionBar/SourceVerificationIcon/SourceVerificationIcon.jsx

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PropTypes from "prop-types";
55
import GppGoodIcon from '@mui/icons-material/GppGood';
66
import GppBadIcon from '@mui/icons-material/GppBad';
77
import GppMaybeIcon from '@mui/icons-material/GppMaybe';
8-
import { coreVerify } from '../../../vendor/vcCore';
8+
import { SolidApi } from '../../../vendor/vc-prototyping-library/solid/bundle/api';
99
import comunicaEngineWrapper from '../../../comunicaEngineWrapper/comunicaEngineWrapper';
1010
import { translateUrlToProxiedUrl } from '../../../lib/utils';
1111

@@ -16,6 +16,9 @@ const VERIFICATION_STATES = {
1616
ERROR: 'ERROR'
1717
}
1818

19+
let vcApi;
20+
let vcPublicKey;
21+
1922
/**
2023
* @param {object} props - the props passed to the component
2124
* @param {string} props.source - the source to check
@@ -38,16 +41,38 @@ function SourceVerificationIcon({ source, httpProxies }) {
3841
const verifyFunction = async (source, fetchFunction) => {
3942
try {
4043
const response = await fetchFunction(source);
41-
const verifiableCredential = await response.json();
42-
const { validationResult, verificationResult } = await coreVerify(verifiableCredential);
43-
if (validationResult.valid) {
44-
if (verificationResult.verified) {
44+
const txt = await response.text();
45+
46+
if (!vcApi) {
47+
vcApi = new SolidApi({
48+
// For verify-only application, next fields are not used, so set them to "N/A"
49+
email: "N/A", password: "N/A", css: "N/A", webId: "N/A",
50+
contentsToPreload: [
51+
{
52+
url: "https://www.w3.org/2018/credentials/v1",
53+
type: "context",
54+
document: { "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "VerifiableCredential": { "@id": "https://www.w3.org/2018/credentials#VerifiableCredential", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "cred": "https://www.w3.org/2018/credentials#", "sec": "https://w3id.org/security#", "xsd": "http://www.w3.org/2001/XMLSchema#", "credentialSchema": { "@id": "cred:credentialSchema", "@type": "@id", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "cred": "https://www.w3.org/2018/credentials#", "JsonSchemaValidator2018": "cred:JsonSchemaValidator2018" } }, "credentialStatus": { "@id": "cred:credentialStatus", "@type": "@id" }, "credentialSubject": { "@id": "cred:credentialSubject", "@type": "@id" }, "evidence": { "@id": "cred:evidence", "@type": "@id" }, "expirationDate": { "@id": "cred:expirationDate", "@type": "xsd:dateTime" }, "holder": { "@id": "cred:holder", "@type": "@id" }, "issued": { "@id": "cred:issued", "@type": "xsd:dateTime" }, "issuer": { "@id": "cred:issuer", "@type": "@id" }, "issuanceDate": { "@id": "cred:issuanceDate", "@type": "xsd:dateTime" }, "proof": { "@id": "sec:proof", "@type": "@id", "@container": "@graph" }, "refreshService": { "@id": "cred:refreshService", "@type": "@id", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "cred": "https://www.w3.org/2018/credentials#", "ManualRefreshService2018": "cred:ManualRefreshService2018" } }, "termsOfUse": { "@id": "cred:termsOfUse", "@type": "@id" }, "validFrom": { "@id": "cred:validFrom", "@type": "xsd:dateTime" }, "validUntil": { "@id": "cred:validUntil", "@type": "xsd:dateTime" } } }, "VerifiablePresentation": { "@id": "https://www.w3.org/2018/credentials#VerifiablePresentation", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "cred": "https://www.w3.org/2018/credentials#", "sec": "https://w3id.org/security#", "holder": { "@id": "cred:holder", "@type": "@id" }, "proof": { "@id": "sec:proof", "@type": "@id", "@container": "@graph" }, "verifiableCredential": { "@id": "cred:verifiableCredential", "@type": "@id", "@container": "@graph" } } }, "EcdsaSecp256k1Signature2019": { "@id": "https://w3id.org/security#EcdsaSecp256k1Signature2019", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "sec": "https://w3id.org/security#", "xsd": "http://www.w3.org/2001/XMLSchema#", "challenge": "sec:challenge", "created": { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" }, "domain": "sec:domain", "expires": { "@id": "sec:expiration", "@type": "xsd:dateTime" }, "jws": "sec:jws", "nonce": "sec:nonce", "proofPurpose": { "@id": "sec:proofPurpose", "@type": "@vocab", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "sec": "https://w3id.org/security#", "assertionMethod": { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" }, "authentication": { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" } } }, "proofValue": "sec:proofValue", "verificationMethod": { "@id": "sec:verificationMethod", "@type": "@id" } } }, "EcdsaSecp256r1Signature2019": { "@id": "https://w3id.org/security#EcdsaSecp256r1Signature2019", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "sec": "https://w3id.org/security#", "xsd": "http://www.w3.org/2001/XMLSchema#", "challenge": "sec:challenge", "created": { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" }, "domain": "sec:domain", "expires": { "@id": "sec:expiration", "@type": "xsd:dateTime" }, "jws": "sec:jws", "nonce": "sec:nonce", "proofPurpose": { "@id": "sec:proofPurpose", "@type": "@vocab", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "sec": "https://w3id.org/security#", "assertionMethod": { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" }, "authentication": { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" } } }, "proofValue": "sec:proofValue", "verificationMethod": { "@id": "sec:verificationMethod", "@type": "@id" } } }, "Ed25519Signature2018": { "@id": "https://w3id.org/security#Ed25519Signature2018", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "sec": "https://w3id.org/security#", "xsd": "http://www.w3.org/2001/XMLSchema#", "challenge": "sec:challenge", "created": { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" }, "domain": "sec:domain", "expires": { "@id": "sec:expiration", "@type": "xsd:dateTime" }, "jws": "sec:jws", "nonce": "sec:nonce", "proofPurpose": { "@id": "sec:proofPurpose", "@type": "@vocab", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "sec": "https://w3id.org/security#", "assertionMethod": { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" }, "authentication": { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" } } }, "proofValue": "sec:proofValue", "verificationMethod": { "@id": "sec:verificationMethod", "@type": "@id" } } }, "RsaSignature2018": { "@id": "https://w3id.org/security#RsaSignature2018", "@context": { "@version": 1.1, "@protected": true, "challenge": "sec:challenge", "created": { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" }, "domain": "sec:domain", "expires": { "@id": "sec:expiration", "@type": "xsd:dateTime" }, "jws": "sec:jws", "nonce": "sec:nonce", "proofPurpose": { "@id": "sec:proofPurpose", "@type": "@vocab", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", "sec": "https://w3id.org/security#", "assertionMethod": { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" }, "authentication": { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" } } }, "proofValue": "sec:proofValue", "verificationMethod": { "@id": "sec:verificationMethod", "@type": "@id" } } }, "proof": { "@id": "https://w3id.org/security#proof", "@type": "@id", "@container": "@graph" } } }
55+
},
56+
{
57+
url: "https://w3id.org/security/data-integrity/v2",
58+
type: "context",
59+
document: { "@context": { "id": "@id", "type": "@type", "@protected": true, "proof": { "@id": "https://w3id.org/security#proof", "@type": "@id", "@container": "@graph" }, "DataIntegrityProof": { "@id": "https://w3id.org/security#DataIntegrityProof", "@context": { "@protected": true, "id": "@id", "type": "@type", "challenge": "https://w3id.org/security#challenge", "created": { "@id": "http://purl.org/dc/terms/created", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }, "domain": "https://w3id.org/security#domain", "expires": { "@id": "https://w3id.org/security#expiration", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }, "nonce": "https://w3id.org/security#nonce", "previousProof": { "@id": "https://w3id.org/security#previousProof", "@type": "@id" }, "proofPurpose": { "@id": "https://w3id.org/security#proofPurpose", "@type": "@vocab", "@context": { "@protected": true, "id": "@id", "type": "@type", "assertionMethod": { "@id": "https://w3id.org/security#assertionMethod", "@type": "@id", "@container": "@set" }, "authentication": { "@id": "https://w3id.org/security#authenticationMethod", "@type": "@id", "@container": "@set" }, "capabilityInvocation": { "@id": "https://w3id.org/security#capabilityInvocationMethod", "@type": "@id", "@container": "@set" }, "capabilityDelegation": { "@id": "https://w3id.org/security#capabilityDelegationMethod", "@type": "@id", "@container": "@set" }, "keyAgreement": { "@id": "https://w3id.org/security#keyAgreementMethod", "@type": "@id", "@container": "@set" } } }, "cryptosuite": { "@id": "https://w3id.org/security#cryptosuite", "@type": "https://w3id.org/security#cryptosuiteString" }, "proofValue": { "@id": "https://w3id.org/security#proofValue", "@type": "https://w3id.org/security#multibase" }, "verificationMethod": { "@id": "https://w3id.org/security#verificationMethod", "@type": "@id" } } } } }
60+
}
61+
]
62+
});
63+
vcPublicKey = await vcApi.retrievePublicKey();
64+
}
65+
66+
const verificationResult = await vcApi.verify({ contentType: 'application/ld+json', content: txt }, vcPublicKey);
67+
switch (verificationResult) {
68+
case 'pass':
4569
return VERIFICATION_STATES.VERIFIED;
46-
} else {
70+
case 'fail':
4771
return VERIFICATION_STATES.NOT_VERIFIED;
48-
}
49-
} else {
50-
return VERIFICATION_STATES.INVALID_SOURCE;
72+
case 'not signed':
73+
return VERIFICATION_STATES.INVALID_SOURCE;
74+
default:
75+
return VERIFICATION_STATES.ERROR;
5176
}
5277
} catch (error) {
5378
return VERIFICATION_STATES.ERROR;

main/src/components/ListResultTable/QueryResultList/TableHeader/TableHeader.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ function TableHeader({ children }) {
6464
<Link
6565
target="_blank"
6666
href={link}
67+
key={link}
6768
sx={{ height: "100%", margin: "0 0 0 5px", "& > *": { verticalAlign: "middle" } }}
6869
>
6970
<LinkIcon

0 commit comments

Comments
 (0)