Skip to content

Commit

Permalink
fix(v3.2): expose v3.2 context and url
Browse files Browse the repository at this point in the history
  • Loading branch information
botcerts committed Oct 22, 2024
1 parent e8b03cf commit 466d9b0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cert_schema/context_urls.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"BLOCKCERTS_V3_1_CONTEXT": "https://w3id.org/blockcerts/schema/3.1/context.json",
"BLOCKCERTS_V3_1_CANONICAL_CONTEXT": "https://w3id.org/blockcerts/v3.1",
"BLOCKCERTS_ORG_V3_1_CONTEXT": "https://www.blockcerts.org/schema/3.1/context.json",
"BLOCKCERTS_V3_2_CONTEXT": "https://w3id.org/blockcerts/schema/3.2/context.json",
"BLOCKCERTS_V3_2_CANONICAL_CONTEXT": "https://w3id.org/blockcerts/v3.2",
"BLOCKCERTS_ORG_V3_2_CONTEXT": "https://www.blockcerts.org/schema/3.2/context.json",
"MERKLE_PROOF_2019_CONTEXT": "https://w3id.org/security/suites/merkle-2019/v1",
"CHAINED_PROOF_2021_CONTEXT": "https://w3id.org/security/suites/chained-2021/v1",
"STATUS_LIST_2021_CONTEXT": "https://w3id.org/vc/status-list/2021/v1",
Expand Down
16 changes: 16 additions & 0 deletions cert_schema/context_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ def v3_1_all(self):
self.v3_1_blockcerts_org()
]

def v3_2(self):
return self.CONTEXT_URLS['BLOCKCERTS_V3_2_CONTEXT']

def v3_2_canonical(self):
return self.CONTEXT_URLS['BLOCKCERTS_V3_2_CANONICAL_CONTEXT']

def v3_2_blockcerts_org(self):
return self.CONTEXT_URLS['BLOCKCERTS_ORG_V3_2_CONTEXT']

def v3_2_all(self):
return [
self.v3_2(),
self.v3_2_canonical(),
self.v3_2_blockcerts_org()
]

def open_badge(self):
return self.CONTEXT_URLS['OPEN_BADGES_V2_CONTEXT']

Expand Down
20 changes: 20 additions & 0 deletions tests/test_context_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@ def test_v3_1_all(self):
'https://www.blockcerts.org/schema/3.1/context.json'
])

def test_v3_2(self):
output = self.instance.v3_2()
self.assertTrue(output == 'https://w3id.org/blockcerts/schema/3.2/context.json')

def test_v3_2_canonical(self):
output = self.instance.v3_2_canonical()
self.assertTrue(output == 'https://w3id.org/blockcerts/v3.2')

def test_v3_2_blockcerts_org(self):
output = self.instance.v3_2_blockcerts_org()
self.assertTrue(output == 'https://www.blockcerts.org/schema/3.2/context.json')

def test_v3_2_all(self):
output = self.instance.v3_2_all()
self.assertEqual(output, [
'https://w3id.org/blockcerts/schema/3.2/context.json',
'https://w3id.org/blockcerts/v3.2',
'https://www.blockcerts.org/schema/3.2/context.json'
])

def test_open_badge(self):
output = self.instance.open_badge()
self.assertTrue(output == 'https://openbadgespec.org/v2/context.json')
Expand Down

0 comments on commit 466d9b0

Please sign in to comment.