Skip to content

Commit

Permalink
allow revocation verification
Browse files Browse the repository at this point in the history
  • Loading branch information
F-Node-Karlsruhe committed Jan 3, 2023
1 parent ae93ec8 commit ee67e57
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 4 deletions.
53 changes: 53 additions & 0 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"dependencies": {
"@digitalbazaar/ed25519-signature-2020": "^5.0.0",
"@digitalbazaar/vc": "^5.0.0",
"@digitalbazaar/vc-revocation-list": "^5.0.0",
"cors": "^2.8.5",
"did-resolver": "^4.0.1",
"dotenv": "^16.0.1",
Expand Down
5 changes: 3 additions & 2 deletions api/src/services/documentLoader/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-ignore
import jsonldSignatures from 'jsonld-signatures';
import { getResolver } from './didresolver.js'
import { getResolver } from './didresolver.js';
import { fetch_get } from '../fetch/index.js';

const TRUSTED_CONTEXT_DOMAINS: [string] = ['https://ssi.eecc.de']

Expand Down Expand Up @@ -49,7 +50,7 @@ const documentLoader: Promise<any> = jsonldSignatures.extendContextLoader(async
// fetch if not in cache
if (!document) {

document = await(await fetch(url)).json();
document = await(await fetch_get(url)).json();

// cache and warn if external
if (!TRUSTED_CONTEXT_DOMAINS.some((trusted) => url.startsWith(trusted))) {
Expand Down
4 changes: 3 additions & 1 deletion api/src/services/verifier/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { verifyCredential } from '@digitalbazaar/vc';
// @ts-ignore
import { Ed25519Signature2020 } from '@digitalbazaar/ed25519-signature-2020';
// @ts-ignore
import { checkStatus } from '@digitalbazaar/vc-revocation-list';

import { documentLoader } from '../documentLoader/index.js';

Expand All @@ -12,7 +14,7 @@ export class VCVerifier {
// TODO choose suite based on proofType
const suite = new Ed25519Signature2020();

const result = await verifyCredential({credential, suite, documentLoader});
const result = await verifyCredential({credential, suite, documentLoader, checkStatus});

return result
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createStore } from 'vuex'

export default createStore({
state: {
version: '0.3.5',
version: '0.4.0',
credentials: [],
VC_REGISTRY: process.env.VC_REGISTRY || 'https://ssi.eecc.de/api/registry/vcs/',
showQRModal: false
Expand Down

0 comments on commit ee67e57

Please sign in to comment.