Commit f4640ce8 authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Merge branch 'staging' into 'main'

Staging to Main for Release 1

See merge request !43
parents 5e5dc289 68a62dc2
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -12,6 +12,7 @@ __pycache__/
*.crt
*.crt
*.zip
*.zip
*.srl
*.srl
*.log
services/nginx/certs/sign_req_body.json
services/nginx/certs/sign_req_body.json
services/easy_rsa/certs/pki
services/easy_rsa/certs/pki
services/easy_rsa/certs/*EasyRSA*
services/easy_rsa/certs/*EasyRSA*
@@ -29,9 +30,10 @@ monitoring/tempo/tempo-data/*




docs/testing_with_postman/*node_modules*
docs/testing_with_postman/*node_modules*
docs/testing_with_postman/Responses
docs/testing_with_postman/package-lock.json
docs/testing_with_postman/package-lock.json


results
results


helm/capif/*.lock
helm/capif/*.lock
helm/capif/charts
helm/capif/charts/tempo*
 No newline at end of file
+25 −67
Original line number Original line Diff line number Diff line
# Common API Framework (CAPIF)
# Common API Framework (CAPIF)


- [Common API Framework (CAPIF)](#common-api-framework-capif)
- [Common API Framework (CAPIF)](#common-api-framework-capif)
- [Repository structure](#repository-structure)
- [CAPIF\_API\_Services](#capif_api_services)
- [CAPIF\_API\_Services](#capif_api_services)
- [Documentation](#documentation)
  - [How to run CAPIF services in this Repository](#how-to-run-capif-services-in-this-repository)
  - [How to run CAPIF services in this Repository](#how-to-run-capif-services-in-this-repository)
    - [Run All CAPIF Services locally with Docker images](#run-all-capif-services-locally-with-docker-images)
    - [Run All CAPIF Services locally with Docker images](#run-all-capif-services-locally-with-docker-images)
    - [Run All CAPIF Services locally with Docker images and deploy monitoring stack](#run-all-capif-services-locally-with-docker-images-and-deploy-monitoring-stack)
    - [Run All CAPIF Services locally with Docker images and deploy monitoring stack](#run-all-capif-services-locally-with-docker-images-and-deploy-monitoring-stack)
    - [Run each service using Docker](#run-each-service-using-docker)
    - [Run each service using Docker](#run-each-service-using-docker)
    - [Run each service using Python](#run-each-service-using-python)
    - [Run each service using Python](#run-each-service-using-python)
- [How to test CAPIF APIs](#how-to-test-capif-apis)
  - [Test Plan Documentation](#test-plan-documentation)
  - [Robot Framework](#robot-framework)
  - [Using Curl](#using-curl)
  - [Using PostMan](#using-postman)
- [Important urls:](#important-urls)
- [Important urls:](#important-urls)
  - [Mongo CAPIF's DB Dashboard](#mongo-capifs-db-dashboard)
  - [Mongo CAPIF's DB Dashboard](#mongo-capifs-db-dashboard)
  - [Mongo Register's DB Dashboard](#mongo-registers-db-dashboard)
  - [Mongo Register's DB Dashboard](#mongo-registers-db-dashboard)
- [FAQ Documentation](#faq-documentation)
- [FAQ Documentation](#faq-documentation)
- [CAPIF Release 0](#capif-release-0)




# Repository structure

```
CAPIF_API_Services
└───docs
│    └───test_plan
│    └───testing_with_postman
└───services
└───tests
└───tools
    └───robot
    └───open_api_script
```
* **services**: Services developed following CAPIF API specifications. Also, other complementary services (e.g., NGINX and JWTauth services for the authentication of API consuming entities).
* **tools**: Auxiliary tools. Robot Framework related code and OpenAPI scripts.
* **test**: Tests developed using Robot Framework.

* **docs**: Documents related to the code in the repository.
  * images: images used in the repository
  * test_plan: test plan descriptions for each API service referring to the test that are executed with the Robot Framework.
  * testing_with_postman: auxiliary JSON file needed for the Postman-based examples.


# CAPIF_API_Services
# CAPIF_API_Services
This repository has the python-flask Mockup servers created with openapi-generator related with CAPIF APIS defined here:
This repository has the python-flask Mockup servers created with openapi-generator related with CAPIF APIS defined here:
[Open API Descriptions of 3GPP 5G APIs]
[Open API Descriptions of 3GPP 5G APIs]


# Documentation

Please refer to [OCF Documentation] for more detailed information.


# Install and Run 
### (to be added in Getting Started section of Documentation)
```
mkdir OpenCAPIF

cd OpenCAPIF

# The link must be changed when finally merged with the default branch and be permanent
wget https://labs.etsi.org/rep/ocf/capif/-/raw/OCF19-local-installation-of-capif-downloading-script/deploy.sh

chmod +x deploy.sh

# ./deploy.sh [branch to fetch] [true or false (default) to install monitoring stack or not]
./deploy.sh staging
```

## How to run CAPIF services in this Repository
## How to run CAPIF services in this Repository
Capif services are developed under /service/ folder.
Capif services are developed under /service/ folder.


@@ -147,29 +141,6 @@ pip3 install -r requirements.txt
python3 -m <service>
python3 -m <service>
```
```


# How to test CAPIF APIs
The above APIs can be tested either with "curl" command, POSTMAN tool or running developed tests with Robot Framework.
## Test Plan Documentation

Complete documentation of tests is here: [Test Plan Directory]
## Robot Framework

In order to ensure modifications over CAPIF services still accomplish the required functionality, Robot Framework test suite must be success.

Test suite implemented accomplish requirements described under test plan at [Test Plan Directory] folder.

Please go to [Testing with Robot Framework] Section

## Using Curl

Please go to [Testing Using Curl] section.

## Using PostMan
You can test the CAPIF flow using the Postman tool. To do this, we have created a collection with some examples of CAPIF requests with everything necessary to carry them out.

For more information on how to test the APIs with POSTMAN, follow this [Document](docs/testing_with_postman/README.md).
Also you have here the [POSTMAN Collection](docs/testing_with_postman/CAPIF.postman_collection.json)

# Important urls:
# Important urls:


## Mongo CAPIF's DB Dashboard
## Mongo CAPIF's DB Dashboard
@@ -194,24 +165,11 @@ http://<Mongo Register Express Host IP>:8083/ (if accessed from another host)


Frequently asked questions can be found here: [FAQ Directory]
Frequently asked questions can be found here: [FAQ Directory]


# CAPIF Release 0

The APIs included in release 0 are:
- JWT Authentication APIs
- CAPIF Invoker Management API
- CAPIF Publish API
- CAPIF Discover API
- CAPIF Security API
- CAPIF Events API
- CAPIF Provider Management API

Testing Suite of all services with robot.
Also Postman suite to a simple test.




[Open API Descriptions of 3GPP 5G APIs]: https://forge.3gpp.org/rep/all/5G_APIs  "Open API Descriptions of 3GPP 5G APIs"
[Open API Descriptions of 3GPP 5G APIs]: https://forge.3gpp.org/rep/all/5G_APIs  "Open API Descriptions of 3GPP 5G APIs"
[Test Plan Directory]: ./docs/test_plan/README.md  "Test Plan Directory"
[Test Plan Directory]: ./docs/test_plan/README.md  "Test Plan Directory"
[Testing Using Curl]: ./docs/testing_with_curl/README.md  "Testing Using Curl"
[Testing Using Curl]: ./docs/testing_with_curl/README.md  "Testing Using Curl"
[Testing with Robot Framework]: ./docs/testing_with_robot/README.md  "Testing with Robot Framework"
[Testing with Robot Framework]: ./docs/testing_with_robot/README.md  "Testing with Robot Framework"
[FAQ Directory]: ./FAQ.md "FAQ directory"
[FAQ Directory]: https://ocf.etsi.org/documentation/latest/FAQ/ "FAQ Url"
 No newline at end of file
[OCF Documentation]: https://ocf.etsi.org/documentation/latest/ "OCF Documentation"

deploy.sh

0 → 100644
+32 −0
Original line number Original line Diff line number Diff line
#!/bin/sh

dirlocation=`pwd`/.
# If no argument is provided, use "main" as the default value
default_branch="main"
default_mon="false"
branch="${1:-$default_branch}"
monitoring="${2:-default_mon}"

echo "Selected branch: $branch"
echo "We're working with $dirlocation"
cd $dirlocation


updaterepo(){
        cd $dirlocation
        echo "Build " $1
        if [ ! -d $1 ]; then
                git clone https://labs.etsi.org/rep/ocf/$1.git
        fi

        cd $1/
        git checkout $branch
        git pull
}

updaterepo capif

cd $dirlocation
cd capif/services

./run.sh -m $monitoring
 No newline at end of file
−69.9 KiB
Loading image diff...
−50.9 KiB
Loading image diff...
Loading