Skip to content

Commit

Permalink
deploy: 2ef9298
Browse files Browse the repository at this point in the history
  • Loading branch information
OR13 committed Aug 30, 2024
1 parent 1437eba commit c96784d
Show file tree
Hide file tree
Showing 50 changed files with 44,933 additions and 0 deletions.
Empty file.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,349 @@
{
"collection": {
"info": {
"_postman_id": "7573cc79-8d9a-4dfd-8b2e-1c4079752653",
"name": "DID Web Discovery Tutorial",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"id": "76f363bd-3fbf-4085-a4c7-8692f9225b5a",
"name": "Get Access Token",
"request": {
"url": {
"host": [
"{{TOKEN_ENDPOINT}}"
],
"query": [],
"variable": []
},
"method": "POST",
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "audience",
"value": "{{TOKEN_AUDIENCE}}"
},
{
"key": "client_id",
"value": "{{CLIENT_ID}}"
},
{
"key": "client_secret",
"value": "{{CLIENT_SECRET}}"
},
{
"key": "grant_type",
"value": "client_credentials"
},
{
"key": "scope",
"value": "{{CLIENT_SCOPE}}"
}
]
}
},
"response": [],
"event": [
{
"listen": "test",
"script": {
"id": "2f2fbc97-311b-4e1e-af04-3ea75552d25e",
"type": "text/javascript",
"exec": [
"// Token requests are expected to return a `200 Success` response code. Any",
"// other response code should trigger a failure.",
"pm.test(\"must return `200 Success` status\", function() {",
" pm.response.to.have.status(200);",
"})",
"",
"// The response should include an `access_token` value - this will be presented",
"// to authenticated API endpoints in the `Authentication` header (see the last",
"// testing code block for details on how this is persisted).",
"pm.test(\"response body must include non-empty access_token\", function () {",
" const { access_token } = pm.response.json()",
" pm.expect(access_token).to.be.a('string').that.is.not.empty;",
"});",
"",
"// The type of `access_token` returned by the token request is expected to be",
"// `Bearer`.",
"pm.test(\"response body must represent `Bearer` token\", function() {",
" const { token_type } = pm.response.json()",
" pm.expect(token_type).to.equal(\"Bearer\");",
"});",
"",
"// The returned data includes an `expires_in` field that indicates time until",
"// token expiration. Validate that this value is a whole number greater than",
"// zero, as anything less than or equal to zero means that the `access_token`",
"// is already expired.",
"pm.test(\"returned token must expire in the future\", function() {",
" const { expires_in } = pm.response.json()",
" pm.expect(expires_in).to.be.above(0);",
"});",
"",
"// The returned `access_token` value is persisted as a Postman collection",
"// variable that can be accessed by other requests in the collection by calling",
"// `pm.collectionVariables.get(\"access_token\")`.",
"pm.test(\"`access_token` persisted to collectionVariables\", function() {",
" const { access_token } = pm.response.json()",
" pm.collectionVariables.set(\"access_token\", access_token);",
"});"
],
"_lastExecutionId": "1c0f5841-82cb-4872-9528-0fb272a1db81"
}
}
]
},
{
"id": "f3cc6ab8-7c5e-45af-9ef5-ccba8c853530",
"name": "Get Organization DIDs",
"request": {
"url": {
"path": [
"identifiers",
"{{ORGANIZATION_DID_WEB}}"
],
"host": [
"{{API_BASE_URL}}"
],
"query": [],
"variable": []
},
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"method": "GET",
"auth": {
"type": "bearer",
"bearer": [
{
"type": "string",
"value": "{{access_token}}",
"key": "token"
}
]
}
},
"response": [],
"event": [
{
"listen": "test",
"script": {
"id": "7753c95f-665e-4b2e-941a-fe9fdac6708b",
"type": "text/javascript",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"must include valid JSON response body\", function() {",
" pm.response.json(); // will throw on parse failure",
"});",
"",
"// The response JSON must include a didDocument property that contains the",
"// resolved DID document.",
"pm.test(\"didDocument must be present in response body\", function() {",
" const jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('didDocument');",
"});",
"",
"// Service array is used to look up traceability API service endpoint",
"pm.test(\"Response must include 'service' array\", function() {",
" const { service } = pm.response.json().didDocument;",
" pm.expect(service).to.be.an('array').that.is.not.empty;",
"});",
"",
"// Service array must be correctly defined in DID document",
"pm.test(\"'service' array must define Traceability API service endpoint\", function() {",
" const { service } = pm.response.json().didDocument;",
" const entry = service.find((s) => s.type == \"TraceabilityAPI\");",
" pm.expect(entry).to.be.an('object').that.is.not.empty;",
" pm.expect(entry.serviceEndpoint).to.be.a('string').that.is.not.empty;",
"});",
"",
"// If a verificationMethod property is present, the controller property must",
"// match the didDocument.id property.",
"pm.test(\"verification method controller must match did subject\", function() {",
" const { didDocument } = pm.response.json();",
" const vm = didDocument.verificationMethod || [];",
" vm.forEach((m) => pm.expect(m.controller).to.equal(didDocument.id));",
"});"
],
"_lastExecutionId": "aa8ebc0b-7cde-4045-8036-8bdb4e53c9f9"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {}
}
}
]
},
"run": {
"stats": {
"iterations": {
"total": 1,
"pending": 0,
"failed": 0
},
"items": {
"total": 2,
"pending": 0,
"failed": 0
},
"scripts": {
"total": 6,
"pending": 0,
"failed": 0
},
"prerequests": {
"total": 2,
"pending": 0,
"failed": 0
},
"requests": {
"total": 2,
"pending": 0,
"failed": 0
},
"tests": {
"total": 2,
"pending": 0,
"failed": 0
},
"assertions": {
"total": 11,
"pending": 0,
"failed": 0
},
"testScripts": {
"total": 4,
"pending": 0,
"failed": 0
},
"prerequestScripts": {
"total": 2,
"pending": 0,
"failed": 0
}
},
"timings": {
"responseAverage": 2418,
"responseMin": 474,
"responseMax": 4362,
"responseSd": 1944,
"dnsAverage": 0,
"dnsMin": 0,
"dnsMax": 0,
"dnsSd": 0,
"firstByteAverage": 0,
"firstByteMin": 0,
"firstByteMax": 0,
"firstByteSd": 0,
"started": 1724980081331,
"completed": 1724980086242
},
"executions": [
{
"id": "76f363bd-3fbf-4085-a4c7-8692f9225b5a",
"cursor": {
"position": 0,
"iteration": 0,
"length": 2,
"cycles": 1,
"empty": false,
"eof": false,
"bof": true,
"cr": false,
"ref": "1e971e8d-5aaa-4d94-a2e4-d6593f3918dd",
"httpRequestId": "d1af3a40-fc2d-4c12-98a2-9bb643752048"
},
"item": {
"id": "76f363bd-3fbf-4085-a4c7-8692f9225b5a",
"name": "Get Access Token"
},
"response": {
"id": "a7505230-5127-470d-b4fc-9768849212bf",
"status": "OK",
"code": 200,
"responseTime": 474,
"responseSize": 237
},
"assertions": [
{
"assertion": "must return `200 Success` status",
"skipped": false
},
{
"assertion": "response body must include non-empty access_token",
"skipped": false
},
{
"assertion": "response body must represent `Bearer` token",
"skipped": false
},
{
"assertion": "returned token must expire in the future",
"skipped": false
},
{
"assertion": "`access_token` persisted to collectionVariables",
"skipped": false
}
]
},
{
"id": "f3cc6ab8-7c5e-45af-9ef5-ccba8c853530",
"cursor": {
"ref": "9b79b874-a8a9-4b00-b54a-4cdfb9270d21",
"length": 2,
"cycles": 1,
"position": 1,
"iteration": 0,
"httpRequestId": "38cc4fb5-1ca2-4c6d-9289-cce37c3bd5af"
},
"item": {
"id": "f3cc6ab8-7c5e-45af-9ef5-ccba8c853530",
"name": "Get Organization DIDs"
},
"response": {
"id": "41a4b3a4-9b53-4e2a-b7ee-d685501fe738",
"status": "OK",
"code": 200,
"responseTime": 4362,
"responseSize": 1040
},
"assertions": [
{
"assertion": "Status code is 200",
"skipped": false
},
{
"assertion": "must include valid JSON response body",
"skipped": false
},
{
"assertion": "didDocument must be present in response body",
"skipped": false
},
{
"assertion": "Response must include 'service' array",
"skipped": false
},
{
"assertion": "'service' array must define Traceability API service endpoint",
"skipped": false
},
{
"assertion": "verification method controller must match did subject",
"skipped": false
}
]
}
]
}
}
Loading

0 comments on commit c96784d

Please sign in to comment.