Skip to content

Commit

Permalink
all jose tests working
Browse files Browse the repository at this point in the history
  • Loading branch information
decentralgabe committed Dec 15, 2024
1 parent 19008ac commit 3438541
Show file tree
Hide file tree
Showing 23 changed files with 62 additions and 37 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,25 @@ This file defines the structure of the test suite. It exports two main objects:
2. `TestMapping`: A mapping of test names to their configurations. Each test configuration includes:
- `number`: A unique identifier for the test
- `input_file`: The name of the input file to be used, representing:
- For issuance, a JSON unsigned Verifiable Credential or Presentation
- For issuance, a JSON unsigned Verifiable Credential or Presentation (a .json file)
- For verification, a signed Verifiable Credential or Presentation, encoded as a JWT string (JOSE),
Base64 string (COSE), or SD-JWT string (Selective Disclosure JWT)
- `key_file`: The name of the key file to be used, representing a Verification Method
Base64 string (COSE), or SD-JWT string (Selective Disclosure JWT) (a .txt file)
- `key_file`: The name of the key file to be used, representing a Verification Method (a .json file)
- `fn`: The function being tested either `issue` or `verify`
- `disclosure_paths`: An array of paths to be disclosed in a Selective Disclosure JWT (e.g. `["issuer", "validFrom", "credentialSubject.id"]`)
- `disclosure_paths`: An array of paths to be disclosed in a Selective Disclosure JWT (e.g. a JSON array like
`["issuer", "validFrom", "credentialSubject.id"]`)
- `feature`: The function being tested, one of `credential_jose`, `credential_cose`, `credential_sdjwt`,
`presentation_jose`, `presentation_cose`, or `presentation_sdjwt`
- `expected_result`: The expected outcome of the test
- `expected_result`: The expected outcome of the test written to a file of the following format:

```json
{
"result": "success",
"data": "..."
}
```
Where `result` is one of `success`, `failure`, `indeterminate`, or `error`, and `data` is a string containing a
signed and encoded credential or presentation.

### test-runner.js

Expand Down
2 changes: 1 addition & 1 deletion implementations/independent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/w3c/vc-test-suite-template
go 1.23.3

require (
github.com/decentralgabe/vc-jose-cose-go v0.0.0-20241214004022-47f4d05fd2cc
github.com/decentralgabe/vc-jose-cose-go v0.0.0-20241215004540-cb1cc1a9b436
github.com/goccy/go-json v0.10.3
github.com/lestrrat-go/jwx/v2 v2.1.3
github.com/pkg/errors v0.9.1
Expand Down
4 changes: 2 additions & 2 deletions implementations/independent/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decentralgabe/vc-jose-cose-go v0.0.0-20241214004022-47f4d05fd2cc h1:3yrGckdayGbgac+zUNSTX/roKLD7Nh1+/WIVvvNPuCE=
github.com/decentralgabe/vc-jose-cose-go v0.0.0-20241214004022-47f4d05fd2cc/go.mod h1:ZOHYH9iQGJdawl1+iSfzrfQQxPHrDVL/rpZRc5z9okI=
github.com/decentralgabe/vc-jose-cose-go v0.0.0-20241215004540-cb1cc1a9b436 h1:U3QRg5mEczSF0diw3nAn6MdGQfoF8pTI3+yKWy32NeA=
github.com/decentralgabe/vc-jose-cose-go v0.0.0-20241215004540-cb1cc1a9b436/go.mod h1:ZOHYH9iQGJdawl1+iSfzrfQQxPHrDVL/rpZRc5z9okI=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADivE=
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Following, are a set of test cases which describe how the statements are to be t
* Format: jose
* Covers: 3
*
12. JWT Credential With an Invalid Signature
12. JWT Credential with an Invalid Signature
* Input: Credential with an invalid signature
* Format: jose
* Covers: 1, 2
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions tests/input/credential-jose-bad-media-type.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJFZERTQSIsImN0eSI6ImJhZCtjdHkiLCJraWQiOiIyYU9IYVF4c1dWVDRtTHNVa2R0bENuVVYtYXUwQkJSLTV5UFlhUGFDYzVrIiwidHlwIjoiYmFkK3R5cCJ9.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiY3JlZGVudGlhbFNjaGVtYSI6eyJpZCI6Imh0dHBzOi8vZXhhbXBsZS5vcmcvZXhhbXBsZXMvZGVncmVlLmpzb24iLCJ0eXBlIjoiSnNvblNjaGVtYSJ9LCJjcmVkZW50aWFsU3ViamVjdCI6eyJkZWdyZWUiOnsibmFtZSI6IkJhY2hlbG9yIG9mIFNjaWVuY2UgYW5kIEFydHMiLCJ0eXBlIjoiQmFjaGVsb3JEZWdyZWUifSwiaWQiOiJkaWQ6ZXhhbXBsZToxMjMifSwiaWF0IjoiMjAxMC0wMS0wMVQxOToyMzoyNFoiLCJpZCI6Imh0dHA6Ly91bml2ZXJzaXR5LmV4YW1wbGUvY3JlZGVudGlhbHMvMTg3MiIsImlzcyI6Imh0dHBzOi8vZXhhbXBsZS5pc3N1ZXIvdmMtam9zZS1jb3NlIiwiaXNzdWVyIjoiaHR0cHM6Ly9leGFtcGxlLmlzc3Vlci92Yy1qb3NlLWNvc2UiLCJqdGkiOiJodHRwOi8vdW5pdmVyc2l0eS5leGFtcGxlL2NyZWRlbnRpYWxzLzE4NzIiLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiRXhhbXBsZUFsdW1uaUNyZWRlbnRpYWwiXSwidmFsaWRGcm9tIjoiMjAxMC0wMS0wMVQxOToyMzoyNFoifQ.w3QGXwK2TGiE25U4Ul55i4Bq4hS0RC9dqa9uKHLSQaOjtIi4eprUBgAXt6wxgEmnhM-SKrTzKfeOipPF-vESDA
1 change: 1 addition & 0 deletions tests/input/credential-jose-bad-signature.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJFZERTQSIsImN0eSI6InZjIiwia2lkIjoiMmFPSGFReHNXVlQ0bUxzVWtkdGxDblVWLWF1MEJCUi01eVBZYVBhQ2M1ayIsInR5cCI6InZjK2p3dCJ9.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiY3JlZGVudGlhbFNjaGVtYSI6eyJpZCI6Imh0dHBzOi8vZXhhbXBsZS5vcmcvZXhhbXBsZXMvZGVncmVlLmpzb24iLCJ0eXBlIjoiSnNvblNjaGVtYSJ9LCJjcmVkZW50aWFsU3ViamVjdCI6eyJkZWdyZWUiOnsibmFtZSI6IkJhY2hlbG9yIG9mIFNjaWVuY2UgYW5kIEFydHMiLCJ0eXBlIjoiQmFjaGVsb3JEZWdyZWUifSwiaWQiOiJkaWQ6ZXhhbXBsZToxMjMifSwiaWF0IjoiMjAxMC0wMS0wMVQxOToyMzoyNFoiLCJpZCI6Imh0dHA6Ly91bml2ZXJzaXR5LmV4YW1wbGUvY3JlZGVudGlhbHMvMTg3MiIsImlzcyI6Imh0dHBzOi8vZXhhbXBsZS5pc3N1ZXIvdmMtam9zZS1jb3NlIiwiaXNzdWVyIjoiaHR0cHM6Ly9leGFtcGxlLmlzc3Vlci92Yy1qb3NlLWNvc2UiLCJqdGkiOiJodHRwOi8vdW5pdmVyc2l0eS5leGFtcGxlL2NyZWRlbnRpYWxzLzE4NzIiLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiRXhhbXBsZUFsdW1uaUNyZWRlbnRpYWwiXSwidmFsaWRGcm9tIjoiMjAxMC0wMS0wMVQxOToyMzoyNFoifQ.CAJ3jlPCjXpZyAr5NiKs71n_mfFSghy-cPjIRu96mF46XnNZ5QaqGvLrtHjI2pwbG055JDSPGFU2j9X0W3Kfuw
File renamed without changes.
1 change: 1 addition & 0 deletions tests/input/credential-jose-vc-vp-claims.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJFZERTQSIsImN0eSI6InZjIiwia2lkIjoiMmFPSGFReHNXVlQ0bUxzVWtkdGxDblVWLWF1MEJCUi01eVBZYVBhQ2M1ayIsInR5cCI6InZjK2p3dCJ9.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiY3JlZGVudGlhbFNjaGVtYSI6eyJpZCI6Imh0dHBzOi8vZXhhbXBsZS5vcmcvZXhhbXBsZXMvZGVncmVlLmpzb24iLCJ0eXBlIjoiSnNvblNjaGVtYSJ9LCJjcmVkZW50aWFsU3ViamVjdCI6eyJkZWdyZWUiOnsibmFtZSI6IkJhY2hlbG9yIG9mIFNjaWVuY2UgYW5kIEFydHMiLCJ0eXBlIjoiQmFjaGVsb3JEZWdyZWUifSwiaWQiOiJkaWQ6ZXhhbXBsZToxMjMifSwiaWF0IjoiMjAxMC0wMS0wMVQxOToyMzoyNFoiLCJpZCI6Imh0dHA6Ly91bml2ZXJzaXR5LmV4YW1wbGUvY3JlZGVudGlhbHMvMTg3MiIsImlzcyI6Imh0dHBzOi8vZXhhbXBsZS5pc3N1ZXIvdmMtam9zZS1jb3NlIiwiaXNzdWVyIjoiaHR0cHM6Ly9leGFtcGxlLmlzc3Vlci92Yy1qb3NlLWNvc2UiLCJqdGkiOiJodHRwOi8vdW5pdmVyc2l0eS5leGFtcGxlL2NyZWRlbnRpYWxzLzE4NzIiLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiRXhhbXBsZUFsdW1uaUNyZWRlbnRpYWwiXSwidmFsaWRGcm9tIjoiMjAxMC0wMS0wMVQxOToyMzoyNFoiLCJ2YyI6Im9vcHMiLCJ2cCI6Im5vb28ifQ.MYH7qVx4rMZs_VXhy0lTQ53k3eSM2C_zxRC-FfGBYiGP7pbGt89a445EpIhTB5n8OO2Iz3zaKrLeUYHwc4HuBw
1 change: 1 addition & 0 deletions tests/input/credential-sdjwt-bad-signature.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJFUzM4NCIsImN0eSI6InZjIiwia2lkIjoiOTZxQm5EcHZTNng4WVNDSF94bW5MbFhaTWtEaEhCcjhsajk5dTVhb2c3cyIsInR5cCI6InZjK3NkLWp3dCJ9.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiY3JlZGVudGlhbFN1YmplY3QiOnsiX3NkIjpbImtuYzN2Z2pmZlpUUDdwRHk2OVAxVndOV1RGVFhxblg1b0R1Nl9wU2RTYzAiLCIxeElDZkE3Z3VLVXZwU3F6RF9TelhwTU55U1RyWVRDSWNwNEwxOU1YdnFzIl0sImJpcnRoRGF0ZSI6IjE5OTAtMDEtMDEiLCJpZCI6ImRpZDpleGFtcGxlOmViZmViMWY3MTJlYmM2ZjFjMjc2ZTEyZWMyMSJ9LCJpYXQiOiIyMDI0LTAxLTAxVDAwOjAwOjAwWiIsImlzcyI6Imh0dHBzOi8vZXhhbXBsZS5pc3N1ZXIvdmMtam9zZS1jb3NlIiwiaXNzdWVyIjoiaHR0cHM6Ly9leGFtcGxlLmlzc3Vlci92Yy1qb3NlLWNvc2UiLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiSWRlbnRpdHlDcmVkZW50aWFsIl0sInZhbGlkRnJvbSI6IjIwMjQtMDEtMDFUMDA6MDA6MDBaIn0.LRr-xvudGvtIbCgz_EgNH5EWMQxobkjKLnQer3iXV3iZk4_vKpMG8hUzcFOdnCHXdVNlnfz8baLEvNRcUc-60NkEvrrWlcpoxJo-Dh_Usm8LYwD739qjbEEvrCnYY9jb~WyI0bUZLME14VEsyRmluZFNxQ0ktSzhBIiwiZmlyc3ROYW1lIiwiSmFuZSJd~WyJvU3lzbndsZ1ZGREUzZzdsbTJKZFZRIiwibGFzdE5hbWUiLCJEb2UiXQ~
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tests/input/presentation-jose-bad-credential.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJFZERTQSIsImN0eSI6InZwIiwia2lkIjoiMmFPSGFReHNXVlQ0bUxzVWtkdGxDblVWLWF1MEJCUi01eVBZYVBhQ2M1ayIsInR5cCI6InZwK2p3dCJ9.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiZXhwIjoxNzM0MzEwMDIwLCJob2xkZXIiOiJodHRwczovL2V4YW1wbGUuaXNzdWVyL3ZjLWpvc2UtY29zZSIsImlhdCI6MTczNDIyMzYyMCwiaWQiOiJ1cm46dXVpZDozOTc4MzQ0Zi04NTk2LTRjM2EtYTk3OC04ZmNhYmEzOTAzYzUiLCJpc3MiOiJodHRwczovL2V4YW1wbGUuaXNzdWVyL3ZjLWpvc2UtY29zZSIsImp0aSI6InVybjp1dWlkOjM5NzgzNDRmLTg1OTYtNGMzYS1hOTc4LThmY2FiYTM5MDNjNSIsInR5cGUiOiJWZXJpZmlhYmxlUHJlc2VudGF0aW9uIiwidmVyaWZpYWJsZUNyZWRlbnRpYWwiOlt7IkBjb250ZXh0IjoiaHR0cHM6Ly93d3cudzMub3JnL25zL2NyZWRlbnRpYWxzL3YyIiwiaWQiOiJub3QtYS1jcmVkZW50aWFsIiwidHlwZSI6IkVudmVsb3BlZFZlcmlmaWFibGVDcmVkZW50aWFsIn1dfQ.X1cKkExIbQMYETs1SHtuesZG0F2NpWqWwc7dBm8yeMSxM6JkkTekcZY-F2yGHoRMMef_lR_KtijdqhLnzpoiDQ
1 change: 1 addition & 0 deletions tests/input/presentation-jose-bad-media-type.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJFZERTQSIsImN0eSI6ImJhZCtjdHkiLCJraWQiOiIyYU9IYVF4c1dWVDRtTHNVa2R0bENuVVYtYXUwQkJSLTV5UFlhUGFDYzVrIiwidHlwIjoiYmFkK3R5cCJ9.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiZXhwIjoxNzM0Mjk5OTAzLCJob2xkZXIiOiJodHRwczovL2V4YW1wbGUuaXNzdWVyL3ZjLWpvc2UtY29zZSIsImlhdCI6MTczNDIxMzUwMywiaWQiOiJ1cm46dXVpZDozOTc4MzQ0Zi04NTk2LTRjM2EtYTk3OC04ZmNhYmEzOTAzYzUiLCJpc3MiOiJodHRwczovL2V4YW1wbGUuaXNzdWVyL3ZjLWpvc2UtY29zZSIsImp0aSI6InVybjp1dWlkOjM5NzgzNDRmLTg1OTYtNGMzYS1hOTc4LThmY2FiYTM5MDNjNSIsInR5cGUiOiJWZXJpZmlhYmxlUHJlc2VudGF0aW9uIiwidmVyaWZpYWJ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mhZMmhsYkc5eVJHVm5jbVZsSWl3aWJtRnRaU0k2SWtKaFkyaGxiRzl5SUc5bUlGTmphV1Z1WTJVZ1lXNWtJRUZ5ZEhNaWZYMTkuQjVOYi15Szh1VkVJMDI5MnZacXRBY0Z2SkhZMlEtOFFhRDJlRWhnMHpyTVExSmxtVEFuLUZQcjc2MVBiRktFMWtITXF6N1RBZXVHVnNDQTdSWHN0VkEiLCJ0eXBlIjoiRW52ZWxvcGVkVmVyaWZpYWJsZUNyZWRlbnRpYWwifV19.rsLY0mSPblndqO2oX2-M-OBAz8nz0bouTaW5Wddofxk9loORvhiRsAu2nM-Q9mO8nfwMMoJgSjR01Bt7vKoCAw
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/input/presentation-multiple.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{
"@context": "https://www.w3.org/ns/credentials/v2",
"type": "EnvelopedVerifiableCredential",
"id": "data:application/data:application/vc+cose;base64,0oRYV6QBOCIDbmFwcGxpY2F0aW9uL3ZwBFgrOTZxQm5EcHZTNng4WVNDSF94bW5MbFhaTWtEaEhCcjhsajk5dTVhb2c3cxBzYXBwbGljYXRpb24vdnArY29zZaBZAbh7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy9ucy9jcmVkZW50aWFscy92MiIsImh0dHBzOi8vd3d3LnczLm9yZy9ucy9jcmVkZW50aWFscy9leGFtcGxlcy92MiJdLCJ0eXBlIjoiVmVyaWZpYWJsZVByZXNlbnRhdGlvbiIsImlkIjoidXJuOnV1aWQ6Mzk3ODM0NGYtODU5Ni00YzNhLWE5NzgtOGZjYWJhMzkwM2M1IiwiaG9sZGVyIjoiaHR0cHM6Ly9leGFtcGxlLmlzc3Vlci92Yy1qb3NlLWNvc2UiLCJ2ZXJpZmlhYmxlQ3JlZGVudGlhbCI6W3siQGNvbnRleHQiOiJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJ0eXBlIjoiRW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FOP97fZl8AGAdQjnFmKtq782XeuAUr+ie/+8b+kKCWJSVBddXEedPYZUPZpk/uG44UhjvcBMhiR7ET0xmE2"
}
]
}
57 changes: 33 additions & 24 deletions tests/test-mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const JOSETestMapping = {

'6. JWT Basic Credential Verification': {
'number': 6,
'input_file': 'credential-minimal-signed.json',
'input_file': 'credential-jose-minimal.txt',
'key_file': TestVerificationMethods.p256,
'fn': TestFunction.verify,
'feature': TestFeature.credential_jose,
Expand All @@ -95,7 +95,7 @@ export const JOSETestMapping = {

'7. JWT Presentation Verification': {
'number': 7,
'input_file': 'presentation-multiple-signed.json',
'input_file': 'presentation-jose-multiple.txt',
'key_file': TestVerificationMethods.p384,
'fn': TestFunction.verify,
'feature': TestFeature.presentation_jose,
Expand All @@ -104,7 +104,7 @@ export const JOSETestMapping = {

'8. JWT Issuer Match Verification': {
'number': 8,
'input_file': 'credential-issuer-match-signed.json',
'input_file': 'credential-issuer-match-signed.txt',
'key_file': TestVerificationMethods.ed25519,
'fn': TestFunction.verify,
'feature': TestFeature.credential_jose,
Expand All @@ -113,61 +113,70 @@ export const JOSETestMapping = {

'9. JWT Verification With Unknown Extensions': {
'number': 9,
'input_file': 'credential-unknown-extensions-signed.json',
'input_file': 'credential-jose-unknown-extensions.txt',
'key_file': TestVerificationMethods.ed25519,
'fn': TestFunction.verify,
'feature': TestFeature.credential_jose,
'expected_result': TestResult.failure,
},

'!! 10. JWT Unsecured Credential Verification': {
'10. JWT Unsecured Credential Verification': {
'number': 10,
'input_file': '',
'input_file': 'credential-minimal.json',
'key_file': TestVerificationMethods.ed25519,
'fn': TestFunction.verify,
'feature': TestFeature.credential_jose,
'expected_result': TestResult.failure,
},

'!! 11. JWT Unsecured Presentation Verification': {
'11. JWT Unsecured Presentation Verification': {
'number': 11,
'input_file': '',
'input_file': 'presentation-single.json',
'key_file': TestVerificationMethods.ed25519,
'fn': TestFunction.verify,
'feature': TestFeature.presentation_jose,
'expected_result': TestResult.failure,
},

'!! 13. JWT Credential with an Invalid Media Type': {
'12. JWT Credential with an Invalid Signature': {
'number': 12,
'input_file': 'credential-jose-bad-signature.txt',
'key_file': TestVerificationMethods.ed25519,
'fn': TestFunction.verify,
'feature': TestFeature.credential_jose,
'expected_result': TestResult.failure,
},

'13. JWT Credential with an Invalid Media Type': {
'number': 13,
'input_file': '',
'input_file': 'credential-jose-bad-media-type.txt',
'key_file': TestVerificationMethods.ed25519,
'fn': TestFunction.verify,
'feature': TestFeature.credential_jose,
'expected_result': TestResult.failure,
},

'!! 14. JWT Presentation with an Invalid Media Type': {
'14. JWT Presentation with an Invalid Media Type': {
'number': 14,
'input_file': '',
'input_file': 'presentation-jose-bad-media-type.txt',
'key_file': TestVerificationMethods.ed25519,
'fn': TestFunction.verify,
'feature': TestFeature.presentation_jose,
'expected_result': TestResult.failure,
},

'!! 15. JWT Credential with vc and vp Claims': {
'15. JWT Credential with vc and/or vp Claims': {
'number': 15,
'input_file': '',
'input_file': 'credential-jose-vc-vp-claims.txt',
'key_file': TestVerificationMethods.ed25519,
'fn': TestFunction.verify,
'feature': TestFeature.credential_jose,
'expected_result': TestResult.failure,
},

'!! 16. JWT Presentation with Invalid Credentia': {
'16. JWT Presentation with Invalid Credential': {
'number': 16,
'input_file': '',
'input_file': 'presentation-jose-bad-credential.txt',
'key_file': TestVerificationMethods.ed25519,
'fn': TestFunction.verify,
'feature': TestFeature.presentation_jose,
Expand Down Expand Up @@ -208,7 +217,7 @@ export const SDJWTTestMapping = {

'20. SD-JWT Basic Credential Verification': {
'number': 20,
'input_file': 'credential-selective-signed.json',
'input_file': 'credential-sdjwt-selective.txt',
'key_file': TestVerificationMethods.p384,
'fn': TestFunction.verify,
'feature': TestFeature.credential_sdjwt,
Expand All @@ -217,16 +226,16 @@ export const SDJWTTestMapping = {

'21. SD-JWT Complex Credential Verification': {
'number': 21,
'input_file': 'credential-nested-selective-signed.json',
'input_file': 'credential-sdjwt-nested.txt',
'key_file': TestVerificationMethods.p521,
'fn': TestFunction.verify,
'feature': TestFeature.credential_sdjwt,
'expected_result': TestResult.success,
},

'!! 23. SD-JWT Credential With an Invalid Signature': {
'23. SD-JWT Credential With an Invalid Signature': {
'number': 23,
'input_file': 'presentation-selective-signed.json',
'input_file': 'credential-sdjwt-bad-signature.txt',
'key_file': TestVerificationMethods.p384,
'fn': TestFunction.verify,
'feature': TestFeature.credential_sdjwt,
Expand All @@ -251,7 +260,7 @@ export const SDJWTTestMapping = {
'expected_result': TestResult.failure,
},

'!! 26. SD-JWT Presentation Verification': {
'!! 26. SD-JWT Presentation with Invalid Credentials': {
'number': 26,
'input_file': '',
'key_file': TestVerificationMethods.p384,
Expand Down Expand Up @@ -282,7 +291,7 @@ export const COSETestMapping = {

'29. COSE Basic Credential Verification': {
'number': 29,
'input_file': 'credential-minimal-cose-signed.json',
'input_file': 'credential-cose-minimal.txt',
'key_file': TestVerificationMethods.p256,
'fn': TestFunction.verify,
'feature': TestFeature.credential_cose,
Expand All @@ -291,7 +300,7 @@ export const COSETestMapping = {

'30. COSE Credential Verification Incorrect Encoding': {
'number': 30,
'input_file': 'credential-minimal-cose-signed-not-base64.json',
'input_file': 'credential-cose-minimal-not-base64.txt',
'key_file': TestVerificationMethods.p256,
'fn': TestFunction.verify,
'feature': TestFeature.credential_cose,
Expand All @@ -300,7 +309,7 @@ export const COSETestMapping = {

'31. COSE Basic Presentation Verification': {
'number': 31,
'input_file': 'presentation-single-cose-signed.json',
'input_file': 'presentation-cose-single.txt',
'key_file': TestVerificationMethods.p384,
'fn': TestFunction.verify,
'feature': TestFeature.presentation_cose,
Expand Down
6 changes: 3 additions & 3 deletions tests/test-runner.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import chai from 'chai';
import {getImplementationFeatures, implementationsWithFeatures} from '../implementations/index.js';
import {checkTestResults, generateTestResults} from './test-util.js';
import {COSETestMapping, JOSETestMapping, SDJWTTestMapping} from './test-mapping.js';
import {JOSETestMapping} from './test-mapping.js';

const should = chai.should();

const testMappingSuites = [
{name: 'JOSE Tests', mapping: JOSETestMapping},
{name: 'SD-JWT Tests', mapping: SDJWTTestMapping},
{name: 'COSE Tests', mapping: COSETestMapping},
// {name: 'SD-JWT Tests', mapping: SDJWTTestMapping},
// {name: 'COSE Tests', mapping: COSETestMapping},
];

for (const {name: suiteName, mapping} of testMappingSuites) {
Expand Down

0 comments on commit 3438541

Please sign in to comment.