Skip to content

Commit

Permalink
Merge pull request #374 from docknetwork/status-list-21-ctx
Browse files Browse the repository at this point in the history
Hardcode context for status list
  • Loading branch information
cykoder authored Oct 20, 2023
2 parents d836b44 + 2ec8dda commit a679c44
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/sdk",
"version": "6.6.0",
"version": "6.6.1",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
6 changes: 6 additions & 0 deletions src/utils/vc/contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import dockBBS23V1Context from './contexts/dock-bbs23-v1.json';
import dockPSV1Context from './contexts/dock-ps-v1.json';
import dockPrettyVCContext from './contexts/prettyvc.json';
import jws2020V1Context from './contexts/jws-2020-v1.json';
import statusList21Context from './contexts/status-list-21';

// Lookup of following URLs will lead to loading data from the context directory, this is done as the Sr25519 keys are not
// supported in any W3C standard and vc-js has them stored locally. This is a temporary solution.
Expand Down Expand Up @@ -89,4 +90,9 @@ export default new Map([
'https://w3id.org/security/suites/jws-2020/v1',
jws2020V1Context,
],
// This is overridden because the URL is 404 now, likely because domain name change. But the status-list library still uses the old domain name
[
'https://w3id.org/vc/status-list/2021/v1',
statusList21Context,
],
]);
56 changes: 56 additions & 0 deletions src/utils/vc/contexts/status-list-21.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Taken from https://w3c.github.io/vc-bitstring-status-list/contexts/v1.jsonld
export default {
'@context': {
'@protected': true,

StatusList2021Credential: {
'@id':
'https://w3id.org/vc/status-list#StatusList2021Credential',
'@context': {
'@protected': true,

id: '@id',
type: '@type',

description: 'http://schema.org/description',
name: 'http://schema.org/name',
},
},

StatusList2021: {
'@id':
'https://w3id.org/vc/status-list#StatusList2021',
'@context': {
'@protected': true,

id: '@id',
type: '@type',

statusPurpose:
'https://w3id.org/vc/status-list#statusPurpose',
encodedList: 'https://w3id.org/vc/status-list#encodedList',
},
},

StatusList2021Entry: {
'@id':
'https://w3id.org/vc/status-list#StatusList2021Entry',
'@context': {
'@protected': true,

id: '@id',
type: '@type',

statusPurpose:
'https://w3id.org/vc/status-list#statusPurpose',
statusListIndex:
'https://w3id.org/vc/status-list#statusListIndex',
statusListCredential: {
'@id':
'https://w3id.org/vc/status-list#statusListCredential',
'@type': '@id',
},
},
},
},
};

0 comments on commit a679c44

Please sign in to comment.