{ "info": { "_postman_id": "3dd7cd87-3fa5-4f21-b598-350eebd0d67d", "name": "Test Report Demo", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Discover API Configuration", "event": [ { "listen": "test", "script": { "exec": [ "const jsonResponse = pm.response.json();", "", "pm.test(\"The DID Document MUST contain 'assertionMethod' DID URL\", function () {", " pm.expect(jsonResponse.didDocument.assertionMethod).to.be.an(\"array\");", " pm.expect(jsonResponse.didDocument.assertionMethod[0]).to.be.a(\"string\");", " pm.environment.set(\"issuer_did_url\", jsonResponse.didDocument.assertionMethod[0]);", "});", "", "pm.test(\"The DID Document MUST contain 'authentication' DID URL\", function () {", " pm.expect(jsonResponse.didDocument.authentication).to.be.an(\"array\");", " pm.expect(jsonResponse.didDocument.authentication[0]).to.be.a(\"string\");", " pm.environment.set(\"holder_did_url\", jsonResponse.didDocument.authentication[0]);", "});", "", "pm.test(\"The DID Document MUST contain 'service'\", function () {", " pm.expect(jsonResponse.didDocument.service).to.be.an(\"array\");", " pm.environment.set(\"traceability_api_root\", jsonResponse.didDocument.service[0].serviceEndpoint);", "});" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [ { "key": "Accept", "value": "application/json", "type": "text" } ], "url": { "raw": "https://api.did.actor/identifiers/did:web:api.did.actor:api", "protocol": "https", "host": [ "api", "did", "actor" ], "path": [ "identifiers", "did:web:api.did.actor:api" ] } }, "response": [] }, { "name": "Issue Credential", "event": [ { "listen": "prerequest", "script": { "exec": [ "" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "const {verifiableCredential} = pm.response.json();", "", "pm.test(\"The Verifiable Credential MUST have a 'proof'\", function () {", " pm.expect(verifiableCredential.proof).to.be.an(\"object\");", " pm.environment.set(\"verifiable_credential\", JSON.stringify(verifiableCredential));", "});", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"credential\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"id\": \"urn:uuid:07aa969e-b40d-4c1b-ab46-ded252003ded\",\n \"type\": [\n \"VerifiableCredential\"\n ],\n \"issuer\": \"did:key:z6MktiSzqF9kqwdU8VkdBKx56EYzXfpgnNPUAGznpicNiWfn\",\n \"issuanceDate\": \"{{$isoTimestamp}}\",\n \"credentialSubject\": {\n \"id\": \"did:key:z6MktiSzqF9kqwdU8VkdBKx56EYzXfpgnNPUAGznpicNiWfn\"\n }\n },\n \"options\": {\n \"type\": \"Ed25519Signature2018\"\n }\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{traceability_api_root}}/credentials/issue", "host": [ "{{traceability_api_root}}" ], "path": [ "credentials", "issue" ] } }, "response": [] }, { "name": "Verify Credential", "event": [ { "listen": "test", "script": { "exec": [ "const verification = pm.response.json()", "", "pm.test(\"The Verifiable Credential MUST have been verified\", function () {", " pm.expect(verification.verified).to.eql(true);", "});", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"verifiableCredential\": {{verifiable_credential}}\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{traceability_api_root}}/credentials/verify", "host": [ "{{traceability_api_root}}" ], "path": [ "credentials", "verify" ] } }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "pm.request.headers.add({key: 'User-Agent', value: 'W3C Traceability Interop Tests'});" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }