Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change to identifier based testing
Browse files Browse the repository at this point in the history
Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>
PatStLouis committed Jan 30, 2025
1 parent 7c56d8b commit f503b01
Showing 3 changed files with 19 additions and 11 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ npm i

## Setup

Have a W3C Controlled Identifiers (CIDs) v1.0 document available on the web. The test-suite will do a GET request on the provided identifier.
Have a W3C Controlled Identifiers (CIDs) v1.0 document available on the web. The test-suite will do a GET request on the provided endpoint and assert the response.

## Usage

@@ -71,8 +71,9 @@ module.exports = {
implementations: [{
name: 'My Company',
implementation: 'My Implementation Name',
issuers: [{
id: 'https://example.com'.
identifiers: [{
id: 'https://example.com',
endpoint: 'https://example.com',
tags: ['cid']
}]
}];
@@ -87,20 +88,23 @@ repo by following the
[Adding a new implementation](https://github.com/w3c/vc-test-suite-implementations/tree/main?tab=readme-ov-file#adding-a-new-implementation)
instructions.
All endpoints will need the tag `vc2.0`. A simplified manifest will roughly
All endpoints will need the tag `cid`. A simplified manifest will roughly
look like the following:
```js
{
"name": "My Company",
"implementation": "My implementation",
"issuers": [{
"identifiers": [{
"id": "https://example.com",
"endpoint": "https://example.com",
"tags": ["cid"]
}]
}
```
The endpoint should return the CID, and the `id` value of the implementation should match the base identifier of the document.
See
[Adding a new implementation](https://github.com/w3c/vc-test-suite-implementations/tree/main?tab=readme-ov-file#adding-a-new-implementation)
for more information.
6 changes: 4 additions & 2 deletions localConfig.example.cjs
Original file line number Diff line number Diff line change
@@ -6,8 +6,10 @@ module.exports = {
implementations: [{
name: 'My Company',
implementation: 'My Implementation Name',
issuers: [{
id: 'https://example.com'
identifiers: [{
id: 'https://example.com',
endpoint: 'https://example.com',
tags: ['cid']
}]
}]
};
10 changes: 6 additions & 4 deletions tests/01-schema.js
Original file line number Diff line number Diff line change
@@ -19,19 +19,21 @@ const require = createRequire(import.meta.url);
chai.use(require('chai-json-schema'));

const tag = 'cid';
const {match} = filterByTag({tags: [tag]});
const {match} = filterByTag({tags: [tag], property: 'identifiers'});
console.log(match);

describe('Json Schema Conformance', function() {
setupMatrix.call(this, match);
for(const [name, implementation] of match) {
const {settings: {id: documentId}} = implementation.issuers?.find(
issuer => issuer.tags.has(tag)) || null;
const {settings: {endpoint: documentEndpoint}} =
implementation.identifiers?.find(
identifier => identifier.tags.has(tag)) || null;
const documentSchema = require('./fixtures/schema.json');
let document;
describe(name, function() {
before(async function() {
try {
document = await resolveDocument(documentId);
document = await resolveDocument(documentEndpoint);
} catch(e) {
console.error(
`Couldn't resolve document.`,

0 comments on commit f503b01

Please sign in to comment.