diff --git a/doc/sdk_configuration.md b/doc/sdk_configuration.md index a9a0b21e602537f1dfb6332466a413f56023e53e..f50ee8647d9da4239e4f303687916d140d114da9 100644 --- a/doc/sdk_configuration.md +++ b/doc/sdk_configuration.md @@ -36,7 +36,7 @@ When configuring the SDK as a **Network App Invoker**, the following fields must **Optional:** - `discover_filter`: useful to enable the discovery of specific APIs. Some fields under [`discover_filter`](#configuration-of-discover_filter) structure required to be configured when using discovery filters. Check devoted section below, -- `check_authentication`: useful to use `check_authentication()` function to validate features from a target provider, it will be required to fill up the `ip` and `port` parameters within the `check_authentication` variable. +- `check_authentication_data`: useful to use `check_authentication()` function to validate features from a target provider, it will be required to fill up the `ip` and `port` parameters within the `check_authentication_data` variable. ### Network App Provider @@ -91,7 +91,7 @@ This file can also be populated using [environment variables](../samples/envirom - [`discover_filter`](#configuration-of-discover_filter): Fields for configuring invoker service discovery. - [`publish_req`](#configuration-of-publish_req): Fields required for API publishing. - `api_description_path`: The path to the [ServiceAPIDescription](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml) JSON file. -- `check_authentication`: The `ip` and `port` of the target Provider's AEF to get their supported features from. +- `check_authentication_data`: The `ip` and `port` of the target Provider's AEF to get their supported features from. ## Configuration via `capif_sdk_register.json` diff --git a/doc/sdk_full_documentation.md b/doc/sdk_full_documentation.md index 6dc3c6d40be3e0dcb00c03574242bd6a0c0d8a89..7c201a71cc1b23dc5f75da10991d547664d26c50 100644 --- a/doc/sdk_full_documentation.md +++ b/doc/sdk_full_documentation.md @@ -214,7 +214,7 @@ The SDK allows the Network App Invoker to check the `supported_features` from th It is mandatory to have obtained the [JWT token](#obtain-jwt-tokens) previously. **Required SDK inputs**: -- check_authentication +- check_authentication_data  diff --git a/network_app_samples/network_app_invoker_sample/capif_sdk_config_sample.json b/network_app_samples/network_app_invoker_sample/capif_sdk_config_sample.json index aa58c930c6394d72b565511f7fd1471f0189ec2a..806d47d5e8cea0b41bced29b31d42d3b688f6dbd 100644 --- a/network_app_samples/network_app_invoker_sample/capif_sdk_config_sample.json +++ b/network_app_samples/network_app_invoker_sample/capif_sdk_config_sample.json @@ -5,12 +5,12 @@ "capif_register_port": "36211", "capif_username": "echeva_0", "capif_password": "echevapass", - "debug_mode": "False", + "debug_mode": "True", "invoker":{ "invoker_folder": "/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder", "capif_callback_url": "http://localhost:5000", "supported_features":"fffffff", - "check_authentication":{ + "check_authentication_data":{ "ip":"", "port":"" }, diff --git a/network_app_samples/network_app_invoker_sample/network_app_invoker.py b/network_app_samples/network_app_invoker_sample/network_app_invoker.py index e3c1e6238ceb05306e16896cd6c4cf2df0bbf908..70ea86b2d2339c0b666d3a0353f51b24dd7b0742 100644 --- a/network_app_samples/network_app_invoker_sample/network_app_invoker.py +++ b/network_app_samples/network_app_invoker_sample/network_app_invoker.py @@ -99,8 +99,7 @@ if __name__ == "__main__": lenght = len(details["registered_security_contexes"]) ip = details["registered_security_contexes"][lenght-1]["aef_profiles"][0]["ip"] port = details["registered_security_contexes"][lenght-1]["aef_profiles"][0]["port"] - discoverer.check_authentication["ip"] = ip - discoverer.check_authentication["port"] = port + discoverer.check_authentication_data.update({"ip": ip, "port": port}) discoverer.check_authentication() # Load API details from the JSON file diff --git a/network_app_samples/network_app_provider_sample/capif_sdk_config_sample.json b/network_app_samples/network_app_provider_sample/capif_sdk_config_sample.json index b93180a75dc79bdb3dd8edaf0fa9632f387baf9e..2782ab0baf6cb85aa4e020e4d84b4cd3cba4d9e4 100644 --- a/network_app_samples/network_app_provider_sample/capif_sdk_config_sample.json +++ b/network_app_samples/network_app_provider_sample/capif_sdk_config_sample.json @@ -9,7 +9,7 @@ "invoker":{ "invoker_folder": "", "capif_callback_url": "", - "check_authentication":{ + "check_authentication_data":{ "ip":"", "port":"" }, diff --git a/samples/config_sample.json b/samples/config_sample.json index a63424188e28673915b095439444e75048c588b8..7a1d6aee70a53b84aa37e1bffb859c2029367553 100644 --- a/samples/config_sample.json +++ b/samples/config_sample.json @@ -10,7 +10,7 @@ "invoker_folder": "", "capif_callback_url": "", "supported_features":"", - "check_authentication":{ + "check_authentication_data":{ "ip":"", "port":"" }, diff --git a/samples/enviroment_variables_sample.txt b/samples/enviroment_variables_sample.txt index 8e76ace94adc95c8c0e088d2fe55ce7eca22fdc1..e7c4a06c7f6265e6d4d24225f09a11035ad6d4f6 100644 --- a/samples/enviroment_variables_sample.txt +++ b/samples/enviroment_variables_sample.txt @@ -20,8 +20,8 @@ export INVOKER_CSR_STATE_OR_PROVINCE_NAME=your_state_or_province export INVOKER_CSR_COUNTRY_NAME=your_country_name export INVOKER_CSR_EMAIL_ADDRESS=your_email_address -export INVOKER_CHECK_AUTHENTICATION_IP = -export INVOKER_CHECK_AUTHENTICATION_PORT = +export INVOKER_CHECK_AUTHENTICATION_DATA_IP = +export INVOKER_CHECK_AUTHENTICATION_DATA_PORT = #DISCOVER FILTER export DISCOVER_FILTER_API_NAME="" export DISCOVER_FILTER_API_VERSION="" diff --git a/sdk/capif_invoker_connector.py b/sdk/capif_invoker_connector.py index e43a94784dbc028712ff49f047e0e5a0085b2071..20734aac833b518495f1786a8d8050446d03742b 100644 --- a/sdk/capif_invoker_connector.py +++ b/sdk/capif_invoker_connector.py @@ -83,10 +83,10 @@ class capif_invoker_connector: capif_callback_url = os.getenv('INVOKER_CAPIF_CALLBACK_URL', invoker_config.get('capif_callback_url', '')).strip() supported_features = os.getenv('INVOKER_FOLDER', invoker_config.get('supported_features', '')).strip() - check_authentication = invoker_config.get('check_authentication', {}) + check_authentication_data = invoker_config.get('check_authentication_data', {}) self.check_authentication = { - "ip": os.getenv('INVOKER_CHECK_AUTHENTICATION_IP', check_authentication.get('ip', '')).strip(), - "port": os.getenv('INVOKER_CHECK_AUTHENTICATION_PORT', check_authentication.get('port', '')).strip() + "ip": os.getenv('INVOKER_CHECK_AUTHENTICATION_DATA_IP', check_authentication_data.get('ip', '')).strip(), + "port": os.getenv('INVOKER_CHECK_AUTHENTICATION_DATA_PORT', check_authentication_data.get('port', '')).strip() } # Extract CSR configuration from the JSON diff --git a/sdk/service_discoverer.py b/sdk/service_discoverer.py index 0566dec2bb083d7d55977fce6813b65753436eb2..6e4fc8aba1d3ac0b79a37ad9768a6bc15b425ba6 100644 --- a/sdk/service_discoverer.py +++ b/sdk/service_discoverer.py @@ -76,10 +76,10 @@ class service_discoverer: os.getenv('invoker_folder', invoker_config.get('invoker_folder', '')).strip() ) supported_features = os.getenv('INVOKER_FOLDER', invoker_config.get('supported_features', '')).strip() - check_authentication = invoker_config.get('check_authentication', {}) - self.check_authentication = { - "ip": os.getenv('INVOKER_CHECK_AUTHENTICATION_IP', check_authentication.get('ip', '')).strip(), - "port": os.getenv('INVOKER_CHECK_AUTHENTICATION_PORT', check_authentication.get('port', '')).strip() + check_authentication_data = invoker_config.get('check_authentication_data', {}) + self.check_authentication_data = { + "ip": os.getenv('INVOKER_CHECK_AUTHENTICATION_DATA_IP', check_authentication_data.get('ip', '')).strip(), + "port": os.getenv('INVOKER_CHECK_AUTHENTICATION_DATA_PORT', check_authentication_data.get('port', '')).strip() } # Retrieve CAPIF invoker username capif_invoker_username = os.getenv('CAPIF_USERNAME', config.get('capif_username', '')).strip() @@ -509,11 +509,12 @@ class service_discoverer: raise def check_authentication(self): + print("hola") self.logger.info("Checking authentication") try: invoker_details = self.__load_provider_api_details() invoker_id = invoker_details["api_invoker_id"] - check_auth = self.check_authentication + check_auth = self.check_authentication_data url = "http://"+f"{check_auth['ip']}:{check_auth['port']}/" + "aef-security/v1/check-authentication" payload = {