-
Notifications
You must be signed in to change notification settings - Fork 7
Add data model suite #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
f79bb5d
b6bc293
42d791f
36cb201
0c32e03
280abf8
4edf3a5
e7d9a88
5748112
24fe1c9
2035e75
df7e572
c20af05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /*! | ||
| * Copyright 2024 Digital Bazaar, Inc. | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| import {dataModelSuite} from './suites/data-model.js'; | ||
| import {endpoints} from 'vc-test-suite-implementations'; | ||
| import {getSuiteConfig} from './test-config.js'; | ||
|
|
||
| const cryptosuites = [ | ||
| 'ecdsa-rdfc-2019', | ||
| 'ecdsa-sd-2023' | ||
| //FIXME implement jcs 'ecdsa-jcs-2019' | ||
| ]; | ||
|
|
||
| for(const suiteName of cryptosuites) { | ||
| const {tags, credentials, vectors} = getSuiteConfig(suiteName); | ||
| const {match: issuers} = endpoints.filterByTag({ | ||
| tags: [...tags], | ||
| property: 'issuers' | ||
| }); | ||
| for(const vcVersion of vectors.vcTypes) { | ||
| const { | ||
| document, | ||
| mandatoryPointers, | ||
| selectivePointers | ||
| } = credentials.create[vcVersion]; | ||
| for(const keyType of vectors.keyTypes) { | ||
| dataModelSuite({ | ||
| issuers, | ||
| suiteName, | ||
| keyType, | ||
| vcVersion, | ||
| credential: document, | ||
| mandatoryPointers, | ||
| selectivePointers | ||
| }); | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,122 @@ | ||||||||||
| /*! | ||||||||||
| * Copyright 2024 Digital Bazaar, Inc. | ||||||||||
| * SPDX-License-Identifier: BSD-3-Clause | ||||||||||
| */ | ||||||||||
| import {createInitialVc, endpointCheck} from '../helpers.js'; | ||||||||||
| import { | ||||||||||
| assertions, | ||||||||||
| } from 'data-integrity-test-suite-assertion'; | ||||||||||
| import {didResolver} from '../didResolver.js'; | ||||||||||
| import {expect} from 'chai'; | ||||||||||
|
|
||||||||||
| export function dataModelSuite({ | ||||||||||
| issuers, | ||||||||||
| suiteName, | ||||||||||
| keyType, | ||||||||||
| vcVersion, | ||||||||||
| credential, | ||||||||||
| mandatoryPointers | ||||||||||
| }) { | ||||||||||
| return describe(`${suiteName} - Data Model - VC ${vcVersion}`, function() { | ||||||||||
| this.matrix = true; | ||||||||||
| this.report = true; | ||||||||||
| this.implemented = [...issuers]; | ||||||||||
| this.rowLabel = 'Test Name'; | ||||||||||
| this.columnLabel = 'Implementation'; | ||||||||||
| for(const [name, {endpoints}] of issuers) { | ||||||||||
| const [issuer] = endpoints; | ||||||||||
| // does the endpoint support this test? | ||||||||||
| if(!endpointCheck({endpoint: issuer, keyType, vcVersion})) { | ||||||||||
| continue; | ||||||||||
| } | ||||||||||
| describe(`${name}: ${keyType}`, function() { | ||||||||||
| let securedCredential = null; | ||||||||||
| let proofs = []; | ||||||||||
| before(async function() { | ||||||||||
| securedCredential = await createInitialVc({ | ||||||||||
| issuer, | ||||||||||
| vcVersion, | ||||||||||
| vc: credential, | ||||||||||
| mandatoryPointers | ||||||||||
| }); | ||||||||||
| if(securedCredential) { | ||||||||||
| proofs = Array.isArray(securedCredential.proof) ? | ||||||||||
| securedCredential?.proof : [securedCredential?.proof]; | ||||||||||
| // only test proofs that match the relevant cryptosuite | ||||||||||
| proofs = proofs.filter(p => p?.cryptosuite === suiteName); | ||||||||||
| } | ||||||||||
| }); | ||||||||||
| beforeEach(function() { | ||||||||||
| this.currentTest.cell = { | ||||||||||
| rowId: this.currentTest.title, | ||||||||||
| columnId: this.currentTest.parent.title | ||||||||||
| }; | ||||||||||
| }); | ||||||||||
| function assertBefore() { | ||||||||||
| expect( | ||||||||||
| securedCredential, | ||||||||||
| `Expected issuer ${name}: ${keyType} to issue a VC` | ||||||||||
| ).to.exist; | ||||||||||
| expect( | ||||||||||
| securedCredential, | ||||||||||
| 'Expected VC to be an object' | ||||||||||
| ).to.be.an('object'); | ||||||||||
| } | ||||||||||
| it('The publicKeyMultibase value of the verification method MUST ' + | ||||||||||
| 'start with the base-58-btc prefix (z), as defined in the ' + | ||||||||||
| 'Multibase section of Controller Documents 1.0. A ', | ||||||||||
|
||||||||||
| 'start with the base-58-btc prefix (z), as defined in the ' + | |
| 'Multibase section of Controller Documents 1.0. A ', | |
| 'start with the base-58-btc prefix ("z"), as defined in the ' + | |
| 'Multibase section of Controller Documents 1.0.A.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TallTed this looks like a typo resulting from my cut and paste job. The line reads: "The publicKeyMultibase value of the verification method MUST start with the base-58-btc prefix (z), as defined in the Multibase section of Controller Documents 1.0" The A belongs to the next sentence: "A Multibase-encoded ECDSA 256-bit public key value or an ECDSA 384-bit public key value follows, as defined in the Multikey section of Controller Documents 1.0. Any other encoding MUST NOT be allowed."
So the A should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh!
There was an error while loading. Please reload this page.