Loading opencapif_sdk/api_schema_translator.py +8 −3 Original line number Diff line number Diff line Loading @@ -34,11 +34,16 @@ class api_schema_translator: self.api_info = self.__load_api_file(self.api_path) self.__validate_api_info() def build(self, api_name, ip=None, port=None, fqdn=None, ipv6Addr=None): def build(self, api_name, supported_features, api_supp_features, ip=None, port=None, fqdn=None, ipv6Addr=None): """ Builds the API description and saves it to a JSON file. Supports either IPv4 (ip), IPv6 (ipv6Addr), or FQDN (fqdn). """ # Validate required fields if not supported_features or not api_supp_features: self.logger.error("Both 'supported_features' and 'api_supp_features' are required. Aborting build.") return # Validate that at least one of ip, ipv6Addr, or fqdn is provided if not (ip or ipv6Addr or fqdn): self.logger.error("At least one of 'ip', 'ipv6Addr', or 'fqdn' must be provided. Aborting build.") Loading @@ -55,13 +60,13 @@ class api_schema_translator: "apiName": self.api_info["info"].get("title", api_name), "aefProfiles": self.__build_aef_profiles(ip, port, fqdn, ipv6Addr), "description": self.api_info["info"].get("description", "No description provided"), "supportedFeatures": "fffff", "supportedFeatures": supported_features, "shareableInfo": { "isShareable": True, "capifProvDoms": ["string"] }, "serviceAPICategory": "string", "apiSuppFeats": "fffff", "apiSuppFeats": api_supp_features, "pubApiPath": { "ccfIds": ["string"] }, Loading opencapif_sdk/capif_provider_connector.py +1 −2 Original line number Diff line number Diff line Loading @@ -193,7 +193,6 @@ class capif_provider_connector: context = ssl.create_default_context() context.check_hostname = False context.verify_mode = ssl.CERT_NONE with socket.create_connection((self.capif_host, self.capif_https_port)) as sock: with context.wrap_socket(sock, server_hostname=self.capif_host) as ssock: cert = ssock.getpeercert(binary_form=True) Loading Loading @@ -1160,7 +1159,7 @@ class capif_provider_connector: self.logger.info("Starting certificate removal process...") # List of possible certificate patterns to remove cert_patterns = ["APF-", "apf-", "AEF-", "aef-", "AMF", "amf"] cert_patterns = ["APF-", "apf-", "AEF-", "aef-"] cert_extensions = ["_private_key.key", "_public.csr", ".crt"] # Iterate over the directory and remove matching files Loading setup.py +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ with open(os.path.join(this_directory, "README_pipy.md"), encoding="utf-8") as f setup( name="opencapif_sdk", version="0.1.19", version="0.1.20", author="JorgeEcheva, dgs-cgm", author_email="jorge.echevarriauribarri.practicas@telefonica.com, daniel.garciasanchez@telefonica.com", description=( Loading test/capif_sdk_config_sample_test.json +2 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ "invoker": { "invoker_folder": "/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder", "capif_callback_url": "http://localhost:5000", "supported_features": "fffffff", "supported_features": "0", "check_authentication_data": { "ip": "", "port": "" Loading Loading @@ -51,7 +51,7 @@ }, "provider": { "provider_folder": "/Users/IDB0128/Documents/OpenCapif/test_provider_certificate_folder", "supported_features": "fffffff", "supported_features": "0", "cert_generation": { "csr_common_name": "provider", "csr_organizational_unit": "discovery", Loading test/network_app_provider_api_spec.json +4 −4 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ "apiName": "Testtrece", "aefProfiles": [ { "aefId": "AEF6b074911c72c9a49c8a3ea7e881b85", "aefId": "AEF5ab315755935b121309e787620c354", "versions": [ { "apiVersion": "v1", Loading Loading @@ -77,7 +77,7 @@ ] }, { "aefId": "AEFfaa1b3b961a3a09c71b633fe8327c3", "aefId": "AEF32cfb4a7b1b8c705217a6bb37b43f2", "versions": [ { "apiVersion": "v1", Loading Loading @@ -169,7 +169,7 @@ } ], "description": "API of dummy Network-App to test", "supportedFeatures": "fffffff", "supportedFeatures": "0", "shareableInfo": { "isShareable": true, "capifProvDoms": [ Loading @@ -177,7 +177,7 @@ ] }, "serviceAPICategory": "string", "apiSuppFeats": "fffff", "apiSuppFeats": "0", "pubApiPath": { "ccfIds": [ "string" Loading Loading
opencapif_sdk/api_schema_translator.py +8 −3 Original line number Diff line number Diff line Loading @@ -34,11 +34,16 @@ class api_schema_translator: self.api_info = self.__load_api_file(self.api_path) self.__validate_api_info() def build(self, api_name, ip=None, port=None, fqdn=None, ipv6Addr=None): def build(self, api_name, supported_features, api_supp_features, ip=None, port=None, fqdn=None, ipv6Addr=None): """ Builds the API description and saves it to a JSON file. Supports either IPv4 (ip), IPv6 (ipv6Addr), or FQDN (fqdn). """ # Validate required fields if not supported_features or not api_supp_features: self.logger.error("Both 'supported_features' and 'api_supp_features' are required. Aborting build.") return # Validate that at least one of ip, ipv6Addr, or fqdn is provided if not (ip or ipv6Addr or fqdn): self.logger.error("At least one of 'ip', 'ipv6Addr', or 'fqdn' must be provided. Aborting build.") Loading @@ -55,13 +60,13 @@ class api_schema_translator: "apiName": self.api_info["info"].get("title", api_name), "aefProfiles": self.__build_aef_profiles(ip, port, fqdn, ipv6Addr), "description": self.api_info["info"].get("description", "No description provided"), "supportedFeatures": "fffff", "supportedFeatures": supported_features, "shareableInfo": { "isShareable": True, "capifProvDoms": ["string"] }, "serviceAPICategory": "string", "apiSuppFeats": "fffff", "apiSuppFeats": api_supp_features, "pubApiPath": { "ccfIds": ["string"] }, Loading
opencapif_sdk/capif_provider_connector.py +1 −2 Original line number Diff line number Diff line Loading @@ -193,7 +193,6 @@ class capif_provider_connector: context = ssl.create_default_context() context.check_hostname = False context.verify_mode = ssl.CERT_NONE with socket.create_connection((self.capif_host, self.capif_https_port)) as sock: with context.wrap_socket(sock, server_hostname=self.capif_host) as ssock: cert = ssock.getpeercert(binary_form=True) Loading Loading @@ -1160,7 +1159,7 @@ class capif_provider_connector: self.logger.info("Starting certificate removal process...") # List of possible certificate patterns to remove cert_patterns = ["APF-", "apf-", "AEF-", "aef-", "AMF", "amf"] cert_patterns = ["APF-", "apf-", "AEF-", "aef-"] cert_extensions = ["_private_key.key", "_public.csr", ".crt"] # Iterate over the directory and remove matching files Loading
setup.py +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ with open(os.path.join(this_directory, "README_pipy.md"), encoding="utf-8") as f setup( name="opencapif_sdk", version="0.1.19", version="0.1.20", author="JorgeEcheva, dgs-cgm", author_email="jorge.echevarriauribarri.practicas@telefonica.com, daniel.garciasanchez@telefonica.com", description=( Loading
test/capif_sdk_config_sample_test.json +2 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ "invoker": { "invoker_folder": "/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder", "capif_callback_url": "http://localhost:5000", "supported_features": "fffffff", "supported_features": "0", "check_authentication_data": { "ip": "", "port": "" Loading Loading @@ -51,7 +51,7 @@ }, "provider": { "provider_folder": "/Users/IDB0128/Documents/OpenCapif/test_provider_certificate_folder", "supported_features": "fffffff", "supported_features": "0", "cert_generation": { "csr_common_name": "provider", "csr_organizational_unit": "discovery", Loading
test/network_app_provider_api_spec.json +4 −4 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ "apiName": "Testtrece", "aefProfiles": [ { "aefId": "AEF6b074911c72c9a49c8a3ea7e881b85", "aefId": "AEF5ab315755935b121309e787620c354", "versions": [ { "apiVersion": "v1", Loading Loading @@ -77,7 +77,7 @@ ] }, { "aefId": "AEFfaa1b3b961a3a09c71b633fe8327c3", "aefId": "AEF32cfb4a7b1b8c705217a6bb37b43f2", "versions": [ { "apiVersion": "v1", Loading Loading @@ -169,7 +169,7 @@ } ], "description": "API of dummy Network-App to test", "supportedFeatures": "fffffff", "supportedFeatures": "0", "shareableInfo": { "isShareable": true, "capifProvDoms": [ Loading @@ -177,7 +177,7 @@ ] }, "serviceAPICategory": "string", "apiSuppFeats": "fffff", "apiSuppFeats": "0", "pubApiPath": { "ccfIds": [ "string" Loading