Skip to content
Snippets Groups Projects
Commit 229b6e7c authored by torrespel's avatar torrespel
Browse files

updated flows and postman collection

parent f70df828
No related branches found
No related tags found
1 merge request!3Update 3 files
Showing
with 217 additions and 190 deletions
doc/images/flows/01_Login_Admin.png

21.9 KiB

doc/images/flows/01_Register_of_AEF.png

69.9 KiB

doc/images/flows/01a_Register_(Only)_AEF.png

50.9 KiB

doc/images/flows/01b_Register_of_AEF_GetAuth.png

38 KiB

doc/images/flows/02_Register_of_User.png

46.8 KiB

doc/images/flows/03_Register_of_AEF_GetAuth.png

44.8 KiB

doc/images/flows/04_Invoker_Register.png

70 KiB

doc/images/flows/04a_Invoker_(Only)_Register.png

50.8 KiB

doc/images/flows/04b_Invoker_Register_GetAuth.png

38.1 KiB

doc/images/flows/06_Invoker_Register_GetAuth.png

49.5 KiB

{ {
"info": { "info": {
"_postman_id": "5cfdf0d7-3b3c-4961-9cb9-84c2bf85056c", "_postman_id": "b512e528-4b13-4be2-aed2-a61a8381360e",
"name": "CAPIF", "name": "CAPIF",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "31608242", "_exporter_id": "31608242",
"_collection_link": "https://red-comet-993867.postman.co/workspace/Team-Workspace~bfc7c442-a60c-4bb1-8730-fdabc2df89b9/collection/31608242-5cfdf0d7-3b3c-4961-9cb9-84c2bf85056c?action=share&source=collection_link&creator=31608242" "_collection_link": "https://red-comet-993867.postman.co/workspace/Team-Workspace~bfc7c442-a60c-4bb1-8730-fdabc2df89b9/collection/31608242-b512e528-4b13-4be2-aed2-a61a8381360e?action=share&source=collection_link&creator=31608242"
}, },
"item": [ "item": [
{ {
"name": "01-register_user_provider", "name": "01-login_admin",
"event": [ "event": [
{ {
"listen": "test", "listen": "test",
"script": { "script": {
"exec": [ "exec": [
"var res = JSON.parse(responseBody);", "var res = JSON.parse(responseBody);",
"pm.environment.set('ONBOARDING_URL', res.ccf_api_onboarding_url);", "",
"pm.environment.set('PUBLISH_URL', res.ccf_publish_url);", "pm.environment.set('REFRESH_TOKEN', res.refresh_token);",
"pm.environment.set('USER_ID', res.id);", "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" "type": "text/javascript",
"packages": {}
} }
} }
], ],
"request": { "request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{ADMIN_TOKEN}}",
"type": "string"
}
]
},
"method": "POST", "method": "POST",
"header": [], "header": [],
"body": { "body": {
"mode": "raw", "mode": "raw",
"raw": "{\n\"password\": \"{{PASSWORD}}\",\n\"username\": \"{{USERNAME}}\",\n\"description\": \"provider\",\n\"role\": \"provider\",\n\"cn\": \"provider\"\n}", "raw": "{\n \"username\": \"{{USER_NAME}}\",\n \"password\": \"{{USER_PASSWORD}}\",\n \"description\": \"PepeDescription\",\n \"email\": \"pepe@gmail.com\"\n}",
"options": { "options": {
"raw": { "raw": {
"language": "json" "language": "json"
...@@ -37,21 +96,21 @@ ...@@ -37,21 +96,21 @@
} }
}, },
"url": { "url": {
"raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/register", "raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/createUser",
"protocol": "https", "protocol": "https",
"host": [ "host": [
"{{REGISTER_HOSTNAME}}" "{{REGISTER_HOSTNAME}}"
], ],
"port": "{{REGISTER_PORT}}", "port": "{{REGISTER_PORT}}",
"path": [ "path": [
"register" "createUser"
] ]
} }
}, },
"response": [] "response": []
}, },
{ {
"name": "02-getauth_provider", "name": "03-getauth",
"event": [ "event": [
{ {
"listen": "test", "listen": "test",
...@@ -61,6 +120,11 @@ ...@@ -61,6 +120,11 @@
"", "",
"pm.environment.set('CA_ROOT', res.ca_root);", "pm.environment.set('CA_ROOT', res.ca_root);",
"pm.environment.set('ACCESS_TOKEN', res.access_token);", "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(() => {", "setTimeout(() => {",
" pm.sendRequest({", " pm.sendRequest({",
...@@ -77,22 +141,29 @@ ...@@ -77,22 +141,29 @@
" });", " });",
" }, 5000);" " }, 5000);"
], ],
"type": "text/javascript" "type": "text/javascript",
"packages": {}
} }
} }
], ],
"request": { "request": {
"method": "POST", "auth": {
"header": [], "type": "basic",
"body": { "basic": [
"mode": "raw", {
"raw": "{\n\"password\": \"{{PASSWORD}}\",\n\"username\": \"{{USERNAME}}\"\n}", "key": "password",
"options": { "value": "{{USER_PASSWORD}}",
"raw": { "type": "string"
"language": "json" },
{
"key": "username",
"value": "{{USER_NAME}}",
"type": "string"
} }
} ]
}, },
"method": "GET",
"header": [],
"url": { "url": {
"raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/getauth", "raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/getauth",
"protocol": "https", "protocol": "https",
...@@ -108,7 +179,7 @@ ...@@ -108,7 +179,7 @@
"response": [] "response": []
}, },
{ {
"name": "03-onboard_provider", "name": "04-onboard_provider",
"event": [ "event": [
{ {
"listen": "test", "listen": "test",
...@@ -220,7 +291,7 @@ ...@@ -220,7 +291,7 @@
"response": [] "response": []
}, },
{ {
"name": "04-publish_api", "name": "05-publish_api",
"event": [ "event": [
{ {
"listen": "prerequest", "listen": "prerequest",
...@@ -299,107 +370,7 @@ ...@@ -299,107 +370,7 @@
"response": [] "response": []
}, },
{ {
"name": "05-register_user_invoker", "name": "06-onboard_invoker",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var res = JSON.parse(responseBody);",
"pm.environment.set('ONBOARDING_URL_INVOKER', res.ccf_onboarding_url);",
"pm.environment.set('DISCOVER_URL', res.ccf_discover_url);",
"pm.environment.set('USER_INVOKER_ID', res.id);",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n\"password\": \"{{PASSWORD}}\",\n\"username\": \"{{USERNAME_INVOKER}}\",\n\"description\": \"invoker\",\n\"role\": \"invoker\",\n\"cn\": \"invoker\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/register",
"protocol": "https",
"host": [
"{{REGISTER_HOSTNAME}}"
],
"port": "{{REGISTER_PORT}}",
"path": [
"register"
]
}
},
"response": []
},
{
"name": "06-getauth_invoker",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var res = JSON.parse(responseBody);",
"",
"pm.environment.set('CA_ROOT', res.ca_root);",
"pm.environment.set('ACCESS_TOKEN_INVOKER', res.access_token);",
"",
"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"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n\"password\": \"{{PASSWORD}}\",\n\"username\": \"{{USERNAME_INVOKER}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/getauth",
"protocol": "https",
"host": [
"{{REGISTER_HOSTNAME}}"
],
"port": "{{REGISTER_PORT}}",
"path": [
"getauth"
]
}
},
"response": []
},
{
"name": "07-onboard_invoker",
"event": [ "event": [
{ {
"listen": "test", "listen": "test",
...@@ -415,7 +386,8 @@ ...@@ -415,7 +386,8 @@
"", "",
"" ""
], ],
"type": "text/javascript" "type": "text/javascript",
"packages": {}
} }
}, },
{ {
...@@ -446,7 +418,8 @@ ...@@ -446,7 +418,8 @@
"", "",
"pm.request.body.raw = res;" "pm.request.body.raw = res;"
], ],
"type": "text/javascript" "type": "text/javascript",
"packages": {}
} }
} }
], ],
...@@ -456,7 +429,7 @@ ...@@ -456,7 +429,7 @@
"bearer": [ "bearer": [
{ {
"key": "token", "key": "token",
"value": "{{ACCESS_TOKEN_INVOKER}}", "value": "{{ACCESS_TOKEN}}",
"type": "string" "type": "string"
} }
] ]
...@@ -493,7 +466,7 @@ ...@@ -493,7 +466,7 @@
"response": [] "response": []
}, },
{ {
"name": "08-discover", "name": "07-discover",
"event": [ "event": [
{ {
"listen": "prerequest", "listen": "prerequest",
...@@ -581,7 +554,7 @@ ...@@ -581,7 +554,7 @@
"response": [] "response": []
}, },
{ {
"name": "09-security_context", "name": "08-security_context",
"event": [ "event": [
{ {
"listen": "prerequest", "listen": "prerequest",
...@@ -660,7 +633,7 @@ ...@@ -660,7 +633,7 @@
"response": [] "response": []
}, },
{ {
"name": "10-get_token", "name": "09-get_token",
"event": [ "event": [
{ {
"listen": "prerequest", "listen": "prerequest",
...@@ -760,7 +733,7 @@ ...@@ -760,7 +733,7 @@
"response": [] "response": []
}, },
{ {
"name": "11-call_service", "name": "10-call_service",
"event": [ "event": [
{ {
"listen": "prerequest", "listen": "prerequest",
...@@ -806,7 +779,7 @@ ...@@ -806,7 +779,7 @@
], ],
"body": { "body": {
"mode": "raw", "mode": "raw",
"raw": "{\n\"name\": \"{{USERNAME_INVOKER}}\"\n}", "raw": "{\n\"name\": {{USERNAME_INVOKER}}\n}",
"options": { "options": {
"raw": { "raw": {
"language": "json" "language": "json"
...@@ -923,13 +896,23 @@ ...@@ -923,13 +896,23 @@
"response": [] "response": []
}, },
{ {
"name": "remove_user_invoker", "name": "remove_user",
"request": { "request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{ADMIN_TOKEN}}",
"type": "string"
}
]
},
"method": "DELETE", "method": "DELETE",
"header": [], "header": [],
"body": { "body": {
"mode": "raw", "mode": "raw",
"raw": "{\n\"password\": \"{{PASSWORD}}\",\n\"username\": \"{{USERNAME_INVOKER}}\"\n}", "raw": "",
"options": { "options": {
"raw": { "raw": {
"language": "json" "language": "json"
...@@ -937,42 +920,58 @@ ...@@ -937,42 +920,58 @@
} }
}, },
"url": { "url": {
"raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/remove", "raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/deleteUser/{{USER_UUID}}",
"protocol": "https", "protocol": "https",
"host": [ "host": [
"{{REGISTER_HOSTNAME}}" "{{REGISTER_HOSTNAME}}"
], ],
"port": "{{REGISTER_PORT}}", "port": "{{REGISTER_PORT}}",
"path": [ "path": [
"remove" "deleteUser",
"{{USER_UUID}}"
] ]
} }
}, },
"response": [] "response": []
}, },
{ {
"name": "remove_user_provider", "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": { "request": {
"method": "DELETE", "auth": {
"header": [], "type": "bearer",
"body": { "bearer": [
"mode": "raw", {
"raw": "{\n\"password\": \"{{PASSWORD}}\",\n\"username\": \"{{USERNAME}}\"\n}", "key": "token",
"options": { "value": "{{REFRESH_TOKEN}}",
"raw": { "type": "string"
"language": "json"
} }
} ]
}, },
"method": "GET",
"header": [],
"url": { "url": {
"raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/remove", "raw": "https://{{REGISTER_HOSTNAME}}:{{REGISTER_PORT}}/refresh",
"protocol": "https", "protocol": "https",
"host": [ "host": [
"{{REGISTER_HOSTNAME}}" "{{REGISTER_HOSTNAME}}"
], ],
"port": "{{REGISTER_PORT}}", "port": "{{REGISTER_PORT}}",
"path": [ "path": [
"remove" "refresh"
] ]
} }
}, },
......
{ {
"id": "f2daf431-63c4-4275-8755-4cc5de2e566d", "id": "6c75108a-36b0-43b2-98b7-297b0b827a54",
"name": "CAPIF", "name": "CAPIF",
"values": [ "values": [
{ {
...@@ -32,12 +32,6 @@ ...@@ -32,12 +32,6 @@
"type": "default", "type": "default",
"enabled": true "enabled": true
}, },
{
"key": "USERNAME_INVOKER",
"value": "InvokerONE",
"type": "default",
"enabled": true
},
{ {
"key": "PASSWORD", "key": "PASSWORD",
"value": "pass", "value": "pass",
...@@ -57,115 +51,145 @@ ...@@ -57,115 +51,145 @@
"enabled": true "enabled": true
}, },
{ {
"key": "ONBOARDING_URL", "key": "ADMIN_USER",
"value": "admin",
"type": "default",
"enabled": true
},
{
"key": "ADMIN_PASSWORD",
"value": "password123",
"type": "default",
"enabled": true
},
{
"key": "ADMIN_TOKEN",
"value": "", "value": "",
"type": "any", "type": "default",
"enabled": true "enabled": true
}, },
{ {
"key": "PUBLISH_URL", "key": "REFRESH_TOKEN",
"value": "", "value": "",
"type": "any", "type": "default",
"enabled": true
},
{
"key": "USER_NAME",
"value": "Bob",
"type": "default",
"enabled": true "enabled": true
}, },
{ {
"key": "USER_ID", "key": "USER_PASSWORD",
"value": "1234",
"type": "default",
"enabled": true
},
{
"key": "USER_UUID",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "CA_ROOT", "key": "ONBOARDING_URL",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "ACCESS_TOKEN", "key": "PUBLISH_URL",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "APF_KEY", "key": "ONBOARDING_URL_INVOKER",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "AMF_KEY", "key": "DISCOVER_URL",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "AEF_KEY", "key": "SECURITY_URL",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "CA_ROOT",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "PROVIDER_ID", "key": "ACCESS_TOKEN",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "AEF_ID", "key": "APF_KEY",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "AEF_CERT", "key": "AMF_KEY",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "APF_ID", "key": "AEF_KEY",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "APF_CERT", "key": "PROVIDER_ID",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "AMF_ID", "key": "AEF_ID",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "AMF_CERT", "key": "AEF_CERT",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "ONBOARDING_URL_INVOKER", "key": "APF_ID",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "DISCOVER_URL", "key": "APF_CERT",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "USER_INVOKER_ID", "key": "AMF_ID",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
}, },
{ {
"key": "ACCESS_TOKEN_INVOKER", "key": "AMF_CERT",
"value": "", "value": "",
"type": "any", "type": "any",
"enabled": true "enabled": true
...@@ -238,6 +262,6 @@ ...@@ -238,6 +262,6 @@
} }
], ],
"_postman_variable_scope": "environment", "_postman_variable_scope": "environment",
"_postman_exported_at": "2023-12-20T10:47:32.128Z", "_postman_exported_at": "2024-04-22T06:53:35.508Z",
"_postman_exported_using": "Postman/10.21.4" "_postman_exported_using": "Postman/10.24.19"
} }
\ No newline at end of file
...@@ -43,17 +43,25 @@ CAPIF_HOSTNAME capifcore ...@@ -43,17 +43,25 @@ CAPIF_HOSTNAME capifcore
## CAPIF Flows ## CAPIF Flows
Once the first steps have been taken, we can now use Postman requests. These requests are numbered in the order that must be followed to obtain everything necessary from CAPIF. Once the first steps have been taken, we can now use Postman requests. These requests are numbered in the order that must be followed to obtain everything necessary from CAPIF.
### Publication of an API ### Creation of an user
The first step would be for an administrator to create a user with which a provider and an invoker will be created.
#### **01-Login_admin**
![Flow](../../images/flows/01_Login_Admin.png)
#### **01-register_user_provider** #### **02-Register of User**
![Flow](../../images/flows/01a_Register_(Only)_AEF.png) ![Flow](../../images/flows/02_Register_of_User.png)
#### **02-getauth_provider** ### Publication of an API
#### **03-getauth_provider**
![Flow](../../images/flows/01b_Register_of_AEF_GetAuth.png) ![Flow](../../images/flows/03_Register_of_AEF_GetAuth.png)
#### **03-onboard_provider** #### **04-onboard_provider**
![Flow](../../images/flows/02_AEF_API_Provider_registration.png) ![Flow](../../images/flows/02_AEF_API_Provider_registration.png)
...@@ -67,7 +75,7 @@ To configure go to **settings** in Postman and open the **certificates** section ...@@ -67,7 +75,7 @@ To configure go to **settings** in Postman and open the **certificates** section
Once this is done, the node script will be in charge of changing the certificate that is necessary in each request. Once this is done, the node script will be in charge of changing the certificate that is necessary in each request.
#### **04-publish_api** #### **05-publish_api**
![Flow](../../images/flows/03_AEF_Publish.png) ![Flow](../../images/flows/03_AEF_Publish.png)
...@@ -83,13 +91,9 @@ With this the provider part would be finished. ...@@ -83,13 +91,9 @@ With this the provider part would be finished.
### Calling the API ### Calling the API
#### **05-register_user_invoker**
![Flow](../../images/flows/04a_Invoker_(Only)_Register.png)
#### **06-getauth_invoker** #### **06-getauth_invoker**
![Flow](../../images/flows/04b_Invoker_Register_GetAuth.png) ![Flow](../../images/flows/06_Invoker_Register_GetAuth.png)
#### **07-onboard_invoker** #### **07-onboard_invoker**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment