Skip to content
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

Remove tags for test suites that are not associated with this implementations repo and update README.md #91

Merged
merged 14 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install --legacy-peer-deps
Expand All @@ -24,11 +24,11 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install --legacy-peer-deps
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# isomorphic-js-lib-template Changelog
# vc-test-suite-implementations Changelog

## 2.0.0 - 2023-12-11

### Changed
- Update `README.md` to add additional information about requirements for
opting into a test suite.

### Removed
- Remove tags for `ecdsa`, `eddsa`, `ed25519signature2020`, and `vc2.0` test
suites that are not associated with this implementations repo.

## 1.0.1 - 2023-12-07

Expand Down
161 changes: 126 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
# VC API Test Suite Implementations _(vc-api-test-suite-implementations)_
# VC Test Suite Implementations _(vc-test-suite-implementations)_

[![Build status](https://img.shields.io/github/workflow/status/w3c-ccg/vc-api-test-suite-implementations/Node.js%20CI)](https://github.com/w3c-ccg/vc-api-test-suite-implementations/actions?query=workflow%3A%22Node.js+CI%22)
[![Coverage status](https://img.shields.io/codecov/c/github/w3c-ccg/vc-api-test-suite-implementations)](https://codecov.io/gh/w3c-ccg/vc-api-test-suite-implementations)
[![NPM Version](https://img.shields.io/npm/v/@digitalcredentials/vc-api-test-suite-implementations.svg)](https://npm.im/@digitalcredentials/vc-api-test-suite-implementations)
[![Build status](https://img.shields.io/github/workflow/status/w3c-ccg/vc-test-suite-implementations/Node.js%20CI)](https://github.com/w3c-ccg/vc-test-suite-implementations/actions?query=workflow%3A%22Node.js+CI%22)

> Implementations list used across various W3C CCG test suites.

## Table of Contents

- [VC API Test Suite Implementations _(vc-api-test-suite-implementations)_](#vc-api-test-suite-implementations-vc-api-test-suite-implementations)
- [VC Test Suite Implementations _(vc-test-suite-implementations)_](#vc-test-suite-implementations-vc-test-suite-implementations)
- [Table of Contents](#table-of-contents)
- [Background](#background)
- [Security](#security)
- [Install](#install)
- [NPM](#npm)
- [Development](#development)
- [Usage](#usage)
- [Adding a new implementation](#adding-a-new-implementation)
- [Testing locally](#testing-locally)
- [Tags](#tags)
- [Adding a new implementation](#adding-a-new-implementation)
- [Testing locally](#testing-locally)
- [Opting into a Test Suite](#opting-into-a-test-suite)
- [Contribute](#contribute)
- [License](#license)

## Background

Implementations added to this package are tested against various test suites in order to demonstrate interoperability.
Implementations added to this package are tested against various test suites
in order to demonstrate interoperability.

## Security

Please do not commit any sensitive materials such as oauth2 client secret or client secrets used for signing zcaps or HTTP Signature Headers.
Please do not commit any sensitive materials such as oauth2 client secret or
client secrets used for signing zcaps or HTTP Signature Headers.

## Install

- Node.js 16+ is required.
- Node.js 18+ is required.

### NPM

To install via NPM:

```
npm install w3c-ccg/vc-api-test-suite-implementations
npm install w3c-ccg/vc-test-suite-implementations
```

### Development

To install locally (for development):

```
git clone https://github.com/w3c-ccg/vc-api-test-suite-implementations.git
cd vc-api-test-suite-implementations
git clone https://github.com/w3c-ccg/vc-test-suite-implementations.git
cd vc-test-suite-implementations
npm install
```

## Usage


#### Adding a new implementation
### Adding a new implementation
Please add implementations to the `./implementations` directory.
Implementation configuration files are expressed in JSON and use roughly the
following form:
Expand Down Expand Up @@ -91,18 +91,21 @@ following form:
}
```

Please note: implementations may have security using oauth2 or zcaps, but not both.
Implementations may also contain no security (do not add a OAUTH2 or ZCAP section in that case).
Please note: implementations may have security using oauth2 or zcaps, but not
both.
Implementations may also contain no security (do not add a OAUTH2 or ZCAP
section in that case).

#### Testing locally
### Testing locally

If you need to add implementations for endpoints running locally you may add a config file in the root dir of your test project:
If you need to test implementations for endpoints running locally, create a
config file in the root dir of the test suite:

```
.vcApiTestImplementationsConfig.cjs
```

That file must be a common js module that exports an array of implementations:
This file must be a CommonJS module that exports an array of implementations:

```js
// file .vcApiTestImplementationsConfig.cjs
Expand All @@ -122,28 +125,116 @@ module.exports = [{
}];
```

### Tags
Tags tell the test suites which tests should be run on your issuer, verifier,
and status lists.
To run the tests only against the localhost implementation, update the test
suite to filter implementations using the specified tag in your config file.

* `vc-api` - This tag will run the [vc-api-issuer tests](https://github.com/w3c-ccg/vc-api-issuer-test-suite) on your issuer and the [vc-api-verifier tests](https://github.com/w3c-ccg/vc-api-verifier-test-suite) on your verifier.
For instance, if your `.vcApiTestImplementationsConfig.cjs` looks like above
in the `vc-api-issuer-test-suite`, you can adjust the
[tag](https://github.com/w3c-ccg/vc-api-issuer-test-suite/blob/main/tests/10-issuer.js#L14)
to filter the implementation by `localhost` rather than `vc-api` and
then run the tests.

* `Ed25519Signature2020` - This tag will run the [Ed25519 tests](https://github.com/w3c/vc-di-ed25519signature2020-test-suite) on your issuer and/or verifier.
### Opting into a Test Suite

* `StatusList2021` - This tag will run the [Status List 2021 tests](https://github.com/w3c-ccg/status-list-2021-test-suite) on your issuer and/or verifier.
Please Note:

* `did-key` - This tag will run the [DID Key Test Suite](https://github.com/w3c-ccg/did-key-test-suite) on your DID resolver endpoint.
1. Tags serve as identifiers to determine which test suites to run on your
issuers and verifiers. The first issuer/verifier found with a specific
tag from your list will be run against the test suite, while subsequent issuers
and verifiers bearing the same tag won't. This applies to most of the test
suites associated with this implementations repository listed below.

* `ecdsa-rdfc-2019` or `ecdsa-sd-2023` - These tags will run the
[VC Data Integrity ECDSA Test Suite](https://github.com/w3c/vc-di-ecdsa-test-suite)
on your issuer and verifier endpoints.
* Alongside this cryptosuite tag, you must also specify the `supportedEcdsaKeyTypes`
key parallel to `tags` listing the ECDSA key types that your implementation issues or
can verify. Currently, the test suite supports `P-256` and `P-384` ECDSA key types.
For instance, if you have added the tag `vc-api` to all your issuers and
verifiers to run them with vc api issuer and verifier test suites, only the
first match will be used in the test suites. In the sample configuration below,
only the issuer and verifier with the IDs
https://product.example.com/issuers/z1AEwLo7tZ3TrsPgRcgLJqQvR and
https://product.example.com/verifiers/z1AEwLo7tZ3TrsPgRcgLJqQvR will be selected.
Therefore, please avoid adding duplicate tags.

* `eddsa-rdfc-2022` - This tag will run the [VC Data Integrity EDDSA Test Suite](https://github.com/w3c/vc-di-eddsa-test-suite) on your issuer and verifier endpoints.
Example
```js
// Only the first match https://product.example.com/issuers/z1AEwLo7tZ3TrsPgRcgLJqQvR
// and https://product.example.com/verifiers/z1AEwLo7tZ3TrsPgRcgLJqQvR will be
// run against the VC API issuer and verifier test suites.
{
"issuers": [{
"id": "https://product.example.com/issuers/z1AEwLo7tZ3TrsPgRcgLJqQvR",
"endpoint": "https://product.example.com/issuers/z1AEwLo7tZ3TrsPgRcgLJqQvR/credentials/issue",
"tags": ["vc-api"]
}, {
"id": "https://product.example.com/issuers/z4Rq7N1lT6zVwFgXk8JYdCcKpU",
"endpoint": "https://product.example.com/issuers/z4Rq7N1lT6zVwFgXk8JYdCcKpU/credentials/issue",
"tags": ["vc-api"]
}],
"verifiers": [{
"id": "https://product.example.com/verifiers/z1AEwLo7tZ3TrsPgRcgLJqQvR",
"endpoint": "https://product.example.com/verifiers/z1AEwLo7tZ3TrsPgRcgLJqQvR/credentials/verify",
"tags": ["vc-api"]
}, {
"id": "https://product.example.com/verifiers/z4Rq7N1lT6zVwFgXk8JYdCcKpU",
"endpoint": "https://product.example.com/verifiers/z4Rq7N1lT6zVwFgXk8JYdCcKpU/credentials/verify",
"tags": ["vc-api"]
}]
}
```

2. If you want your issuer or verifier to run against multiple test suites, you
can assign multiple tags to them, eliminating the need for redundant entries.
For instance, if an issuer with the ID
https://product.example.com/issuers/z1AEwLo7tZ3TrsPgRcgLJqQvR can be run with
both the Status List 2021 and VC API test suites, a single entry with
multiple tags can be used. This consolidated entry, containing tags for
both VC API and Status List 2021 test suites, ensures that the issuer and
the verifier will be run against both test suites. Here is an example of how to
structure the entry:

For Example:
```js
{
"issuers": [{
"id": "https://product.example.com/issuers/z4Rq7N1lT6zVwFgXk8JYdCcKpU",
"endpoint": "https://product.example.com/issuers/z4Rq7N1lT6zVwFgXk8JYdCcKpU/credentials/issue",
"tags": ["vc-api", "StatusList2021", "Suspension"]
}],
"verifiers": [{
"id": "https://product.example.com/verifiers/z4Rq7N1lT6zVwFgXk8JYdCcKpU",
"endpoint": "https://product.example.com/verifiers/z4Rq7N1lT6zVwFgXk8JYdCcKpU/credentials/verify",
"tags": ["vc-api"]
}]
}
```

#### VC API Issuer and Verifier Test Suites

* `vc-api` - This tag will run the [vc-api-issuer tests](https://github.com/w3c-ccg/vc-api-issuer-test-suite)
on your issuer and the [vc-api-verifier tests](https://github.com/w3c-ccg/vc-api-verifier-test-suite)
on your verifier.

NOTE: Currently the vc api verifier test suite uses `Ed25519Signature2020` as
the default signature for the mock VCs that are sent to the verifiers since it
is most widely implemented. So, the verifier you add for `vc-api` must support
verification of VCs with `Ed25519Signature2020` signature to pass verification
tests.

#### Status List 2021 Test Suite

* `StatusList2021` and `Revocation`/`Suspension`- Combining the `StatusList2021`
tag with `Revocation` or `Suspension` tags will run the
[Status List 2021 tests](https://github.com/w3c-ccg/status-list-2021-test-suite)
on your issuer and/or verifier.
* Adding the `Revocation` tag alongside `StatusList2021` runs tests for
issuers or verifiers issuing/verifying VCs with the revocation status purpose.
* Adding the `Suspension` tag alongside `StatusList2021` runs tests for
issuers or verifiers issuing/verifying VCs with the suspension status purpose.
* Note: To update the status of VCs and publish the updated status, additional
endpoints `setStatusLists` - `/credentials/status` and `publishStatusLists`
- `/credentials/publish` may also need to be specified.

#### DID Key Test Suite

* `vc2.0` - This tag will run the [VC Data Model 2.0 Test Suite](https://github.com/w3c/vc-data-model-2.0-test-suite) on your issuer and verifier endpoints.
* `did-key` - This tag will run the [DID Key Test Suite](https://github.com/w3c-ccg/did-key-test-suite)
on your DID resolver endpoint.

## Contribute

Expand Down
23 changes: 2 additions & 21 deletions implementations/ApiCatalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,14 @@
"verifiers": [{
"id": "https://vc.apicatalog.com",
"endpoint": "https://vc.apicatalog.com/credentials/verify",
"tags": ["vc-api", "Ed25519Signature2020", "vc2.0", "eddsa-2022", "ecdsa-2019" ]
"tags": ["vc-api"]
}],
"issuers": [{
"id": "did:key:z6Mkska8oQD7QQQWxqa7L5ai4mH98HfAdSwomPFYKuqNyE2y",
"endpoint": "https://vc.apicatalog.com/credentials/issue",
"options": {
"type": "Ed25519Signature2020"
},
"tags": ["vc-api", "Ed25519Signature2020", "vc2.0"]
}, {
"id": "did:key:z6Mkska8oQD7QQQWxqa7L5ai4mH98HfAdSwomPFYKuqNyE2y",
"endpoint": "https://vc.apicatalog.com/credentials/issue",
"options": {
"type": "eddsa-2022"
},
"tags": ["vc-api", "eddsa-2022"]
}, {
"id": "did:key:zDnaepBuvsQ8cpsWrVKw8fbpGpvPeNSjVPTWoq6cRqaYzBKVP",
"endpoint": "https://vc.apicatalog.com/credentials/issue",
"options": {
"type": "ecdsa-2019"
},
"tags": ["vc-api", "ecdsa-2019" ]
}],
"vpVerifiers": [{
"id": "https://vc.apicatalog.com",
"endpoint": "https://vc.apicatalog.com/presentations/verify",
"tags": ["vc-api", "Ed25519Signature2020", "vc2.0", "eddsa-2022", "ecdsa-2019" ]
"tags": ["vc-api"]
}]
}
15 changes: 3 additions & 12 deletions implementations/DanubeTech.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,18 @@
"type": "Ed25519Signature2018"
},
"tags": ["vc-api"]
},
{
"id": "did:key:z6MksvTdeczd92YQ5W2V2gL9kXdRvD2AEiyJPoWieP95HUDo",
"endpoint": "https://uniissuer.io/1.0/credentials/issue",
"options": {
"type": "Ed25519Signature2020"
},
"tags": ["vc-api", "Ed25519Signature2020"]
},
{
}, {
"id": "did:key:z6MksvTdeczd92YQ5W2V2gL9kXdRvD2AEiyJPoWieP95HUDo",
"endpoint": "https://uniissuer.io/1.0/credentials/issue",
"options": {
"type": "JsonWebSignature2020"
},
"tags": ["vc-api", "JsonWebSignature2020"]
"tags": ["JsonWebSignature2020"]
}],
"verifiers": [{
"id": "",
"endpoint": "https://univerifier.io/1.0/credentials/verify",
"tags": ["vc-api", "Ed25519Signature2020"]
"tags": ["vc-api"]
}],
"didResolvers": [{
"id": "",
Expand Down
Loading
Loading