Skip to content

Commit

Permalink
fix(v3.2): provide more exposure to context files
Browse files Browse the repository at this point in the history
  • Loading branch information
botcerts committed Oct 22, 2024
1 parent 466d9b0 commit ae1ba43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cert_schema/jsonld_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

JSON_LD_CONTEXT_V3_0 = os.path.join(BASE_DIR, '3.0/context.json')
JSON_LD_CONTEXT_V3_1 = os.path.join(BASE_DIR, '3.1/context.json')
JSON_LD_CONTEXT_V3_2 = os.path.join(BASE_DIR, '3.2/context.json')
MERKLE_PROOF_2019_LD_CONTEXT = os.path.join(BASE_DIR, '3.1/merkleProof2019Context.json')
CHAINED_PROOF_2021_LD_CONTEXT = os.path.join(BASE_DIR, '3.1/chainedProof2021Context.json')
STATUS_LIST_2021_LD_CONTEXT = os.path.join(BASE_DIR, '3.1/statusList2021Context.json')
Expand Down Expand Up @@ -151,6 +152,12 @@
PRELOADED_CONTEXTS[ContextUrlsInstance.v3_1_canonical()] = bc_context
PRELOADED_CONTEXTS[ContextUrlsInstance.v3_1_blockcerts_org()] = bc_context

with open(JSON_LD_CONTEXT_V3_2) as data_file:
bc_context = json.load(data_file)
PRELOADED_CONTEXTS[ContextUrlsInstance.v3_2()] = bc_context
PRELOADED_CONTEXTS[ContextUrlsInstance.v3_2_canonical()] = bc_context
PRELOADED_CONTEXTS[ContextUrlsInstance.v3_2_blockcerts_org()] = bc_context

def to_loader_response(data, url):
return {
'contextUrl': None,
Expand Down
6 changes: 6 additions & 0 deletions npm/preloadedContexts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import V2_CONTEXT from './schemas/2.0/context.json' assert { type: 'json' };
import V2_1_CONTEXT from './schemas/2.1/context.json' assert { type: 'json' };
import V3_CONTEXT from './schemas/3.0/context.json' assert { type: 'json' };
import V3_1_CONTEXT from './schemas/3.1/context.json' assert { type: 'json' };
import V3_2_CONTEXT from './schemas/3.2/context.json' assert { type: 'json' };
import MERKLE_PROOF_2019_CONTEXT from './schemas/3.1/merkleProof2019Context.json' assert { type: 'json' };
import CHAINED_PROOF_2021_CONTEXT from './schemas/3.1/chainedProof2021Context.json' assert { type: 'json' };
import STATUS_LIST_2021_CONTEXT from './schemas/3.1/statusList2021Context.json' assert { type: 'json' };
Expand Down Expand Up @@ -36,6 +37,11 @@ preloadedContexts[CONTEXT_URLS.BLOCKCERTS_V3_CANONICAL_CONTEXT] = V3_CONTEXT;
preloadedContexts[CONTEXT_URLS.BLOCKCERTS_V3_1_CONTEXT] = V3_1_CONTEXT;
preloadedContexts[CONTEXT_URLS.BLOCKCERTS_ORG_V3_1_CONTEXT] = V3_1_CONTEXT;
preloadedContexts[CONTEXT_URLS.BLOCKCERTS_V3_1_CANONICAL_CONTEXT] = V3_1_CONTEXT;

preloadedContexts[CONTEXT_URLS.BLOCKCERTS_V3_2_CONTEXT] = V3_2_CONTEXT;
preloadedContexts[CONTEXT_URLS.BLOCKCERTS_ORG_V3_2_CONTEXT] = V3_2_CONTEXT;
preloadedContexts[CONTEXT_URLS.BLOCKCERTS_V3_2_CANONICAL_CONTEXT] = V3_2_CONTEXT;

preloadedContexts[CONTEXT_URLS.MERKLE_PROOF_2019_CONTEXT] = MERKLE_PROOF_2019_CONTEXT;
preloadedContexts[CONTEXT_URLS.CHAINED_PROOF_2021_CONTEXT] = CHAINED_PROOF_2021_CONTEXT;
preloadedContexts[CONTEXT_URLS.STATUS_LIST_2021_CONTEXT] = STATUS_LIST_2021_CONTEXT;
Expand Down

0 comments on commit ae1ba43

Please sign in to comment.