Changes for doc/testing/postman/README.md: 12 added lines, 6 removed lines.
Original line number
Diff line number
Diff line
# Postman
In this section we can use Postman to publish an API as a provider and use it as an invoker.
This section shows how OpenCAPIF is used through requests made with Postman, from the creation of a provider together with the publication of an api, to the creation of an invoker and the consumption of the published api. Everything you need to run the test is in <ahref="./Postman-Test.zip"download>Postman-Test.zip</a>.
## Requisites
@@ -14,7 +15,7 @@ In this section we can use Postman to publish an API as a provider and use it as
npm i
```
1. Run the <ahref="./script.js"download>script.js</a> with the following command:
2. Run the <ahref="./script.js"download>script.js</a> with the following command:
```
node script.js
@@ -22,6 +23,11 @@ node script.js
3. Import Postman collection and environment variables (<ahref="./CAPIF.postman_collection.json"download>CAPIF.postman_collection.json</a> and <ahref="./CAPIF.postman_environment.json"download>CAPIF.postman_environment.json</a>)
4. Select CAPIF Environment before start testing.
5. Install the necessary dependencies from requirements.txt using the following command:
```
pip install -r requirements.txt
```
## Remote CAPIF
@@ -67,6 +73,8 @@ The next step is to register a provider using the user created by the administra
At this point we move on to using certificate authentication in CAPIF. In Postman it is necessary to add the certificates manually and using more than one certificate for the same host as we do in CAPIF complicates things. For this reason, we use the script to overwrite a certificate and a key when it is necessary to have a specific one.
To configure go to **settings** in Postman and open the **certificates** section.
@@ -77,8 +85,6 @@ 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.
#### **05-publish_api**

Once the api is published, we can start it. In this case we have a test one created in python called <ahref="./hello_api.py"download>hello_api.py</a> that can be executed with the following command:
@@ -103,10 +109,10 @@ Finally, we will create an invoker with the user given by the administrator to b
At this point we move on to using certificate authentication in CAPIF. **If you did not configure the provider's certificates, you would have to do it now**.
#### **08-discover**
At this point we move on to using certificate authentication in CAPIF. **If you did not configure the provider's certificates, you would have to do it now**.