diff --git a/README.md b/README.md index 52a035fbe788af508bbcaae1d1072cce17bda7b0..e94585b08b51e2c47db226cb8164a9317aa310c2 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,14 @@ Current version of OpenCAPIF SDK is compatible with following publicly available 3. [OpenCAPIF SDK Installation](#OpenCAPIF-SDK-Installation) 4. [How to use OpenCAPIF SDK](#How-to-use-OpenCAPIF-SDK) 5. [OpenCAPIF SDK known issues](#OpenCAPIF-SDK-known-issues) + 6. [DEV ENVIRONMENT] (/doc/sdk-dev-env.md) # OpenCAPIF SDK usage OpenCAPIF SDK implements this set of features to easily integrate an application with CAPIF NF either manually or integrating SDK library directly within app code. +[GENERAL CAPIF USAGE FLOW] + This repository includes 2 different modes to test OpenCAPIF SDK: - **Manual usage**: use a set of python scripts to test step by step all implemented procedures. All of them are provided at scripts folder, [IMAGE OF ARCH APP ----> CAPIF WITH SCRIPTS] @@ -30,7 +33,27 @@ This repository includes 2 different modes to test OpenCAPIF SDK: - **Development usage**: import SDK in your code and start ... Within nf-sample folder, it is provided a sample application leveraging [IMAGE OF ARCH APP ----> CAPIF WITH SDK INTEGRATION] -# OpenCAPIF SDK Features +# OpenCAPIF SDK Features +LO QUE HE IMPLEMENTADO DE OPENCAPIF == RELEASE NOTES + + +# OpenCAPIF SDK scripts + +This repository provides manual scripts to validate and demonstrate the integration to OpenCAPIF. Next are listed the behaviour of all of them available at /sctipts folder: +1. +2. +3. +4. + +Additional requests to CAPIF: +- Publisher: addionally a devoloper could retrieve data from ... + 1. + 2. + +- Events: blah blah + +- Explore API directory: + - **Invoker CAPIF connector**: Simplifies the process of onboarding for Invoker users, - **Provider CAPIF connector**: Simplifies the process of onboarding for Provider users,also has the capability to register several APF's and AEF's if its necesary, @@ -44,6 +67,8 @@ This repository includes 2 different modes to test OpenCAPIF SDK: - **Invoker CAPIF connector offboarding**: Simplifies the process of offboarding for Invoker users, - **Provider CAPIF connector offboarding**: Simplifies the process of offboarding for Provider users. +[OPENCAPIF SDK CODE STRUCTURE] +  @@ -56,68 +81,50 @@ Apart from the SDK core, there are available different functionalities for devel  +# How to use OpenCAPIF SDK -# OpenCAPIF SDK Installation (dev environment??) - -Follow next steps to perform OpenCAPIF SDK installation: - -1 - Create an enviroment with pyenv - -```console -#Commands to install the Python environment -pyenv install 3.12 -pyenv virtualenv 3.12 pesp_sdk_env -#Activate your enviroment -source your/path/to/.pyenv/versions/pesp_sdk_env/bin/activate -``` +1 - First it is required to complete the utilities file with the absolute paths of target environment in order to complete the configuration of the SDK: +- NOTE register file is not needed for the use of the SDK, +- NOTE provider_exposer_get_sample_api_description_path is mandatory if publish functionalities are required. -OPTIONAL step: sometimes Apple Mac shells raise issues while finding the shell path. If this happens, try this command: +2 - Then it is needed to fill out config files depending on the features required to be used from the SDK. -```console -export PATH="$HOME/.pyenv/bin:$PATH" -eval "$(pyenv init --path)" -eval "$(pyenv init -)" -eval "$(pyenv virtualenv-init -)" -``` - -2 - Clone GitHub repository: +## OpenCAPIF SDK prerequisites -```console -git clone -b sdk_v0.1 --single-branch https://github.com/Telefonica/pesp_capif_sdk.git -``` +IMPORTANT: In order to leverage OpenCAPIF SDK it is required to have registered a user in the target CAPIF instance, so contact administrator to have required predefined credentials (username and password). -```console -#Then move to the pesp_capif_sdk folder +## OpenCAPIF SDK configuration -cd /your/path/to/pesp_capif_sdk -``` +### 1. Configuration via Config.json -3 - Install the Python requirements listed in requirements.txt file: +This configuration could also be fullfilled by enviroment variables (EXAMPLE) -```console -cd installation +Mandatory fields no matter the target role to be onboarded, either invoker or provider: -python -m pip install --upgrade pip +- capif_host +- register_host +- capif_https_port +- capif_register_port +- capif_username +- capif_password +- debug_mode -pip install -r requirements.txt -``` +If you want to use SDK as an **Invoker** you need to fill out these fields -**Congratulations!** You have finalized the installation of OpenCAPIF SDK. +- invoker_folder +- capif_callback_url +- csr_information(csr_common_name,csr_country_name...) +If you want to use SDK as a **Provider** you need to fill out these fields -# How to use OpenCAPIF SDK +- provider_folder +- APFs +- AEFs -1 - First it is required to complete the utilities file with the absolute paths of target environment in order to complete the configuration of the SDK: -- NOTE register file is not needed for the use of the SDK, -- NOTE provider_exposer_get_sample_api_description_path is mandatory if publish functionalities are required. -2 - Then it is needed to fill out config files depending on the features required to be used from the SDK. -## Prerequisites -IMPORTANT: In order to leverage OpenCAPIF SDK it is required to have registered a user in the target CAPIF instance, so contact administrator to have required predefined credentials (username and password). -## Configuration via Config.json "invoker_folder": String | The path (relative or absolute) of the folder you want to store your invoker information @@ -157,33 +164,7 @@ IMPORTANT: In order to leverage OpenCAPIF SDK it is required to have registered "debug_mode": Boolean | If you want to recieve logs from SDK-S6G Example:True/False -This configuration could also be fullfilled by enviroment variables - -Mandatory fields no matter the target role to be onboarded, either invoker or provider: - -- Capif_host -- register_host -- capif_https_port -- capif_register_port -- capif_username -- capif_password -- debug_mode - -If you want to use SDK as an Invoker you need to fill out these fields - -- invoker_folder -- capif_callback_url -- csr_information(csr_common_name,csr_country_name...) - -If you want to use SDK as a Provider you need to fill out these fields - -- provider_folder -- APFs -- AEFs - - - -## Configuration of Publish.json +### 2. Configuration of Publish.json "serviceApiId": String | The Api id we want to use Example "02eff6e1b3a8f7c8044a92ee8a30bd" "publisherAPFid": String | APF id we chose to use Example : "APFa165364a379035d14311deadc04332" @@ -214,7 +195,7 @@ You won't need to fill out the aefIds fields from aefProfiles array because you If the publisherAEFsids parameter don't match with the aefProfiles you will recieve an error -### Important information for Provider users +### Important information for Provider consumer In the provider_folder, you will find several folders with each capif_username you have onboarded as a provider, for each folder you could find: @@ -223,14 +204,14 @@ In the provider_folder, you will find several folders with each capif_username y - Service_received.json : If you already used the get an api or get all apis functionality, you will find the response to your request. - Published-Apis.json : Constains the currently published APIs with their ApiId -## Discover_filter.json +#### Configuration of Discover_filter.json This file follows the parameters schema from the GET petition of [Discover Services API](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Discover_Service_API.yaml) To use this feature you must complete the file with the parameters you want to be filtered and then run the Invoker Service Discovery Functionality. To run the Invoker Service Discovery Functionality you must have onboarded as an Invoker before. -### Important information for Invoker users +### Important information for Invoker consumer In the `invoker_folder`, you will find several folders with each `capif_username` you have onboarded as a provider. For each folder, you could find: @@ -246,7 +227,7 @@ By default, the Service Get Token will get the access token for using all the AP 2. Use the Service Discovery Functionality. 3. Use the Service Get Token Functionality. -## Register.json +#### Configuration of Register.json "register_host": String | The domain name of your register host diff --git a/config/config.json b/config/config.json index 8c342fdd4e8016579fc1d564f2043e6d9a9fc1d2..8914bc8d2231e6725857505eaea2753c8e74a2a1 100644 --- a/config/config.json +++ b/config/config.json @@ -1,41 +1,21 @@ -{ - -"invoker_folder": "/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder", - -"provider_folder": "/Users/IDB0128/Documents/OpenCapif/test_provider_certificate_folder", - -"capif_host": "capif-prev.mobilesandbox.cloud", - -"register_host": "registercapif-prev.mobilesandbox.cloud", - -"capif_https_port": "36212", - -"capif_register_port": "36211", - -"capif_callback_url": "http://localhost:5000", - -"csr_common_name": "test03", - -"csr_organizational_unit": "test_app_ou", - -"csr_organization": "test_app_o", - -"crs_locality": "Madrid", - -"csr_state_or_province_name": "Madrid", - -"csr_country_name": "ES", - -"csr_email_address": "test@example.com", - -"capif_username": "echeva_0", - -"capif_password": "echevapass", - -"APFs":"1", - -"AEFs":"1", - -"debug_mode": "True" -} - +{ + "invoker_folder": "/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder", + "provider_folder": "/Users/IDB0128/Documents/OpenCapif/test_provider_certificate_folder", + "capif_host": "capif-prev.mobilesandbox.cloud", + "register_host": "registercapif-prev.mobilesandbox.cloud", + "capif_https_port": "36212", + "capif_register_port": "36211", + "capif_callback_url": "http://localhost:5000", + "csr_common_name": "test03", + "csr_organizational_unit": "test_app_ou", + "csr_organization": "test_app_o", + "crs_locality": "Madrid", + "csr_state_or_province_name": "Madrid", + "csr_country_name": "ES", + "csr_email_address": "test@example.com", + "capif_username": "echeva_0", + "capif_password": "echevapass", + "APFs": "1", + "AEFs": "1", + "debug_mode": "True" +} \ No newline at end of file diff --git a/doc/sdk-dev-env.md b/doc/sdk-dev-env.md new file mode 100644 index 0000000000000000000000000000000000000000..f286e75f4dcfabed9412d22206a197e7b03daefb --- /dev/null +++ b/doc/sdk-dev-env.md @@ -0,0 +1,47 @@ + +# OpenCAPIF SDK development environment installation + +Follow next steps to perform OpenCAPIF SDK installation: + +1 - Create an enviroment with pyenv + +```console +#Commands to install the Python environment +pyenv install 3.12 +pyenv virtualenv 3.12 pesp_sdk_env +#Activate your enviroment +source your/path/to/.pyenv/versions/pesp_sdk_env/bin/activate +``` + +OPTIONAL step: sometimes Apple Mac shells raise issues while finding the shell path. If this happens, try this command: + +```console +export PATH="$HOME/.pyenv/bin:$PATH" +eval "$(pyenv init --path)" +eval "$(pyenv init -)" +eval "$(pyenv virtualenv-init -)" +``` + +2 - Clone GitHub repository: + +```console +git clone -b sdk_v0.1 --single-branch https://github.com/Telefonica/pesp_capif_sdk.git +``` + +```console +#Then move to the pesp_capif_sdk folder + +cd /your/path/to/pesp_capif_sdk +``` + +3 - Install the Python requirements listed in requirements.txt file: + +```console +cd installation + +python -m pip install --upgrade pip + +pip install -r requirements.txt +``` + +**Congratulations!** You have finalized the installation of OpenCAPIF SDK. \ No newline at end of file