{
	"info": {
		"_postman_id": "7b685345-a379-40f5-8740-ad92d38d1750",
		"name": "CAPIF",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "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    \"enterprise\": \"ETSI\",\n    \"country\": \"Spain\",\n    \"email\": \"example@gmail.com\",\n    \"purpose\": \"Use OpenCAPIF\",\n    \"phone_number\": \"+123456789\",\n    \"company_web\": \"www.etsi.com\",\n    \"description\": \"UserDescription\"\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.split('?')[0]);",
							"pm.environment.set('SECURITY_URL', res.ccf_security_url);",
							"pm.environment.set('ONBOARDING_URL_INVOKER', res.ccf_onboarding_url);",
							"",
							"setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/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",
						"packages": {}
					}
				},
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"",
							"var res = JSON.parse(pm.request.body.raw);",
							"",
							"res.apiProvFuncs.forEach(function(elemento) {",
							"",
							"    setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/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",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"strictSSL": false,
				"protocolVersion": "auto"
			},
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{ACCESS_TOKEN}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "",
						"value": "",
						"type": "text",
						"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://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/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",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"var res = JSON.parse(responseBody);",
							"if (pm.response.code == 201){",
							"    ",
							"    pm.environment.set('API_ID', res.apiId);",
							"",
							"}",
							"",
							"",
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"strictSSL": true,
				"protocolVersion": "auto"
			},
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [
					{
						"key": "",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "\n{\n    \"apiName\": \"hello_api_demo\",\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\": \"020\",\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    \"apiStatus\":{\n        \"aefIds\": [\n            \"{{AEF_ID}}\"\n        ]\n    }\n  }",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://{{CAPIF_HOSTNAME}}:{{CAPIF_PORT}}/published-apis/v1/{{APF_ID}}/service-apis",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"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://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/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": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"strictSSL": false
			},
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{ACCESS_TOKEN}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "",
						"value": "",
						"type": "text",
						"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}}:{{CAPIF_PORT}}/{{ONBOARDING_URL_INVOKER}}",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"path": [
						"{{ONBOARDING_URL_INVOKER}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "07-discover",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/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",
						"packages": {}
					}
				},
				{
					"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",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"disableBodyPruning": true,
				"strictSSL": true
			},
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "GET",
				"header": [
					{
						"key": "",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://{{CAPIF_HOSTNAME}}:{{CAPIF_PORT}}/{{DISCOVER_URL}}?api-invoker-id={{INVOKER_ID}}",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"path": [
						"{{DISCOVER_URL}}"
					],
					"query": [
						{
							"key": "api-invoker-id",
							"value": "{{INVOKER_ID}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "08-security_context",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/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",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"strictSSL": true
			},
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "PUT",
				"header": [
					{
						"key": "",
						"value": "",
						"type": "text",
						"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_PORT}}/capif-security/v1/trustedInvokers/{{INVOKER_ID}}",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"path": [
						"capif-security",
						"v1",
						"trustedInvokers",
						"{{INVOKER_ID}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "09-get_token",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/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",
						"packages": {}
					}
				},
				{
					"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",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"strictSSL": true,
				"disabledSystemHeaders": {}
			},
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [
					{
						"key": "",
						"value": "",
						"type": "text",
						"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_PORT}}/capif-security/v1/securities/{{INVOKER_ID}}/token",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"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": "",
						"type": "text",
						"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://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/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",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"strictSSL": true
			},
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "DELETE",
				"header": [],
				"url": {
					"raw": "https://{{CAPIF_HOSTNAME}}:{{CAPIF_PORT}}/{{ONBOARDING_URL}}/{{PROVIDER_ID}}",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"path": [
						"{{ONBOARDING_URL}}",
						"{{PROVIDER_ID}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "offboard_invoker",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/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",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"strictSSL": true
			},
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "DELETE",
				"header": [],
				"url": {
					"raw": "https://{{CAPIF_HOSTNAME}}:{{CAPIF_PORT}}/{{ONBOARDING_URL_INVOKER}}/{{INVOKER_ID}}",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"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('ADMIN_TOKEN', res.access_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": []
		},
		{
			"name": "provider_events",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/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",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"var res = JSON.parse(responseBody);",
							"if (pm.response.code == 201){",
							"    ",
							"    let locationHeader = pm.response.headers.get(\"location\");",
							"",
							"    if (locationHeader) {",
							"        let match = locationHeader.match(/\\/([^\\/]+)$/);",
							"        ",
							"        if (match) {",
							"            pm.environment.set(\"EVENTS_ID\", match[1]);",
							"        } else {",
							"            console.log(\"No ID found in the URL\");",
							"        }",
							"    } else {",
							"        console.log(\"The 'location' header is not present in the response\");",
							"    }",
							"",
							"}"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"events\": [\n        \"SERVICE_API_AVAILABLE\",\n        \"SERVICE_API_UNAVAILABLE\"\n    ],\n    \"notificationDestination\": \"http://host.docker.internal:2222/\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://{{CAPIF_HOSTNAME}}:{{CAPIF_PORT}}/capif-events/v1/{{AMF_ID}}/subscriptions",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"path": [
						"capif-events",
						"v1",
						"{{AMF_ID}}",
						"subscriptions"
					]
				}
			},
			"response": []
		},
		{
			"name": "provider_update_events",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/generate_csr',",
							"                    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",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"disabledSystemHeaders": {}
			},
			"request": {
				"method": "PUT",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"events\": [\n        \"SERVICE_API_AVAILABLE\",\n        \"SERVICE_API_UNAVAILABLE\"\n    ],\n    \"notificationDestination\": \"http://host.docker.internal:2222/\",\n    \"supportedFeatures\":\"f\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://{{CAPIF_HOSTNAME}}:{{CAPIF_PORT}}/capif-events/v1/{{AMF_ID}}/subscriptions/{{EVENTS_ID}}",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"path": [
						"capif-events",
						"v1",
						"{{AMF_ID}}",
						"subscriptions",
						"{{EVENTS_ID}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "create_log",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/write_cert',",
							"                    method: 'POST',",
							"                    header: 'Content-Type:application/json',",
							"                    encoding: 'binary',",
							"                    body: {",
							"                        mode: 'raw',",
							"                        raw: {cert: pm.environment.get('AEF_CERT'), key:pm.environment.get('AEF_KEY')}",
							"                    }",
							"                }, function (err, response) {",
							"                    console.log(response)",
							"                });",
							"            }, 5000);",
							"",
							"",
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"aefId\": \"{{AEF_ID}}\",\n    \"apiInvokerId\": \"{{INVOKER_ID}}\",\n    \"logs\":[\n        {\n            \"apiId\": \"{{API_ID}}\",\n            \"apiName\": \"{{API_NAME}}\",\n            \"apiVersion\": \"v1\",\n            \"resourceName\": \"hello-endpoint\",\n            \"uri\": \"/hello\",\n            \"protocol\": \"HTTP_1_1\",\n            \"operation\": \"POST\",\n            \"result\": \"200\",\n            \"invocationTime\": \"2023-03-30T10:30:21.408000+00:00\",\n            \"invocationLatency\": 0,\n            \"inputParameters\": \"string\",\n            \"outputParameters\": \"string\",\n            \"srcInterface\": {\n                \"ipv4Addr\": \"localhost\",\n                \"port\": 8088,\n                \"securityMethods\": [\n                    \"OAUTH\"\n                ]\n            },\n            \"destInterface\": {\n                \"ipv4Addr\": \"localhost\",\n                \"port\": 8089,\n                \"securityMethods\": [\n                    \"OAUTH\"\n                ]\n            },\n            \"fwdInterface\": \"string\"\n        }\n    ]\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://{{CAPIF_HOSTNAME}}:{{CAPIF_PORT}}/api-invocation-logs/v1/{{AEF_ID}}/logs",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"path": [
						"api-invocation-logs",
						"v1",
						"{{AEF_ID}}",
						"logs"
					]
				}
			},
			"response": []
		},
		{
			"name": "get_log",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/write_cert',",
							"                    method: 'POST',",
							"                    header: 'Content-Type:application/json',",
							"                    encoding: 'binary',",
							"                    body: {",
							"                        mode: 'raw',",
							"                        raw: {cert: pm.environment.get('AEF_CERT'), key:pm.environment.get('AEF_KEY')}",
							"                    }",
							"                }, function (err, response) {",
							"                    console.log(response)",
							"                });",
							"            }, 5000);",
							"",
							"",
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://{{CAPIF_HOSTNAME}}:{{CAPIF_PORT}}/logs/v1/apiInvocationLogs?aef-id={{AEF_ID}}&api-invoker-id={{INVOKER_ID}}",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"path": [
						"logs",
						"v1",
						"apiInvocationLogs"
					],
					"query": [
						{
							"key": "aef-id",
							"value": "{{AEF_ID}}"
						},
						{
							"key": "api-invoker-id",
							"value": "{{INVOKER_ID}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "get_acl",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"setTimeout(() => {",
							"                pm.sendRequest({",
							"                    url: 'http://'+ pm.environment.get(\"NODE_HOSTNAME\") + ':'+ pm.environment.get(\"NODE_PORT\")+'/write_cert',",
							"                    method: 'POST',",
							"                    header: 'Content-Type:application/json',",
							"                    encoding: 'binary',",
							"                    body: {",
							"                        mode: 'raw',",
							"                        raw: {cert: pm.environment.get('AEF_CERT'), key:pm.environment.get('AEF_KEY')}",
							"                    }",
							"                }, function (err, response) {",
							"                    console.log(response)",
							"                });",
							"            }, 5000);",
							"",
							"",
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://{{CAPIF_HOSTNAME}}:{{CAPIF_PORT}}/access-control-policy/v1/accessControlPolicyList/{{API_SERVICE_ID}}?aef-id={{AEF_ID}}&api-invoker-id={{INVOKER_ID}}",
					"protocol": "https",
					"host": [
						"{{CAPIF_HOSTNAME}}"
					],
					"port": "{{CAPIF_PORT}}",
					"path": [
						"access-control-policy",
						"v1",
						"accessControlPolicyList",
						"{{API_SERVICE_ID}}"
					],
					"query": [
						{
							"key": "aef-id",
							"value": "{{AEF_ID}}"
						},
						{
							"key": "api-invoker-id",
							"value": "{{INVOKER_ID}}"
						}
					]
				}
			},
			"response": []
		}
	]
}