From c81dbc015a38c646432cbc616533d33afd65457e Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Tue, 15 May 2018 16:14:18 +0700 Subject: [PATCH 01/20] Remove --frozen-lockfile from yarn --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e5bc346..1e541a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ jobs: - run: name: Install test dependencies command: | - ~/.yarn/bin/yarn --frozen-lockfile + ~/.yarn/bin/yarn - run: name: Create logs directory command: | From 04ae9c0a2bb5d45b01b58ee5c027e411e064a294 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Tue, 15 May 2018 16:42:26 +0700 Subject: [PATCH 02/20] Add go dep for dependency mgmt --- .circleci/config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e541a8..6d92541 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,10 +33,17 @@ jobs: mkdir -p ~/logs - run: git clone https://github.com/ndidplatform/smart-contract.git /go/src/github.com/ndidplatform/smart-contract + - run: + name: Install go dep + command: | + go get github.com/golang/dep/cmd/dep - run: name: 'Install smart-contract dependencies (todo: use a dep management solution?)' command: | - go get github.com/fatih/color + cd /go/src/github.com/ndidplatform/smart-contract/abci + dep ensure + go install + cd ~/ndid/test - run: git clone https://github.com/ndidplatform/api.git ~/ndid/api - run: name: 'Install api dependencies' From de4525e4afed2dc27f934d0d67ff4053a5fde1ac Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Tue, 15 May 2018 21:14:11 +0700 Subject: [PATCH 03/20] Add script to test with newman --- .circleci/config.yml | 9 + relying_party.postman_collection.json | 912 ++++++++++++++++++++++++++ 2 files changed, 921 insertions(+) create mode 100644 relying_party.postman_collection.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d92541..a4c9180 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,10 +115,19 @@ jobs: SERVER_PORT=8081 \ npm start background: true + - run: + name: Install Newman + command: | + npm install -g newman - run: node waitForLog --file=$HOME/logs/idp-abci.log --text=Commit --count=3 - run: node waitForLog --file=$HOME/logs/rp-abci.log --text=Commit --count=3 #endregion + - run: + name: Run Newman + command: | + ls -l + newman run relying_party.postman_collection.json #region Post-test - store_artifacts: path: ~/logs diff --git a/relying_party.postman_collection.json b/relying_party.postman_collection.json new file mode 100644 index 0000000..9f2ba18 --- /dev/null +++ b/relying_party.postman_collection.json @@ -0,0 +1,912 @@ +{ + "info": { + "_postman_id": "c9580e01-289c-4254-9b58-c0340c32652b", + "name": "relying_party", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "case:special ref_id", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"@#$%^&*<>/\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case:numeric only ref_id", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid2/12345", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid2", + "12345" + ] + } + }, + "response": [ + { + "id": "8f6525ab-2f8f-4421-8422-e8088229411e", + "name": "case:numeric only ref_id1", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": false + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid2/12345", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid2", + "12345" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Connection", + "value": "keep-alive", + "name": "Connection", + "description": "Options that are desired for the connection" + }, + { + "key": "Content-Length", + "value": "230", + "name": "Content-Length", + "description": "The length of the response body in octets (8-bit bytes)" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8", + "name": "Content-Type", + "description": "The mime type of this content" + }, + { + "key": "Date", + "value": "Mon, 14 May 2018 09:05:39 GMT", + "name": "Date", + "description": "The date and time that the message was sent" + }, + { + "key": "ETag", + "value": "W/\"e6-av+oALfDcpm70SiNScFyXvnXOfw\"", + "name": "ETag", + "description": "An identifier for a specific version of a resource, often a message digest" + }, + { + "key": "X-Powered-By", + "value": "Express", + "name": "X-Powered-By", + "description": "Specifies the technology (ASP.NET, PHP, JBoss, e.g.) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)" + } + ], + "cookie": [], + "body": "{\"requestId\":\"Hash(Concat_with_nonce_8616(eyJpZHBfbGlzdCI6WyJzdHJpbmciXSwiY2FsbGJhY2tfdXJsIjoiaHR0cDovL2xvY2FsaG9zdCIsInJlcXVlc3RfbWVzc2FnZSI6Ik9LIiwibWluX2lhbCI6MSwibWluX2FhbCI6MSwibWluX2lkcCI6MSwicmVxdWVzdF90aW1lb3V0IjowfQ==))\"}" + } + ] + }, + { + "name": "case:alphabet ref_id", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABCDEzxc\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case:alphanumeric ref_id", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: idp_list", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: numeric req_msg", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"1234\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: alphanumeric req_msg", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"ABAabcd1234\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: alphabet req_msg", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"ABAabcd\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: special character req_msg", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"@#$%^&*<>?\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: empty req_msg", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: more than limit ial&aal", + "event": [ + { + "listen": "test", + "script": { + "id": "c0f3cd56-d9e4-446a-891c-7df8fdb7e9f1", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 4,\n \"min_aal\": 4,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: not integer ial & aal", + "event": [ + { + "listen": "test", + "script": { + "id": "4acd90e4-74ae-4579-b33b-fbc91f5a44a9", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"not integer\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.errors[0].message).to.eql(\"should be integer\");", + "});", + "", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": \"3.0\",\n \"min_aal\": \"3.0\",\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: less than 1 count", + "event": [ + { + "listen": "test", + "script": { + "id": "1a482e66-054d-4dc9-b63f-1e70298053ba", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"less than 1\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.errors[0].message).to.eql(\"should be >= 1\");", + "});", + "", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 0,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: not integer 1 count", + "event": [ + { + "listen": "test", + "script": { + "id": "7b5dcda4-abfc-4842-843f-db89d806e090", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"not integer\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.errors[0].message).to.eql(\"should be integer\");", + "});", + "", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1.1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 0,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case: integer count", + "event": [ + { + "listen": "test", + "script": { + "id": "a97bb7f4-21a4-4174-90cb-0e0d8d23062e", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 2,\n \"request_timeout\": 3\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + }, + { + "name": "case:empty reference_id", + "event": [ + { + "listen": "test", + "script": { + "id": "c6c56f02-1996-4001-b894-5a9061aa877e", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", + "protocol": "http", + "host": [ + "10", + "10", + "5", + "134" + ], + "port": "8081", + "path": [ + "rp", + "requests", + "uid", + "123456" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "9661c4b9-50c2-4dd3-a3e3-758aa9c84d40", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "7d4234e5-cb1c-4cec-8508-dc9eccf1fe3b", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "id": "407a7eb1-8bee-4b3d-8f66-8f5f0f7e705f", + "key": "url", + "value": "http://127.0.0.1:8081/rp/requests/", + "type": "string", + "description": "" + } + ] +} From 0e70ae54aaad5576ef3452e8ce29ccafa096b945 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Tue, 15 May 2018 21:22:16 +0700 Subject: [PATCH 04/20] Fix Newman installation to use sudo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a4c9180..e97d44e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -118,7 +118,7 @@ jobs: - run: name: Install Newman command: | - npm install -g newman + sudo npm install -g newman - run: node waitForLog --file=$HOME/logs/idp-abci.log --text=Commit --count=3 - run: node waitForLog --file=$HOME/logs/rp-abci.log --text=Commit --count=3 #endregion From b7950af02d6a87394e86e6ad6ee03e7acb2dce77 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Wed, 16 May 2018 12:27:12 +0700 Subject: [PATCH 05/20] Fix IP to be localhost --- .circleci/config.yml | 1 - relying_party.postman_collection.json | 85 ++++++--------------------- 2 files changed, 17 insertions(+), 69 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e97d44e..f84b067 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -126,7 +126,6 @@ jobs: - run: name: Run Newman command: | - ls -l newman run relying_party.postman_collection.json #region Post-test - store_artifacts: diff --git a/relying_party.postman_collection.json b/relying_party.postman_collection.json index 9f2ba18..63c0573 100644 --- a/relying_party.postman_collection.json +++ b/relying_party.postman_collection.json @@ -37,10 +37,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -85,10 +82,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid2/12345", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -120,10 +114,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid2/12345", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -212,10 +203,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -260,10 +248,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -308,10 +293,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -356,10 +338,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -404,10 +383,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -452,10 +428,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -500,10 +473,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -548,10 +518,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -598,10 +565,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -653,10 +617,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -708,10 +669,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -763,10 +721,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -813,10 +768,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ @@ -861,10 +813,7 @@ "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", "protocol": "http", "host": [ - "10", - "10", - "5", - "134" + "127","0","0","1" ], "port": "8081", "path": [ From 5dcafc30df8f97455f25c860a482624f0cfe3ad0 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Wed, 16 May 2018 18:23:44 +0700 Subject: [PATCH 06/20] Add log for API --- .circleci/config.yml | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f84b067..db89442 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -96,24 +96,28 @@ jobs: - run: name: idp-api command: | - cd ~/ndid/api - ROLE=idp \ - MQ_CONTACT_IP=127.0.0.1 \ - MQ_BINDING_PORT=5555 \ - ABCI_APP_CALLBACK_PORT=3000 \ - SERVER_PORT=8080 \ - npm start + ( + cd ~/ndid/api + ROLE=idp \ + MQ_CONTACT_IP=127.0.0.1 \ + MQ_BINDING_PORT=5555 \ + ABCI_APP_CALLBACK_PORT=3000 \ + SERVER_PORT=8080 \ + npm start + ) 2>&1 | tee -a ~/logs/idp-api.log background: true - run: name: rp-api command: | - cd ~/ndid/api - ROLE=rp \ - ABCI_APP_CALLBACK_PORT=3001 \ - MQ_CONTACT_IP=127.0.0.1 \ - MQ_BINDING_PORT=5556 \ - SERVER_PORT=8081 \ - npm start + ( + cd ~/ndid/api + ROLE=rp \ + ABCI_APP_CALLBACK_PORT=3001 \ + MQ_CONTACT_IP=127.0.0.1 \ + MQ_BINDING_PORT=5556 \ + SERVER_PORT=8081 \ + npm start + ) 2>&1 | tee -a ~/logs/idp-rp.log background: true - run: name: Install Newman From 59a19f3b37c98e7c835764114842a200df4da06e Mon Sep 17 00:00:00 2001 From: Prapat Borriboonpoka Date: Wed, 16 May 2018 18:32:19 +0700 Subject: [PATCH 07/20] Update relying_party.postman_collection.json --- relying_party.postman_collection.json | 84 +++++---------------------- 1 file changed, 16 insertions(+), 68 deletions(-) diff --git a/relying_party.postman_collection.json b/relying_party.postman_collection.json index 63c0573..7affd75 100644 --- a/relying_party.postman_collection.json +++ b/relying_party.postman_collection.json @@ -31,7 +31,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"@#$%^&*<>/\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"@#$%^&*<>/\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -76,7 +76,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid2/12345", @@ -108,7 +108,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid2/12345", @@ -197,7 +197,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABCDEzxc\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABCDEzxc\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -242,7 +242,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -287,7 +287,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -332,7 +332,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"1234\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"1234\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -377,7 +377,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"ABAabcd1234\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"ABAabcd1234\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -422,7 +422,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"ABAabcd\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"ABAabcd\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -467,7 +467,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"@#$%^&*<>?\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"@#$%^&*<>?\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -512,7 +512,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -577,59 +577,7 @@ } }, "response": [] - }, - { - "name": "case: not integer ial & aal", - "event": [ - { - "listen": "test", - "script": { - "id": "4acd90e4-74ae-4579-b33b-fbc91f5a44a9", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"not integer\", function () {", - " var jsonData = pm.response.json();", - " pm.expect(jsonData.errors[0].message).to.eql(\"should be integer\");", - "});", - "", - "" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": \"3.0\",\n \"min_aal\": \"3.0\",\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, + }, { "name": "case: less than 1 count", "event": [ @@ -663,7 +611,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 0,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 0,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -715,7 +663,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1.1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 0,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1.1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 0,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -762,7 +710,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 2,\n \"request_timeout\": 3\n}\n" + "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 2,\n \"request_timeout\": 3\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", @@ -807,7 +755,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", From 2044faf57145442e349fe4a470dedc9863c45c34 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 15:26:15 +0700 Subject: [PATCH 08/20] Apply new base image for reducing the build time --- .circleci/config.yml | 65 +++++++++------------------ relying_party.postman_collection.json | 2 +- 2 files changed, 23 insertions(+), 44 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index db89442..dad00c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,52 +3,26 @@ jobs: build: docker: # CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/ - - image: circleci/golang:1.10.1 - working_directory: ~/ndid/test + - image: ndidplatform/base-test + working_directory: /ndid/test steps: - checkout - - run: - name: Install Node.js - command: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - && sudo apt-get install -y nodejs - - run: - name: Install Tendermint ABCI - command: go get github.com/tendermint/abci/cmd/abci-cli - - run: - name: Install Tendermint - command: | - wget https://github.com/tendermint/tendermint/releases/download/v0.16.0/tendermint_0.16.0_linux_amd64.zip - unzip tendermint_0.16.0_linux_amd64.zip - sudo install tendermint /usr/local/bin - - run: - name: Install Yarn - command: | - curl -o- -L https://yarnpkg.com/install.sh | bash - run: name: Install test dependencies command: | ~/.yarn/bin/yarn - - run: - name: Create logs directory - command: | - mkdir -p ~/logs - - run: git clone https://github.com/ndidplatform/smart-contract.git /go/src/github.com/ndidplatform/smart-contract - - run: - name: Install go dep - command: | - go get github.com/golang/dep/cmd/dep - run: name: 'Install smart-contract dependencies (todo: use a dep management solution?)' command: | cd /go/src/github.com/ndidplatform/smart-contract/abci dep ensure go install - cd ~/ndid/test - - run: git clone https://github.com/ndidplatform/api.git ~/ndid/api + - run: git clone https://github.com/ndidplatform/api.git /ndid/api - run: name: 'Install api dependencies' command: | - cd ~/ndid/api + cd /ndid/api npm install #region Start IDP node @@ -58,7 +32,7 @@ jobs: ( cd /go/src/github.com/ndidplatform/smart-contract CALLBACK_URI=http://localhost:3000/callback go run abci/server.go tcp://127.0.0.1:46000 - ) 2>&1 | tee -a ~/logs/idp-abci.log + ) 2>&1 | tee -a /ndid/logs/idp-abci.log background: true - run: name: idp-tendermint @@ -67,7 +41,7 @@ jobs: cd /go/src/github.com/ndidplatform/smart-contract tendermint --home ./config/tendermint/IdP unsafe_reset_all tendermint --home ./config/tendermint/IdP node --consensus.create_empty_blocks=false - ) 2>&1 | tee -a ~/logs/idp-tendermint.log + ) 2>&1 | tee -a /ndid/logs/idp-tendermint.log background: true #endregion #region Start RP node @@ -77,7 +51,7 @@ jobs: ( cd /go/src/github.com/ndidplatform/smart-contract CALLBACK_URI=http://localhost:3001/callback go run abci/server.go tcp://127.0.0.1:46001 - ) 2>&1 | tee -a ~/logs/rp-abci.log + ) 2>&1 | tee -a /ndid/logs/rp-abci.log background: true - run: name: rp-tendermint @@ -86,53 +60,58 @@ jobs: cd /go/src/github.com/ndidplatform/smart-contract tendermint --home ./config/tendermint/RP unsafe_reset_all tendermint --home ./config/tendermint/RP node --consensus.create_empty_blocks=false - ) 2>&1 | tee -a ~/logs/rp-tendermint.log + ) 2>&1 | tee -a /ndid/logs/rp-tendermint.log background: true #endregion - - run: node waitForLog --file=$HOME/logs/idp-abci.log --text=Commit --count=2 - - run: node waitForLog --file=$HOME/logs/rp-abci.log --text=Commit --count=2 + - run: node waitForLog --file=/ndid/logs/idp-abci.log --text=Commit --count=2 + - run: node waitForLog --file=/ndid/logs/rp-abci.log --text=Commit --count=2 #region Start IDP API - run: name: idp-api command: | ( - cd ~/ndid/api + cd /ndid/api ROLE=idp \ MQ_CONTACT_IP=127.0.0.1 \ MQ_BINDING_PORT=5555 \ ABCI_APP_CALLBACK_PORT=3000 \ SERVER_PORT=8080 \ npm start - ) 2>&1 | tee -a ~/logs/idp-api.log + ) 2>&1 | tee -a /ndid/logs/idp-api.log background: true - run: name: rp-api command: | ( - cd ~/ndid/api + cd /ndid/api ROLE=rp \ ABCI_APP_CALLBACK_PORT=3001 \ MQ_CONTACT_IP=127.0.0.1 \ MQ_BINDING_PORT=5556 \ SERVER_PORT=8081 \ npm start - ) 2>&1 | tee -a ~/logs/idp-rp.log + ) 2>&1 | tee -a /ndid/logs/rp-api.log background: true - run: name: Install Newman command: | sudo npm install -g newman - - run: node waitForLog --file=$HOME/logs/idp-abci.log --text=Commit --count=3 - - run: node waitForLog --file=$HOME/logs/rp-abci.log --text=Commit --count=3 + - run: node waitForLog --file=/ndid/logs/idp-abci.log --text=Commit --count=3 + - run: node waitForLog --file=/ndid/logs/rp-abci.log --text=Commit --count=3 #endregion + - run: + name: Init sample identity + command: | + curl --header 'Content-Type: Application/json' -X POST --data " {\"namespace\": \"uid\", \"identifier\" : \"123456\", \"secret\":\"MAGIC\", \"accessor_type\":\"awesome-type\", \"accessor_key\":\"awesome-key\",\"accessor_id\":\"some-awesome-accessor\"}" http://localhost:8080/identity + - run: name: Run Newman command: | newman run relying_party.postman_collection.json #region Post-test - store_artifacts: - path: ~/logs + path: /ndid/logs destination: logs #endregion diff --git a/relying_party.postman_collection.json b/relying_party.postman_collection.json index 7affd75..257322c 100644 --- a/relying_party.postman_collection.json +++ b/relying_party.postman_collection.json @@ -31,7 +31,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"@#$%^&*<>/\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"@#$%^&*<>/\",\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"demo\":\"string\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", From 6874dbafd014175ae6e881fadd1798c8bebb74a6 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 16:31:04 +0700 Subject: [PATCH 09/20] Initialize Dev Key and store test result from Newman --- .circleci/config.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dad00c1..b4ecebe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,6 +67,11 @@ jobs: - run: node waitForLog --file=/ndid/logs/rp-abci.log --text=Commit --count=2 #region Start IDP API + - run: + name: Initialize Dev Key + command: | + cd /ndid/api + npm run initDevKey - run: name: idp-api command: | @@ -93,10 +98,6 @@ jobs: npm start ) 2>&1 | tee -a /ndid/logs/rp-api.log background: true - - run: - name: Install Newman - command: | - sudo npm install -g newman - run: node waitForLog --file=/ndid/logs/idp-abci.log --text=Commit --count=3 - run: node waitForLog --file=/ndid/logs/rp-abci.log --text=Commit --count=3 #endregion @@ -109,8 +110,10 @@ jobs: - run: name: Run Newman command: | - newman run relying_party.postman_collection.json + newman run relying_party.postman_collection.json --reporters junit #region Post-test + - store_test_results: + path: /ndid/test/newman - store_artifacts: path: /ndid/logs destination: logs From 0e1bd4e57550b97ec4df1432f4c72c8a95eb743a Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 16:53:52 +0700 Subject: [PATCH 10/20] Fix indentation --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b4ecebe..4e42076 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,7 +113,7 @@ jobs: newman run relying_party.postman_collection.json --reporters junit #region Post-test - store_test_results: - path: /ndid/test/newman + path: /ndid/test/newman - store_artifacts: path: /ndid/logs destination: logs From cc04d82916553e706cc3b53d9f87005d6671d858 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 17:03:16 +0700 Subject: [PATCH 11/20] Add delay before creating sample identity --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4e42076..6e62823 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,6 +105,7 @@ jobs: - run: name: Init sample identity command: | + sleep 10 curl --header 'Content-Type: Application/json' -X POST --data " {\"namespace\": \"uid\", \"identifier\" : \"123456\", \"secret\":\"MAGIC\", \"accessor_type\":\"awesome-type\", \"accessor_key\":\"awesome-key\",\"accessor_id\":\"some-awesome-accessor\"}" http://localhost:8080/identity - run: From 5f6b10b533817da3d4ce2084b8469857ed4a294c Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 17:21:03 +0700 Subject: [PATCH 12/20] Store test report Artifact --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6e62823..2c12e38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,7 +105,7 @@ jobs: - run: name: Init sample identity command: | - sleep 10 + sleep 5 curl --header 'Content-Type: Application/json' -X POST --data " {\"namespace\": \"uid\", \"identifier\" : \"123456\", \"secret\":\"MAGIC\", \"accessor_type\":\"awesome-type\", \"accessor_key\":\"awesome-key\",\"accessor_id\":\"some-awesome-accessor\"}" http://localhost:8080/identity - run: @@ -118,4 +118,6 @@ jobs: - store_artifacts: path: /ndid/logs destination: logs + - store_artifacts: + path: /ndid/test/newman #endregion From 8f9e8bbcdd2dc220efc0599d7cca1bb77de75982 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 19:06:51 +0700 Subject: [PATCH 13/20] Update test and move to folder postman --- .circleci/config.yml | 2 +- postman/env1.postman_environment.json | 39 + postman/relying_party.postman_collection.json | 376 ++++++++ relying_party.postman_collection.json | 809 ------------------ 4 files changed, 416 insertions(+), 810 deletions(-) create mode 100644 postman/env1.postman_environment.json create mode 100644 postman/relying_party.postman_collection.json delete mode 100644 relying_party.postman_collection.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c12e38..209bd46 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -111,7 +111,7 @@ jobs: - run: name: Run Newman command: | - newman run relying_party.postman_collection.json --reporters junit + newman run postman/relying_party.postman_collection.json -e postman/env1.postman_environment.json --reporters junit #region Post-test - store_test_results: path: /ndid/test/newman diff --git a/postman/env1.postman_environment.json b/postman/env1.postman_environment.json new file mode 100644 index 0000000..da987b7 --- /dev/null +++ b/postman/env1.postman_environment.json @@ -0,0 +1,39 @@ +{ + "id": "c0caabb4-fcb0-47c4-9641-90974cd2324d", + "name": "env1", + "values": [ + { + "key": "url_idp", + "value": "10.10.5.134:8080", + "enabled": true, + "type": "text" + }, + { + "key": "url_rp", + "value": "10.10.5.134:8081", + "enabled": true, + "type": "text" + }, + { + "key": "url_as", + "value": "10.10.5.134:8082", + "enabled": true, + "type": "text" + }, + { + "key": "namespace", + "value": "uuidTest1", + "enabled": true, + "type": "text" + }, + { + "key": "identifier", + "value": "12345", + "enabled": true, + "type": "text" + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-05-21T10:51:53.502Z", + "_postman_exported_using": "Postman/6.0.10" +} \ No newline at end of file diff --git a/postman/relying_party.postman_collection.json b/postman/relying_party.postman_collection.json new file mode 100644 index 0000000..3f90514 --- /dev/null +++ b/postman/relying_party.postman_collection.json @@ -0,0 +1,376 @@ +{ + "info": { + "_postman_id": "9f50b7c6-eaaa-41bf-8de7-963428b386f5", + "name": "Relying_party", + "description": "API for RP specific functions and roles", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "POST /rp/requests/{namespace}/{identifier}", + "description": "/rp/requests/{namespace}/{identifier}\n", + "item": [ + { + "name": "reference_id", + "description": "", + "item": [ + { + "name": "Case: Send request to namespace and identity success", + "event": [ + { + "listen": "test", + "script": { + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "38243afb-9cb8-444f-8795-e4dfe11a404f", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"ABCDEzxc\",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + }, + "url": { + "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", + "host": [ + "{{url_rp}}" + ], + "path": [ + "rp", + "requests", + "{{namespace}}", + "{{identifier}}" + ] + } + }, + "response": [] + }, + { + "name": "Case: Input reference id with empty", + "event": [ + { + "listen": "test", + "script": { + "id": "adb45711-3b6d-42d5-bc25-da78cc2e3553", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "", + "", + "pm.test('Should shows error \"should not be shorter than 1 characters\"' , function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.errors[0].message).to.eql(\"should NOT be shorter than 1 characters\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "f28ea516-45c4-44b7-8d6f-b0660216135c", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"\",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"string\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 0,\n \"request_params\": {\"key\":\"value\"}\n }\n ],\n \"request_message\": \"string\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + }, + "url": { + "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", + "host": [ + "{{url_rp}}" + ], + "path": [ + "rp", + "requests", + "{{namespace}}", + "{{identifier}}" + ] + } + }, + "response": [] + }, + { + "name": "Case: Input reference id with space", + "event": [ + { + "listen": "test", + "script": { + "id": "43101a2e-7557-4ab8-953c-2b6b6405aac8", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "0fbc562e-1dc7-416c-ba3f-425201e5d6b0", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \" \",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + }, + "url": { + "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", + "host": [ + "{{url_rp}}" + ], + "path": [ + "rp", + "requests", + "{{namespace}}", + "{{identifier}}" + ] + } + }, + "response": [] + }, + { + "name": "Case: Input reference id with special characters", + "event": [ + { + "listen": "test", + "script": { + "id": "31dad7ae-8ab3-4564-b055-7a15d6f8f3a6", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "", + "", + "" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "59cdad85-5e7c-45f1-afb8-6cd0c305e22c", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": \"AaB@#$%^<>\",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + }, + "url": { + "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", + "host": [ + "{{url_rp}}" + ], + "path": [ + "rp", + "requests", + "{{namespace}}", + "{{identifier}}" + ] + } + }, + "response": [] + }, + { + "name": "Case: Input reference id without string", + "event": [ + { + "listen": "test", + "script": { + "id": "c278b8b7-8069-4f8e-b86e-7e49c8cab551", + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "", + "" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "ccd21406-60f3-4ec9-a869-2cf948abf122", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"reference_id\": 12234,\n \"idp_list\": [\n \t\"idp1\",\"ab12\",\"QEsafd\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + }, + "url": { + "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", + "host": [ + "{{url_rp}}" + ], + "path": [ + "rp", + "requests", + "{{namespace}}", + "{{identifier}}" + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "82ddee3f-d81e-4fed-89c0-657074673e3f", + "type": "text/javascript", + "exec": [ + "var url_idp = pm.variables.get(\"url_idp\");", + "", + "const createIdentity = {", + " url: url_idp +\"/identity\",", + " method: 'POST',", + " header: \"Content-Type:application/json\",", + " body:{", + " mode: 'raw',", + " raw: JSON.stringify({", + " \"namespace\": \"uuidTest1\",", + " \"identifier\": \"12345\",", + " \"secret\": \"abc\",", + " \"accessor_type\": \"a\",", + " \"accessor_key\": \"ab\",", + " \"accessor_id\": \"cc\"", + " ", + " })", + " }", + "};", + "", + "pm.sendRequest(createIdentity, function (err, response) {", + " if (err) {", + " console.log(err);", + " } else {", + " console.log(response.json());", + " pm.environment.set(\"namespace\", \"uuidTest1\");", + " pm.environment.set(\"identifier\", \"12345\");", + " }", + "});" + ] + } + }, + { + "listen": "test", + "script": { + "id": "ec1d75b0-c05c-4144-b9d5-e6e6f9171b31", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "043b2dd6-510f-4a05-a591-9afbb5a6cf7d", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "f03a263b-d9d7-4307-909c-1c39545da545", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] +} \ No newline at end of file diff --git a/relying_party.postman_collection.json b/relying_party.postman_collection.json deleted file mode 100644 index 257322c..0000000 --- a/relying_party.postman_collection.json +++ /dev/null @@ -1,809 +0,0 @@ -{ - "info": { - "_postman_id": "c9580e01-289c-4254-9b58-c0340c32652b", - "name": "relying_party", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "case:special ref_id", - "event": [ - { - "listen": "test", - "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"@#$%^&*<>/\",\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"demo\":\"string\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case:numeric only ref_id", - "event": [ - { - "listen": "test", - "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid2/12345", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid2", - "12345" - ] - } - }, - "response": [ - { - "id": "8f6525ab-2f8f-4421-8422-e8088229411e", - "name": "case:numeric only ref_id1", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "disabled": false - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid2/12345", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid2", - "12345" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Connection", - "value": "keep-alive", - "name": "Connection", - "description": "Options that are desired for the connection" - }, - { - "key": "Content-Length", - "value": "230", - "name": "Content-Length", - "description": "The length of the response body in octets (8-bit bytes)" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8", - "name": "Content-Type", - "description": "The mime type of this content" - }, - { - "key": "Date", - "value": "Mon, 14 May 2018 09:05:39 GMT", - "name": "Date", - "description": "The date and time that the message was sent" - }, - { - "key": "ETag", - "value": "W/\"e6-av+oALfDcpm70SiNScFyXvnXOfw\"", - "name": "ETag", - "description": "An identifier for a specific version of a resource, often a message digest" - }, - { - "key": "X-Powered-By", - "value": "Express", - "name": "X-Powered-By", - "description": "Specifies the technology (ASP.NET, PHP, JBoss, e.g.) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)" - } - ], - "cookie": [], - "body": "{\"requestId\":\"Hash(Concat_with_nonce_8616(eyJpZHBfbGlzdCI6WyJzdHJpbmciXSwiY2FsbGJhY2tfdXJsIjoiaHR0cDovL2xvY2FsaG9zdCIsInJlcXVlc3RfbWVzc2FnZSI6Ik9LIiwibWluX2lhbCI6MSwibWluX2FhbCI6MSwibWluX2lkcCI6MSwicmVxdWVzdF90aW1lb3V0IjowfQ==))\"}" - } - ] - }, - { - "name": "case:alphabet ref_id", - "event": [ - { - "listen": "test", - "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABCDEzxc\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case:alphanumeric ref_id", - "event": [ - { - "listen": "test", - "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case: idp_list", - "event": [ - { - "listen": "test", - "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case: numeric req_msg", - "event": [ - { - "listen": "test", - "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"1234\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case: alphanumeric req_msg", - "event": [ - { - "listen": "test", - "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"ABAabcd1234\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case: alphabet req_msg", - "event": [ - { - "listen": "test", - "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"ABAabcd\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case: special character req_msg", - "event": [ - { - "listen": "test", - "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"@#$%^&*<>?\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case: empty req_msg", - "event": [ - { - "listen": "test", - "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case: more than limit ial&aal", - "event": [ - { - "listen": "test", - "script": { - "id": "c0f3cd56-d9e4-446a-891c-7df8fdb7e9f1", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 4,\n \"min_aal\": 4,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case: less than 1 count", - "event": [ - { - "listen": "test", - "script": { - "id": "1a482e66-054d-4dc9-b63f-1e70298053ba", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test(\"less than 1\", function () {", - " var jsonData = pm.response.json();", - " pm.expect(jsonData.errors[0].message).to.eql(\"should be >= 1\");", - "});", - "", - "" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 0,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case: not integer 1 count", - "event": [ - { - "listen": "test", - "script": { - "id": "7b5dcda4-abfc-4842-843f-db89d806e090", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test(\"not integer\", function () {", - " var jsonData = pm.response.json();", - " pm.expect(jsonData.errors[0].message).to.eql(\"should be integer\");", - "});", - "", - "" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1.1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 0,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case: integer count", - "event": [ - { - "listen": "test", - "script": { - "id": "a97bb7f4-21a4-4174-90cb-0e0d8d23062e", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"ABa12345678\",\n \"idp_list\": [\n \"123\",\"acc\",\"12Ab\",\"@#$AS12\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 2,\n \"request_timeout\": 3\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - }, - { - "name": "case:empty reference_id", - "event": [ - { - "listen": "test", - "script": { - "id": "c6c56f02-1996-4001-b894-5a9061aa877e", - "type": "text/javascript", - "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"reference_id\": \"\",\n \"idp_list\": [\n \"string\"\n ],\n \"callback_url\": \"http://localhost\",\n \"data_request_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"params\": \"string\"\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8081/rp/requests/uid/123456", - "protocol": "http", - "host": [ - "127","0","0","1" - ], - "port": "8081", - "path": [ - "rp", - "requests", - "uid", - "123456" - ] - } - }, - "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "9661c4b9-50c2-4dd3-a3e3-758aa9c84d40", - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "id": "7d4234e5-cb1c-4cec-8508-dc9eccf1fe3b", - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "variable": [ - { - "id": "407a7eb1-8bee-4b3d-8f66-8f5f0f7e705f", - "key": "url", - "value": "http://127.0.0.1:8081/rp/requests/", - "type": "string", - "description": "" - } - ] -} From 63cc03cdf573ec1389f2b799e63280d523469436 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 19:12:41 +0700 Subject: [PATCH 14/20] Change test host to be localhost --- postman/env1.postman_environment.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/postman/env1.postman_environment.json b/postman/env1.postman_environment.json index da987b7..499f3dc 100644 --- a/postman/env1.postman_environment.json +++ b/postman/env1.postman_environment.json @@ -4,19 +4,19 @@ "values": [ { "key": "url_idp", - "value": "10.10.5.134:8080", + "value": "127.0.0.1:8080", "enabled": true, "type": "text" }, { "key": "url_rp", - "value": "10.10.5.134:8081", + "value": "127.0.0.1:8081", "enabled": true, "type": "text" }, { "key": "url_as", - "value": "10.10.5.134:8082", + "value": "127.0.0.1:8082", "enabled": true, "type": "text" }, @@ -36,4 +36,4 @@ "_postman_variable_scope": "environment", "_postman_exported_at": "2018-05-21T10:51:53.502Z", "_postman_exported_using": "Postman/6.0.10" -} \ No newline at end of file +} From a6a6c613c110cf8fc7c5c6573b32fabe71e521a2 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 19:34:00 +0700 Subject: [PATCH 15/20] Verbose test result --- .circleci/config.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 209bd46..93ff6a5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -102,16 +102,11 @@ jobs: - run: node waitForLog --file=/ndid/logs/rp-abci.log --text=Commit --count=3 #endregion - - run: - name: Init sample identity - command: | - sleep 5 - curl --header 'Content-Type: Application/json' -X POST --data " {\"namespace\": \"uid\", \"identifier\" : \"123456\", \"secret\":\"MAGIC\", \"accessor_type\":\"awesome-type\", \"accessor_key\":\"awesome-key\",\"accessor_id\":\"some-awesome-accessor\"}" http://localhost:8080/identity - - run: name: Run Newman command: | - newman run postman/relying_party.postman_collection.json -e postman/env1.postman_environment.json --reporters junit + sleep 3 + newman run postman/relying_party.postman_collection.json -e postman/env1.postman_environment.json --reporters junit,cli #region Post-test - store_test_results: path: /ndid/test/newman @@ -120,4 +115,5 @@ jobs: destination: logs - store_artifacts: path: /ndid/test/newman + destination: tests #endregion From a09ae71756f46c0ac4f60a3e4fba2dec712638eb Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 20:51:42 +0700 Subject: [PATCH 16/20] Force waitForLog to quit after waiting for 1 minutes --- waitForLog.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/waitForLog.js b/waitForLog.js index 83d25e2..dae0297 100644 --- a/waitForLog.js +++ b/waitForLog.js @@ -15,6 +15,11 @@ function main () { check() } +function exitWhenTimeOff() { + console.log("Exit because it is too long") + process.exit(1) +} + function check () { const data = fs.readFileSync(args.file, 'utf8') const found = data.split(text).length - 1 @@ -26,4 +31,5 @@ function check () { } } +setTimeout(exitWhenTimeOff, 60000) main() From aa9d5c7be84b1a41b9a0a59c971fe4d262d5fb2f Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 20:53:08 +0700 Subject: [PATCH 17/20] Remove idp_list parameter from Postman Script --- postman/relying_party.postman_collection.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/postman/relying_party.postman_collection.json b/postman/relying_party.postman_collection.json index 3f90514..9bdf89b 100644 --- a/postman/relying_party.postman_collection.json +++ b/postman/relying_party.postman_collection.json @@ -50,7 +50,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABCDEzxc\",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"ABCDEzxc\",\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", @@ -110,7 +110,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"\",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"string\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 0,\n \"request_params\": {\"key\":\"value\"}\n }\n ],\n \"request_message\": \"string\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + "raw": "{\n \"reference_id\": \"\",\n \"callback_url\": \"string\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 0,\n \"request_params\": {\"key\":\"value\"}\n }\n ],\n \"request_message\": \"string\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" }, "url": { "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", @@ -165,7 +165,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \" \",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + "raw": "{\n \"reference_id\": \" \",\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" }, "url": { "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", @@ -222,7 +222,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"AaB@#$%^<>\",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + "raw": "{\n \"reference_id\": \"AaB@#$%^<>\",\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" }, "url": { "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", From fca3310f51d5e2340d45933fa3ff7c3aa1f2f8fc Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Mon, 21 May 2018 21:02:58 +0700 Subject: [PATCH 18/20] Do good exit when matching is complete --- waitForLog.js | 1 + 1 file changed, 1 insertion(+) diff --git a/waitForLog.js b/waitForLog.js index dae0297..62f84ed 100644 --- a/waitForLog.js +++ b/waitForLog.js @@ -26,6 +26,7 @@ function check () { console.log('Found', found, 'match(es).') if (found >= count) { console.log('Done!') + process.exit(0) } else { setTimeout(check, 1000) } From 13c148fd655df381bc8593b77aedce98de02b333 Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Tue, 22 May 2018 17:06:18 +0700 Subject: [PATCH 19/20] Initialze identity before conducting tests --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 93ff6a5..75c5fc6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,6 +106,8 @@ jobs: name: Run Newman command: | sleep 3 + curl --header 'Content-Type: Application/json' -X POST --data " {\"namespace\": \"uuidTest1\", \"identifier\" : \"12345\", \"secret\":\"MAGIC\", \"accessor_type\":\"awesome-type\", \"accessor_key\":\"awesome-key\",\"accessor_id\":\"some-awesome-accessor\"}" http://localhost:8080/identity + sleep 1 newman run postman/relying_party.postman_collection.json -e postman/env1.postman_environment.json --reporters junit,cli #region Post-test - store_test_results: From 970eef3d60c0f8b49e754248fc00a321995a025d Mon Sep 17 00:00:00 2001 From: Teerayut Hiruntaraporn Date: Tue, 22 May 2018 17:06:35 +0700 Subject: [PATCH 20/20] Update postman test config --- postman/relying_party.postman_collection.json | 77 +++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/postman/relying_party.postman_collection.json b/postman/relying_party.postman_collection.json index 9bdf89b..a526be3 100644 --- a/postman/relying_party.postman_collection.json +++ b/postman/relying_party.postman_collection.json @@ -15,16 +15,23 @@ "description": "", "item": [ { - "name": "Case: Send request to namespace and identity success", + "name": "Case: Input reference id with empty", "event": [ { "listen": "test", "script": { - "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", + "id": "adb45711-3b6d-42d5-bc25-da78cc2e3553", "type": "text/javascript", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "", + "", + "pm.test('Should shows error \"should not be shorter than 1 characters\"' , function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.errors[0].message).to.eql(\"should NOT be shorter than 1 characters\");", "});" ] } @@ -32,7 +39,7 @@ { "listen": "prerequest", "script": { - "id": "38243afb-9cb8-444f-8795-e4dfe11a404f", + "id": "f28ea516-45c4-44b7-8d6f-b0660216135c", "type": "text/javascript", "exec": [ "" @@ -50,7 +57,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"ABCDEzxc\",\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" + "raw": "{\n \"reference_id\": \"\",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"string\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 0,\n \"request_params\": {\"key\":\"value\"}\n }\n ],\n \"request_message\": \"string\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" }, "url": { "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", @@ -68,31 +75,26 @@ "response": [] }, { - "name": "Case: Input reference id with empty", + "name": "Case: Input reference id with space", "event": [ { "listen": "test", "script": { - "id": "adb45711-3b6d-42d5-bc25-da78cc2e3553", + "id": "43101a2e-7557-4ab8-953c-2b6b6405aac8", "type": "text/javascript", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", "});", "", - "", - "", - "pm.test('Should shows error \"should not be shorter than 1 characters\"' , function () {", - " var jsonData = pm.response.json();", - " pm.expect(jsonData.errors[0].message).to.eql(\"should NOT be shorter than 1 characters\");", - "});" + "" ] } }, { "listen": "prerequest", "script": { - "id": "f28ea516-45c4-44b7-8d6f-b0660216135c", + "id": "0fbc562e-1dc7-416c-ba3f-425201e5d6b0", "type": "text/javascript", "exec": [ "" @@ -110,7 +112,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"\",\n \"callback_url\": \"string\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 0,\n \"request_params\": {\"key\":\"value\"}\n }\n ],\n \"request_message\": \"string\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + "raw": "{\n \"reference_id\": \" \",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" }, "url": { "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", @@ -128,18 +130,20 @@ "response": [] }, { - "name": "Case: Input reference id with space", + "name": "Case: Input reference id with special characters", "event": [ { "listen": "test", "script": { - "id": "43101a2e-7557-4ab8-953c-2b6b6405aac8", + "id": "31dad7ae-8ab3-4564-b055-7a15d6f8f3a6", "type": "text/javascript", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", "});", "", + "", + "", "" ] } @@ -147,7 +151,7 @@ { "listen": "prerequest", "script": { - "id": "0fbc562e-1dc7-416c-ba3f-425201e5d6b0", + "id": "59cdad85-5e7c-45f1-afb8-6cd0c305e22c", "type": "text/javascript", "exec": [ "" @@ -165,7 +169,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \" \",\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + "raw": "{\n \"reference_id\": \"AaB@#$%^<>\",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" }, "url": { "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", @@ -183,12 +187,12 @@ "response": [] }, { - "name": "Case: Input reference id with special characters", + "name": "Case: Input reference id without string", "event": [ { "listen": "test", "script": { - "id": "31dad7ae-8ab3-4564-b055-7a15d6f8f3a6", + "id": "c278b8b7-8069-4f8e-b86e-7e49c8cab551", "type": "text/javascript", "exec": [ "pm.test(\"Status code is 400\", function () {", @@ -196,7 +200,6 @@ "});", "", "", - "", "" ] } @@ -204,7 +207,7 @@ { "listen": "prerequest", "script": { - "id": "59cdad85-5e7c-45f1-afb8-6cd0c305e22c", + "id": "ccd21406-60f3-4ec9-a869-2cf948abf122", "type": "text/javascript", "exec": [ "" @@ -222,7 +225,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": \"AaB@#$%^<>\",\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + "raw": "{\n \"reference_id\": 12234,\n \"idp_list\": [\n \t\"idp1\",\"ab12\",\"QEsafd\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" }, "url": { "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", @@ -240,27 +243,24 @@ "response": [] }, { - "name": "Case: Input reference id without string", + "name": "Case: Send request to namespace and identity success", "event": [ { "listen": "test", "script": { - "id": "c278b8b7-8069-4f8e-b86e-7e49c8cab551", + "id": "a2f0ffba-ffe2-473a-8cc4-1124f47bf94a", "type": "text/javascript", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "", - "" + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" ] } }, { "listen": "prerequest", "script": { - "id": "ccd21406-60f3-4ec9-a869-2cf948abf122", + "id": "38243afb-9cb8-444f-8795-e4dfe11a404f", "type": "text/javascript", "exec": [ "" @@ -278,7 +278,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"reference_id\": 12234,\n \"idp_list\": [\n \t\"idp1\",\"ab12\",\"QEsafd\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}" + "raw": "{\n \"reference_id\": \"ABCDEzxc\",\n \"idp_list\": [\n \"idp1\"\n ],\n \"callback_url\": \"http://localhost\",\n \"as_service_list\": [\n {\n \"service_id\": \"string\",\n \"as_id\": [\n \"string\"\n ],\n \"count\": 1,\n \"request_params\": {\"id\":\"1234\"}\n }\n ],\n \"request_message\": \"OK\",\n \"min_ial\": 1.1,\n \"min_aal\": 1,\n \"min_idp\": 1,\n \"request_timeout\": 0\n}\n" }, "url": { "raw": "{{url_rp}}/rp/requests/{{namespace}}/{{identifier}}", @@ -306,6 +306,7 @@ "id": "82ddee3f-d81e-4fed-89c0-657074673e3f", "type": "text/javascript", "exec": [ + "setTimeout(function () {},1000);", "var url_idp = pm.variables.get(\"url_idp\");", "", "const createIdentity = {", @@ -315,13 +316,12 @@ " body:{", " mode: 'raw',", " raw: JSON.stringify({", - " \"namespace\": \"uuidTest1\",", + " \"namespace\": \"uuid889\",", " \"identifier\": \"12345\",", " \"secret\": \"abc\",", " \"accessor_type\": \"a\",", " \"accessor_key\": \"ab\",", " \"accessor_id\": \"cc\"", - " ", " })", " }", "};", @@ -330,8 +330,7 @@ " if (err) {", " console.log(err);", " } else {", - " console.log(response.json());", - " pm.environment.set(\"namespace\", \"uuidTest1\");", + " pm.environment.set(\"namespace\", \"uuid889\");", " pm.environment.set(\"identifier\", \"12345\");", " }", "});"