{ "info": { "_postman_id": "03e5f144-6a4f-4899-a917-14787d59fbef", "name": "CAPIF", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "31608242", "_collection_link": "https://red-comet-993867.postman.co/workspace/Team-Workspace~bfc7c442-a60c-4bb1-8730-fdabc2df89b9/collection/31608242-03e5f144-6a4f-4899-a917-14787d59fbef?action=share&source=collection_link&creator=31608242" }, "item": [ { "name": "01-login_admin", "event": [ { "listen": "test", "script": { "exec": [ "var res = JSON.parse(responseBody);", "", "pm.environment.set('REFRESH_TOKEN', res.refresh_token);", "pm.environment.set('ADMIN_TOKEN', res.access_token);" ], "type": "text/javascript", "packages": {} } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{ADMIN_PASSWORD}}", "type": "string" }, { "key": "username", "value": "{{ADMIN_USER}}", "type": "string" } ] }, "method": "POST", "header": [], "url": { "raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/login", "protocol": "https", "host": [ "{{REGISTER_HOSTNAME}}" ], "port": "{{REGISTER_PORT}}", "path": [ "login" ] } }, "response": [] }, { "name": "02-create_user", "event": [ { "listen": "test", "script": { "exec": [ "var res = JSON.parse(responseBody);", "", "pm.environment.set('USER_UUID', res.uuid);", "" ], "type": "text/javascript", "packages": {} } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{ADMIN_TOKEN}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"username\": \"{{USER_NAME}}\",\n \"password\": \"{{USER_PASSWORD}}\",\n \"description\": \"PepeDescription\",\n \"email\": \"pepe@gmail.com\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/createUser", "protocol": "https", "host": [ "{{REGISTER_HOSTNAME}}" ], "port": "{{REGISTER_PORT}}", "path": [ "createUser" ] } }, "response": [] }, { "name": "03-getauth", "event": [ { "listen": "test", "script": { "exec": [ "var res = JSON.parse(responseBody);", "", "pm.environment.set('CA_ROOT', res.ca_root);", "pm.environment.set('ACCESS_TOKEN', res.access_token);", "pm.environment.set('ONBOARDING_URL', res.ccf_api_onboarding_url);", "pm.environment.set('PUBLISH_URL', res.ccf_publish_url);", "pm.environment.set('DISCOVER_URL', res.ccf_discover_url);", "pm.environment.set('SECURITY_URL', res.ccf_security_url);", "pm.environment.set('ONBOARDING_URL_INVOKER', res.ccf_onboarding_url);", "", "setTimeout(() => {", " pm.sendRequest({", " url: 'http://localhost:3000/write_ca',", " method: 'POST',", " header: 'Content-Type:application/json',", " encoding: 'binary',", " body: {", " mode: 'raw',", " raw: res", " }", " }, function (err, res) {", " console.log(res);", " });", " }, 5000);" ], "type": "text/javascript", "packages": {} } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{USER_PASSWORD}}", "type": "string" }, { "key": "username", "value": "{{USER_NAME}}", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/getauth", "protocol": "https", "host": [ "{{REGISTER_HOSTNAME}}" ], "port": "{{REGISTER_PORT}}", "path": [ "getauth" ] } }, "response": [] }, { "name": "04-onboard_provider", "event": [ { "listen": "test", "script": { "exec": [ "var res = JSON.parse(responseBody);", "if (pm.response.code == 201){", " ", " pm.environment.set('PROVIDER_ID', res.apiProvDomId);", "", " const roleVariableMapping = {", " \"AEF\": { id: 'AEF_ID', cert: 'AEF_CERT' },", " \"APF\": { id: 'APF_ID', cert: 'APF_CERT' },", " \"AMF\": { id: 'AMF_ID', cert: 'AMF_CERT' }", " };", "", " res.apiProvFuncs.forEach(function(elemento) {", " const role = elemento.apiProvFuncRole;", " if (roleVariableMapping.hasOwnProperty(role)) {", " const variables = roleVariableMapping[role];", " pm.environment.set(variables.id, elemento.apiProvFuncId);", " pm.environment.set(variables.cert, elemento.regInfo.apiProvCert);", "", " }", " });", "", "}", "", "", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "", "var res = JSON.parse(pm.request.body.raw);", "", "res.apiProvFuncs.forEach(function(elemento) {", "", " setTimeout(() => {", " pm.sendRequest({", " url: 'http://localhost:3000/generate_csr',", " method: 'POST',", " header: 'Content-Type:application/json',", " encoding: 'binary',", " body: {", " mode: 'raw',", " raw: elemento", " }", " }, function (err, response) {", " j_file = JSON.parse(response.text());", " elemento.regInfo.apiProvPubKey = j_file.csr;", " pm.environment.set(elemento.apiProvFuncRole+'_KEY', j_file.key);", " });", " }, 5000);", "", "});", "", "pm.request.body.raw = res;" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{ACCESS_TOKEN}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "", "value": "", "disabled": true } ], "body": { "mode": "raw", "raw": "{\n\"apiProvFuncs\": [\n {\n \"regInfo\": {\n \"apiProvPubKey\": \"\"\n },\n \"apiProvFuncRole\": \"AEF\",\n \"apiProvFuncInfo\": \"dummy_aef\"\n },\n {\n \"regInfo\": {\n \"apiProvPubKey\": \"\"\n },\n \"apiProvFuncRole\": \"APF\",\n \"apiProvFuncInfo\": \"dummy_apf\"\n },\n {\n \"regInfo\": {\n \"apiProvPubKey\": \"\"\n },\n \"apiProvFuncRole\": \"AMF\",\n \"apiProvFuncInfo\": \"dummy_amf\"\n }\n],\n\"apiProvDomInfo\": \"This is provider\",\n\"suppFeat\": \"fff\",\n\"failReason\": \"string\",\n\"regSec\": \"{{ACCESS_TOKEN}}\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://{{CAPIF_HOSTNAME}}/{{ONBOARDING_URL}}", "protocol": "https", "host": [ "{{CAPIF_HOSTNAME}}" ], "path": [ "{{ONBOARDING_URL}}" ] } }, "response": [] }, { "name": "05-publish_api", "event": [ { "listen": "prerequest", "script": { "exec": [ "setTimeout(() => {", " pm.sendRequest({", " url: 'http://localhost:3000/write_cert',", " method: 'POST',", " header: 'Content-Type:application/json',", " encoding: 'binary',", " body: {", " mode: 'raw',", " raw: {cert: pm.environment.get('APF_CERT'), key:pm.environment.get('APF_KEY')}", " }", " }, function (err, response) {", " console.log(response)", " });", " }, 5000);", "", "", "" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "strictSSL": true }, "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [ { "key": "", "value": "", "disabled": true } ], "body": { "mode": "raw", "raw": "\n{\n \"apiName\": \"hello_api_demo_v2\",\n \"aefProfiles\": [\n {\n \"aefId\": \"{{AEF_ID}}\",\n \"versions\": [\n {\n \"apiVersion\": \"v1\",\n \"expiry\": \"2021-11-30T10:32:02.004Z\",\n \"resources\": [\n {\n \"resourceName\": \"hello-endpoint\",\n \"commType\": \"REQUEST_RESPONSE\",\n \"uri\": \"/hello\",\n \"custOpName\": \"string\",\n \"operations\": [\n \"POST\"\n ],\n \"description\": \"Endpoint to receive a welcome message\"\n }\n ],\n \"custOperations\": [\n {\n \"commType\": \"REQUEST_RESPONSE\",\n \"custOpName\": \"string\",\n \"operations\": [\n \"POST\"\n ],\n \"description\": \"string\"\n }\n ]\n }\n ],\n \"protocol\": \"HTTP_1_1\",\n \"dataFormat\": \"JSON\",\n \"securityMethods\": [\"Oauth\"],\n \"interfaceDescriptions\": [\n {\n \"ipv4Addr\": \"localhost\",\n \"port\": 8088,\n \"securityMethods\": [\"Oauth\"]\n }\n ]\n }\n ],\n \"description\": \"Hello api services\",\n \"supportedFeatures\": \"fffff\",\n \"shareableInfo\": {\n \"isShareable\": true,\n \"capifProvDoms\": [\n \"string\"\n ]\n },\n \"serviceAPICategory\": \"string\",\n \"apiSuppFeats\": \"fffff\",\n \"pubApiPath\": {\n \"ccfIds\": [\n \"string\"\n ]\n },\n \"ccfId\": \"string\"\n }", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://{{CAPIF_HOSTNAME}}/published-apis/v1/{{APF_ID}}/service-apis", "protocol": "https", "host": [ "{{CAPIF_HOSTNAME}}" ], "path": [ "published-apis", "v1", "{{APF_ID}}", "service-apis" ] } }, "response": [] }, { "name": "06-onboard_invoker", "event": [ { "listen": "test", "script": { "exec": [ "var res = JSON.parse(responseBody);", "if (pm.response.code == 201){", " ", " pm.environment.set('INVOKER_ID', res.apiInvokerId);", " pm.environment.set('INVOKER_CERT', res.onboardingInformation.apiInvokerCertificate);", "}", "", "", "" ], "type": "text/javascript", "packages": {} } }, { "listen": "prerequest", "script": { "exec": [ "", "var res = JSON.parse(pm.request.body.raw);", "", "", "setTimeout(() => {", " pm.sendRequest({", " url: 'http://localhost:3000/generate_csr_invoker',", " method: 'POST',", " header: 'Content-Type:application/json',", " encoding: 'binary',", " body: {", " mode: 'raw',", " raw: {}", " }", " }, function (err, response) {", " j_file = JSON.parse(response.text());", " res.onboardingInformation.apiInvokerPublicKey = j_file.csr;", " pm.environment.set('INVOKER_KEY', j_file.key);", " });", " }, 5000);", "", "", "pm.request.body.raw = res;" ], "type": "text/javascript", "packages": {} } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{ACCESS_TOKEN}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "", "value": "", "disabled": true } ], "body": { "mode": "raw", "raw": "{\n \"notificationDestination\" : \"http://host.docker.internal:8086/netapp_callback\",\n \"supportedFeatures\" : \"fffffff\",\n \"apiInvokerInformation\" : \"dummy\",\n \"websockNotifConfig\" : {\n \"requestWebsocketUri\" : true,\n \"websocketUri\" : \"websocketUri\"\n },\n \"onboardingInformation\" : {\n \"apiInvokerPublicKey\" : \"\"\n },\n \"requestTestNotification\" : true\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://{{CAPIF_HOSTNAME}}/{{ONBOARDING_URL_INVOKER}}", "protocol": "https", "host": [ "{{CAPIF_HOSTNAME}}" ], "path": [ "{{ONBOARDING_URL_INVOKER}}" ] } }, "response": [] }, { "name": "07-discover", "event": [ { "listen": "prerequest", "script": { "exec": [ "setTimeout(() => {", " pm.sendRequest({", " url: 'http://localhost:3000/write_cert',", " method: 'POST',", " header: 'Content-Type:application/json',", " encoding: 'binary',", " body: {", " mode: 'raw',", " raw: {cert: pm.environment.get('INVOKER_CERT'), key:pm.environment.get('INVOKER_KEY')}", " }", " }, function (err, response) {", " console.log(response)", " });", " }, 5000);", "", "", "" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "var res = JSON.parse(responseBody);", "if (pm.response.code == 200){", "", " res.serviceAPIDescriptions.forEach(function(api) {", " pm.environment.set('API_SERVICE_ID', api.apiId);", " pm.environment.set('API_NAME', api.apiName);", " pm.environment.set('API_AEF_ID', api.aefProfiles[0].aefId);", " pm.environment.set('IPV4ADDR', api.aefProfiles[0].interfaceDescriptions[0].ipv4Addr);", " pm.environment.set('PORT', api.aefProfiles[0].interfaceDescriptions[0].port);", " pm.environment.set('URI', api.aefProfiles[0].versions[0].resources[0].uri);", " });", "}" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "disableBodyPruning": true, "strictSSL": true }, "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [ { "key": "", "value": "", "disabled": true } ], "body": { "mode": "raw", "raw": "", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://{{CAPIF_HOSTNAME}}/{{DISCOVER_URL}}{{INVOKER_ID}}", "protocol": "https", "host": [ "{{CAPIF_HOSTNAME}}" ], "path": [ "{{DISCOVER_URL}}{{INVOKER_ID}}" ] } }, "response": [] }, { "name": "08-security_context", "event": [ { "listen": "prerequest", "script": { "exec": [ "setTimeout(() => {", " pm.sendRequest({", " url: 'http://localhost:3000/write_cert',", " method: 'POST',", " header: 'Content-Type:application/json',", " encoding: 'binary',", " body: {", " mode: 'raw',", " raw: {cert: pm.environment.get('INVOKER_CERT'), key:pm.environment.get('INVOKER_KEY')}", " }", " }, function (err, response) {", " console.log(response)", " });", " }, 5000);", "", "", "" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "strictSSL": true }, "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [ { "key": "", "value": "", "disabled": true } ], "body": { "mode": "raw", "raw": "{\n \"securityInfo\": [\n {\n \"prefSecurityMethods\": [\n \"Oauth\"\n ],\n \"authenticationInfo\": \"string\",\n \"authorizationInfo\": \"string\",\n \"aefId\": \"{{API_AEF_ID}}\",\n \"apiId\": \"{{API_SERVICE_ID}}\"\n }\n ],\n \"notificationDestination\": \"https://mynotificationdest.com\",\n \"requestTestNotification\": true,\n \"websockNotifConfig\": {\n \"websocketUri\": \"string\",\n \"requestWebsocketUri\": true\n },\n \"supportedFeatures\": \"fff\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://{{CAPIF_HOSTNAME}}/capif-security/v1/trustedInvokers/{{INVOKER_ID}}", "protocol": "https", "host": [ "{{CAPIF_HOSTNAME}}" ], "path": [ "capif-security", "v1", "trustedInvokers", "{{INVOKER_ID}}" ] } }, "response": [] }, { "name": "09-get_token", "event": [ { "listen": "prerequest", "script": { "exec": [ "setTimeout(() => {", " pm.sendRequest({", " url: 'http://localhost:3000/write_cert',", " method: 'POST',", " header: 'Content-Type:application/json',", " encoding: 'binary',", " body: {", " mode: 'raw',", " raw: {cert: pm.environment.get('INVOKER_CERT'), key:pm.environment.get('INVOKER_KEY')}", " }", " }, function (err, response) {", " console.log(response)", " });", " }, 5000);", "", "", "" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "var res = JSON.parse(responseBody);", "if (pm.response.code == 200){", " pm.environment.set('NETAPP_SERVICE_TOKEN', res.access_token);", "}" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "strictSSL": true, "disabledSystemHeaders": {} }, "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [ { "key": "", "value": "", "disabled": true } ], "body": { "mode": "urlencoded", "urlencoded": [ { "key": "client_id", "value": "{{INVOKER_ID}}", "type": "text" }, { "key": "grant_type", "value": "client_credentials", "type": "text" }, { "key": "client_secret", "value": "string", "type": "text" }, { "key": "scope", "value": "3gpp#{{API_AEF_ID}}:{{API_NAME}}", "type": "text" } ] }, "url": { "raw": "https://{{CAPIF_HOSTNAME}}/capif-security/v1/securities/{{INVOKER_ID}}/token", "protocol": "https", "host": [ "{{CAPIF_HOSTNAME}}" ], "path": [ "capif-security", "v1", "securities", "{{INVOKER_ID}}", "token" ] } }, "response": [] }, { "name": "10-call_service", "event": [ { "listen": "prerequest", "script": { "exec": [ "" ], "type": "text/javascript", "packages": {} } }, { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript", "packages": {} } } ], "protocolProfileBehavior": { "strictSSL": false }, "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{NETAPP_SERVICE_TOKEN}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "", "value": "", "disabled": true } ], "body": { "mode": "raw", "raw": "{\n\"name\": \"{{USER_NAME}}\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://{{IPV4ADDR}}:{{PORT}}{{URI}}", "protocol": "http", "host": [ "{{IPV4ADDR}}" ], "port": "{{PORT}}{{URI}}" } }, "response": [] }, { "name": "offboard_provider", "event": [ { "listen": "prerequest", "script": { "exec": [ "setTimeout(() => {", " pm.sendRequest({", " url: 'http://localhost:3000/write_cert',", " method: 'POST',", " header: 'Content-Type:application/json',", " encoding: 'binary',", " body: {", " mode: 'raw',", " raw: {cert: pm.environment.get('AMF_CERT'), key:pm.environment.get('AMF_KEY')}", " }", " }, function (err, response) {", " console.log(response)", " });", " }, 5000);" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "strictSSL": true }, "request": { "auth": { "type": "noauth" }, "method": "DELETE", "header": [], "url": { "raw": "https://{{CAPIF_HOSTNAME}}/{{ONBOARDING_URL}}/{{PROVIDER_ID}}", "protocol": "https", "host": [ "{{CAPIF_HOSTNAME}}" ], "path": [ "{{ONBOARDING_URL}}", "{{PROVIDER_ID}}" ] } }, "response": [] }, { "name": "offboard_invoker", "event": [ { "listen": "prerequest", "script": { "exec": [ "setTimeout(() => {", " pm.sendRequest({", " url: 'http://localhost:3000/write_cert',", " method: 'POST',", " header: 'Content-Type:application/json',", " encoding: 'binary',", " body: {", " mode: 'raw',", " raw: {cert: pm.environment.get('INVOKER_CERT'), key:pm.environment.get('INVOKER_KEY')}", " }", " }, function (err, response) {", " console.log(response)", " });", " }, 5000);" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "strictSSL": true }, "request": { "auth": { "type": "noauth" }, "method": "DELETE", "header": [], "url": { "raw": "https://{{CAPIF_HOSTNAME}}/{{ONBOARDING_URL_INVOKER}}/{{INVOKER_ID}}", "protocol": "https", "host": [ "{{CAPIF_HOSTNAME}}" ], "path": [ "{{ONBOARDING_URL_INVOKER}}", "{{INVOKER_ID}}" ] } }, "response": [] }, { "name": "remove_user", "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{ADMIN_TOKEN}}", "type": "string" } ] }, "method": "DELETE", "header": [], "body": { "mode": "raw", "raw": "", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/deleteUser/{{USER_UUID}}", "protocol": "https", "host": [ "{{REGISTER_HOSTNAME}}" ], "port": "{{REGISTER_PORT}}", "path": [ "deleteUser", "{{USER_UUID}}" ] } }, "response": [] }, { "name": "refresh_admin_token", "event": [ { "listen": "test", "script": { "exec": [ "var res = JSON.parse(responseBody);", "", "pm.environment.set('REFRESH_TOKEN', res.refresh_token);" ], "type": "text/javascript", "packages": {} } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{REFRESH_TOKEN}}", "type": "string" } ] }, "method": "POST", "header": [], "url": { "raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/refresh", "protocol": "https", "host": [ "{{REGISTER_HOSTNAME}}" ], "port": "{{REGISTER_PORT}}", "path": [ "refresh" ] } }, "response": [] } ] }