Skip to content

Commit

Permalink
adds vc-bitstring-status-list context
Browse files Browse the repository at this point in the history
  • Loading branch information
kezike committed Mar 8, 2024
1 parent 89e69df commit b3c888c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"./package.json": "./package.json"
},
"dependencies": {
"@digitalbazaar/credentials-v2-context": "github:digitalbazaar/credentials-v2-context",
"@digitalbazaar/credentials-v2-context": "github:digitalbazaar/credentials-v2-context#main",
"@digitalbazaar/http-client": "^4.1.0",
"@digitalbazaar/vc-bitstring-status-list-context": "^1.0.0",
"@digitalbazaar/vc-status-list-context": "^3.0.1",
"@digitalcredentials/crypto-ld": "^7.0.2",
"@digitalcredentials/dcc-context": "^1.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ declare module '@digitalcredentials/dcc-context';
declare module '@digitalcredentials/did-io';
declare module '@digitalcredentials/did-method-key';
declare module '@digitalcredentials/vc';
declare module '@digitalbazaar/vc-bitstring-status-list-context';
declare module '@digitalcredentials/vc-status-list';
declare module '@digitalbazaar/vc-status-list-context';
declare module '@digitalcredentials/vpqr';
Expand Down
27 changes: 12 additions & 15 deletions src/documentLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
* Copyright (c) 2021 Interop Alliance and Dmitri Zagidulin. All rights reserved.
*/
import * as didKey from '@digitalcredentials/did-method-key';
import * as didWeb from '@interop/did-web-resolver';
import * as vc1Context from 'credentials-context';
import * as vc2Context from '@digitalbazaar/credentials-v2-context';
import * as vcBitstringStatusListCtx from '@digitalbazaar/vc-bitstring-status-list-context';
import vcStatusListCtx from '@digitalbazaar/vc-status-list-context';
import { Ed25519VerificationKey2020 }
from '@digitalcredentials/ed25519-verification-key-2020';
import { X25519KeyAgreementKey2020 }
Expand All @@ -11,27 +16,17 @@ import dccCtx from '@digitalcredentials/dcc-context';
import didContext from 'did-context';
import ed25519 from 'ed25519-signature-2020-context';
import x25519 from 'x25519-key-agreement-2020-context';
import cred from 'credentials-context';
import vcStatusListCtx from '@digitalbazaar/vc-status-list-context';
import { JsonLdDocumentLoader } from 'jsonld-document-loader';
import { CryptoLD } from '@digitalcredentials/crypto-ld';
import * as didWeb from '@interop/did-web-resolver';
import { parseResponseBody } from './parseResponse';
import obCtx from '@digitalcredentials/open-badges-context';
import { httpClient } from '@digitalbazaar/http-client';
import * as vc2Context from '@digitalbazaar/credentials-v2-context';
import { parseResponseBody } from './parseResponse';

const cryptoLd = new CryptoLD();
cryptoLd.use(Ed25519VerificationKey2020);
cryptoLd.use(X25519KeyAgreementKey2020);
const didWebDriver = didWeb.driver({ cryptoLd });

const {
contexts: credentialsContext,
constants: {
CREDENTIALS_CONTEXT_V1_URL,
},
} = cred;
const didKeyDriver = didKey.driver();
const resolver = new CachedResolver();
resolver.use(didKeyDriver);
Expand Down Expand Up @@ -103,15 +98,17 @@ export function securityLoader({ fetchRemoteContexts = false, useOBv3BetaContext
);

// Verifiable Credentials Data Model 1.0
loader.addStatic(
CREDENTIALS_CONTEXT_V1_URL,
credentialsContext.get(CREDENTIALS_CONTEXT_V1_URL),
);
loader.addStatic(vc1Context.CONTEXT_URL, vc1Context.CONTEXT);

// Verifiable Credentials Data Model 2.0 - BETA / non-final
loader.addStatic(vc2Context.CONTEXT_URL, vc2Context.CONTEXT);

loader.addStatic(dccCtx.CONTEXT_URL_V1, dccCtx.CONTEXT_V1);

// Bitstring Status List
loader.addStatic(vcBitstringStatusListCtx.CONTEXT_URL, vcBitstringStatusListCtx.CONTEXT);

// Status List 2021 (DEPRECATED)
loader.addStatic(vcStatusListCtx.CONTEXT_URL_V1, vcStatusListCtx.CONTEXT_V1);

// Open Badges v3 Contexts, includes OBv3 Beta, 3.0, 3.0.1, 3.0.2, etc.
Expand Down

0 comments on commit b3c888c

Please sign in to comment.