Skip to content

Commit

Permalink
Merge pull request #736 from w3c-ccg/feat/v2-test-suite
Browse files Browse the repository at this point in the history
Add v2 test suite
  • Loading branch information
nissimsan authored May 23, 2023
2 parents 5cf1b97 + 7940414 commit 64e58ff
Show file tree
Hide file tree
Showing 21 changed files with 24,336 additions and 16,479 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/v2.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: VCDM v2 Test Suite

on: [push]

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.15.1
cache: 'npm'
- run: npm i
- run: npm t
working-directory: packages/traceability-tests

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ docs/testsuite/jest-html-reporters-attach/index.js

packages/traceability-schemas/data/*.json


traceability-tests
4 changes: 4 additions & 0 deletions docs/credentials-with-issuer-dependent-terms.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,9 @@
{
"type": "AgricultureCanineCard",
"count": 20
},
{
"type": "ActivityPubActorCard",
"count": 0
}
]
140 changes: 140 additions & 0 deletions docs/openapi/components/schemas/credentials/ActivityPubActorCard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
$linkedData:
term: ActivityPubActorCard
'@id': https://w3id.org/traceability#ActivityPubActorCard
title: ActivityPub Actor Card
tags:
- VCDMv2
- Other
description: |
A test credential for Verifiable Credential v2
type: object
required:
- '@context'
- id
- type
- issuanceDate
- issuer
- credentialSchema
- credentialSubject
properties:
'@context':
type: array
readOnly: true
default:
- https://www.w3.org/2018/credentials/v1
- https://www.w3.org/ns/activitystreams
items:
- type: string
const: https://www.w3.org/2018/credentials/v1
additionalItems:
type: string
enum:
- https://www.w3.org/ns/activitystreams
type:
type: array
readOnly: true
default:
- VerifiableCredential
- ActivityPubActorCard
const:
- VerifiableCredential
- ActivityPubActorCard
items:
type: string
enum:
- VerifiableCredential
- ActivityPubActorCard
id:
type: string
format: uri
issuanceDate:
type: string
format: date-time
issuer:
type: object
properties:
id:
type: string
format: uri
credentialSubject:
type: object
properties:
type:
type: array
items:
type: string
# https://www.w3.org/TR/activitystreams-vocabulary/#actor-types
enum:
- Application
- Group
- Organization
- Person
- Service
required:
- id
- type
additionalProperties: true
credentialSchema:
type: object
properties:
id:
title: Id
description: The url of the schema file to validate the shape of the json object
type: string
format: uri
example: https://w3id.org/traceability/openapi/components/schemas/credentials/ActivityPubActorCard.yml
default: https://w3id.org/traceability/openapi/components/schemas/credentials/ActivityPubActorCard.yml
readOnly: true
type:
title: Type
description: The type of validation to be run against the defined schema
const: JsonSchema
additionalProperties: false
required:
- id
- type
proof:
type: object
additionalProperties: false
example: |-
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/ns/activitystreams"
],
"id": "urn:credential:1a667a1c-f761-4172-b110-5610ad25f50b",
"type": [
"VerifiableCredential",
"ActivityPubActorCard"
],
"credentialSchema": {
"id": "https://w3c-ccg.github.io/traceability-vocab/openapi/components/schemas/credentials/ActivityPubActorCard.yml",
"type": "JsonSchema"
},
"issuanceDate": "2023-05-21T15:39:57.944Z",
"issuer": {
"id": "did:key:z6MktHQo3fRRohk44dsbE76CuiTpBmyMWq2VVjvV6aBSeE3U"
},
"credentialSubject": {
"type": ["Person"],
"id": "https://kenzoishii.example.com/",
"following": "https://kenzoishii.example.com/following.json",
"followers": "https://kenzoishii.example.com/followers.json",
"liked": "https://kenzoishii.example.com/liked.json",
"inbox": "https://kenzoishii.example.com/inbox.json",
"outbox": "https://kenzoishii.example.com/feed.json",
"preferredUsername": "kenzoishii",
"name": "石井健蔵",
"summary": "この方はただの例です",
"icon": [
"https://kenzoishii.example.com/image/165987aklre4"
]
},
"proof": {
"type": "Ed25519Signature2018",
"created": "2023-05-21T15:45:14Z",
"verificationMethod": "did:key:z6MktHQo3fRRohk44dsbE76CuiTpBmyMWq2VVjvV6aBSeE3U#z6MktHQo3fRRohk44dsbE76CuiTpBmyMWq2VVjvV6aBSeE3U",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..Ijk7g1eOw6juX1yNCHPTPyMA78MwYTLFSBcoNhPrr1ejGuClfT16qo38ALiV7G4qbp5AX9QcMoKkF1ZKx4l0DA"
}
}
12 changes: 12 additions & 0 deletions docs/openapi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,18 @@ paths:
$ref: './components/schemas/common/Workflow.yml'


/schemas/credentials/ActivityPubActorCard.yml:
get:
tags:
- credentials
responses:
'200':
content:
application/yml:
schema:
$ref: './components/schemas/credentials/ActivityPubActorCard.yml'


/schemas/credentials/AgricultureCanineCard.yml:
get:
tags:
Expand Down
Loading

0 comments on commit 64e58ff

Please sign in to comment.