From 72be80f110a605298b5e9b27de40e3d58793fee8 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Tue, 17 Dec 2024 14:39:30 +0100 Subject: [PATCH 001/157] eventFilters --- .../capif_events/core/notifications.py | 55 ++++++++++++++++--- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index c6dae59b..8eb03d1b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -39,18 +39,59 @@ class Notifications(): if EventSubscription.return_supp_feat_dict(sub["supported_features"])["EnhancedEventReport"]: event_detail={} current_app.logger.debug(f"event: {event_detail_redis}") + + # The nth entry in the "eventFilters" attribute shall correspond to the nth entry in the "events" attribute + event_filters = sub.get("event_filters", None) + event_filter=None + current_app.logger.debug(f"Event filters: {event_filters}") + if event_filters: + try: + event_filter = event_filters[event_filters.index(event)] + except IndexError: + event_filter=None + if event in ["SERVICE_API_AVAILABLE", "SERVICE_API_UNAVAILABLE"]: - event_detail["apiIds"]=event_detail_redis.get('apiIds', None) - if EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]: - event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) + if event_filter: + api_ids_list = event_filter.get("api_ids", None) + if api_ids_list and event_detail_redis.get('apiIds', None)[0] in api_ids_list: + event_detail["apiIds"]=event_detail_redis.get('apiIds', None) + if EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]: + event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) + else: + event_detail["apiIds"]=event_detail_redis.get('apiIds', None) + if EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]: + event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) elif event in ["SERVICE_API_UPDATE"]: - event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) + if event_filter: + api_ids_list = event_filter.get("api_ids", None) + if api_ids_list and event_detail_redis.get('apiIds', None)[0] in api_ids_list: + event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) elif event in ["API_INVOKER_ONBOARDED", "API_INVOKER_OFFBOARDED", "API_INVOKER_UPDATED"]: - event_detail["apiInvokerIds"]=event_detail_redis.get('apiInvokerIds', None) + if event_filter: + invoker_ids_list = event_filter.get("api_invoker_ids", None) + if invoker_ids_list and event_detail_redis.get('apiInvokerIds', None)[0] in invoker_ids_list: + event_detail["apiInvokerIds"]=event_detail_redis.get('apiInvokerIds', None) + else: + event_detail["apiInvokerIds"]=event_detail_redis.get('apiInvokerIds', None) elif event in ["ACCESS_CONTROL_POLICY_UPDATE"]: - event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) + if event_filter: + invoker_ids_list = event_filter.get("api_invoker_ids", None) + api_ids_list = event_filter.get("api_ids", None) + if invoker_ids_list and (event_detail_redis.get('apiInvokerIds', None)[0] in invoker_ids_list or event_detail_redis.get('apiIds', None)[0] in api_ids_list): + event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) + else: + event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) elif event in ["SERVICE_API_INVOCATION_SUCCESS", "SERVICE_API_INVOCATION_FAILURE"]: - event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) + if event_filter: + invoker_ids_list = event_filter.get("api_invoker_ids", None) + api_ids_list = event_filter.get("api_ids", None) + aef_ids_list = event_filter.get("aef_ids", None) + if invoker_ids_list and (event_detail_redis.get('apiInvokerIds', None)[0] in invoker_ids_list or + event_detail_redis.get('apiIds', None)[0] in api_ids_list or + event_detail_redis.get('aefIds', None)[0] in aef_ids_list ): + event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) + else: + event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) elif event in ["API_TOPOLOGY_HIDING_CREATED", "API_TOPOLOGY_HIDING_REVOKED"]: event_detail["apiTopoHide"]=event_detail_redis.get('apiTopoHide', None) -- GitLab From dfb217a5b8c31fccf3068367d3c7f9af111274db Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Wed, 18 Dec 2024 12:22:26 +0100 Subject: [PATCH 002/157] event filter --- .../TS29222_CAPIF_Events_API/capif_events/core/notifications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index 8eb03d1b..49fca372 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -46,7 +46,7 @@ class Notifications(): current_app.logger.debug(f"Event filters: {event_filters}") if event_filters: try: - event_filter = event_filters[event_filters.index(event)] + event_filter = event_filters[sub.get("events", []).index(event)] except IndexError: event_filter=None -- GitLab From b0ef57fd972ea36b5daa14c732e902c4c326c719 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Wed, 18 Dec 2024 13:40:10 +0100 Subject: [PATCH 003/157] Fix some logic in eventFilter --- .../capif_events/core/notifications.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index 49fca372..9bae9189 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -51,6 +51,7 @@ class Notifications(): event_filter=None if event in ["SERVICE_API_AVAILABLE", "SERVICE_API_UNAVAILABLE"]: + current_app.logger.debug(event_filter) if event_filter: api_ids_list = event_filter.get("api_ids", None) if api_ids_list and event_detail_redis.get('apiIds', None)[0] in api_ids_list: @@ -64,7 +65,7 @@ class Notifications(): elif event in ["SERVICE_API_UPDATE"]: if event_filter: api_ids_list = event_filter.get("api_ids", None) - if api_ids_list and event_detail_redis.get('apiIds', None)[0] in api_ids_list: + if api_ids_list and event_detail_redis.get('serviceAPIDescriptions', {})[0].get('apiId') in api_ids_list: event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) elif event in ["API_INVOKER_ONBOARDED", "API_INVOKER_OFFBOARDED", "API_INVOKER_UPDATED"]: if event_filter: @@ -77,7 +78,7 @@ class Notifications(): if event_filter: invoker_ids_list = event_filter.get("api_invoker_ids", None) api_ids_list = event_filter.get("api_ids", None) - if invoker_ids_list and (event_detail_redis.get('apiInvokerIds', None)[0] in invoker_ids_list or event_detail_redis.get('apiIds', None)[0] in api_ids_list): + if invoker_ids_list and (event_detail_redis.get('apiInvokerIds', None)[0] in invoker_ids_list or event_detail_redis.get('api_ids', None)[0] in api_ids_list): event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) else: event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) -- GitLab From 980c1091d49c34ddb27ec0cccd5352f237c3c159 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 19 Dec 2024 11:59:35 +0100 Subject: [PATCH 004/157] eventFilter SERVICE_API_UPDATE --- .../capif_events/core/notifications.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index 9bae9189..1e37d68d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -58,6 +58,8 @@ class Notifications(): event_detail["apiIds"]=event_detail_redis.get('apiIds', None) if EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]: event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) + else: + continue else: event_detail["apiIds"]=event_detail_redis.get('apiIds', None) if EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]: @@ -67,11 +69,17 @@ class Notifications(): api_ids_list = event_filter.get("api_ids", None) if api_ids_list and event_detail_redis.get('serviceAPIDescriptions', {})[0].get('apiId') in api_ids_list: event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) + else: + continue + else: + event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) elif event in ["API_INVOKER_ONBOARDED", "API_INVOKER_OFFBOARDED", "API_INVOKER_UPDATED"]: if event_filter: invoker_ids_list = event_filter.get("api_invoker_ids", None) if invoker_ids_list and event_detail_redis.get('apiInvokerIds', None)[0] in invoker_ids_list: event_detail["apiInvokerIds"]=event_detail_redis.get('apiInvokerIds', None) + else: + continue else: event_detail["apiInvokerIds"]=event_detail_redis.get('apiInvokerIds', None) elif event in ["ACCESS_CONTROL_POLICY_UPDATE"]: @@ -80,6 +88,8 @@ class Notifications(): api_ids_list = event_filter.get("api_ids", None) if invoker_ids_list and (event_detail_redis.get('apiInvokerIds', None)[0] in invoker_ids_list or event_detail_redis.get('api_ids', None)[0] in api_ids_list): event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) + else: + continue else: event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) elif event in ["SERVICE_API_INVOCATION_SUCCESS", "SERVICE_API_INVOCATION_FAILURE"]: @@ -91,6 +101,8 @@ class Notifications(): event_detail_redis.get('apiIds', None)[0] in api_ids_list or event_detail_redis.get('aefIds', None)[0] in aef_ids_list ): event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) + else: + continue else: event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) elif event in ["API_TOPOLOGY_HIDING_CREATED", "API_TOPOLOGY_HIDING_REVOKED"]: -- GitLab From 30169a2be10f3dfd5df397e4a44563e11b06dfeb Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 19 Dec 2024 13:40:40 +0100 Subject: [PATCH 005/157] fix eventFilter SERVICE_API_AVAILABLE --- .../core/serviceapidescriptions.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py index 1f3b5252..e7ffb906 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py @@ -254,7 +254,8 @@ class PublishServiceOperations(Resource): "pub_api_path": 1, "ccf_id": 1, "apf_id":1, - "onboarding_date": 1}) + "onboarding_date": 1, + "api_status": 1}) if serviceapidescription_old is None: current_app.logger.error(service_api_not_found_message) return not_found_error(detail="Service API not existing", cause="Service API id not found") @@ -268,6 +269,7 @@ class PublishServiceOperations(Resource): service_api_description["onboarding_date"] = serviceapidescription_old["onboarding_date"] service_api_description["api_id"] = serviceapidescription_old["api_id"] + result = mycol.find_one_and_replace( serviceapidescription_old, service_api_description, @@ -286,7 +288,6 @@ class PublishServiceOperations(Resource): return_document=ReturnDocument.AFTER, upsert=False) result = clean_empty(result) - current_app.logger.debug("Updated service api") service_api_description_updated = dict_to_camel_case(result) @@ -298,7 +299,13 @@ class PublishServiceOperations(Resource): RedisEvent("SERVICE_API_UPDATE", service_api_descriptions=[service_api_description_updated]).send_event() - my_service_api = clean_n_camel_case(serviceapidescription_old) + my_service_api = clean_empty(serviceapidescription_old) + + if (api_status := serviceapidescription_old.get("api_status")): + my_service_api["api_status"] = api_status + + my_service_api = dict_to_camel_case(my_service_api) + self.send_events_on_update( service_api_id, my_service_api, @@ -368,7 +375,6 @@ class PublishServiceOperations(Resource): service_api_description_updated = dict_to_camel_case(result) - current_app.logger.debug(service_api_description_updated) response = make_response( object=service_api_description_updated, status=200) @@ -376,7 +382,13 @@ class PublishServiceOperations(Resource): RedisEvent("SERVICE_API_UPDATE", service_api_descriptions=[service_api_description_updated]).send_event() - my_service_api = clean_n_camel_case(serviceapidescription_old) + my_service_api = clean_empty(serviceapidescription_old) + + if (api_status := serviceapidescription_old.get("api_status")): + my_service_api["api_status"] = api_status + + my_service_api = dict_to_camel_case(my_service_api) + self.send_events_on_update( service_api_id, my_service_api, @@ -398,7 +410,7 @@ class PublishServiceOperations(Resource): service_api_status_event_old = self.service_api_availability_event( service_api_description_old) service_api_status_event_new = self.service_api_availability_event( - service_api_description_old) + service_api_description_new) if service_api_status_event_old == service_api_status_event_new: current_app.logger.info( -- GitLab From 40b6c3388fe04172395ad03410714b95ea69213c Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Fri, 10 Jan 2025 17:13:54 +0100 Subject: [PATCH 006/157] Check eventFilters --- .../capif_events/core/events_apis.py | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index 3555281a..9bb723da 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -38,6 +38,30 @@ class EventSubscriptionsOperations(Resource): return not_found_error(detail="Invoker or APF or AEF or AMF Not found", cause="Subscriber Not Found") return None + + def __check_event_filters(self, events, filters): + current_app.logger.debug("Checking event filters.") + valid_filters = { + "SERVICE_API_UPDATE": ["api_ids"], + "SERVICE_API_AVAILABLE" : ["api_ids"], + "SERVICE_API_UNAVAILABLE" : ["api_ids"], + "API_INVOKER_ONBOARDED": ["api_invoker_ids"], + "API_INVOKER_OFFBOARDED": ["api_invoker_ids"], + "API_INVOKER_UPDATED": ["api_invoker_ids"], + "ACCESS_CONTROL_POLICY_UPDATE":["api_invoker_ids", "api_ids"], + "SERVICE_API_INVOCATION_SUCCESS": ["api_invoker_ids", "api_ids", "aef_ids"], + "SERVICE_API_INVOCATION_FAILURE": ["api_invoker_ids", "api_ids", "aef_ids"], + "API_TOPOLOGY_HIDING_CREATED": [], + "API_TOPOLOGY_HIDING_REVOKED": [] + } + + for event, filter in zip(events, filters): + invalid_filters = set(filter.keys()) - set(valid_filters.get(event, [])) + + if invalid_filters: + current_app.logger.debug(f"The eventFilter {invalid_filters} for event {event} are not applicable.") + return bad_request_error(detail="Bad Param", cause = f"Invalid eventFilter for event {event}", invalid_params=[{"param": "eventFilter", "reason": f"The eventFilter {invalid_filters} for event {event} are not applicable."}]) + return None def __init__(self): Resource.__init__(self) @@ -65,10 +89,15 @@ class EventSubscriptionsOperations(Resource): result = self.__check_subscriber_id(subscriber_id) - if isinstance(result, Response): return result + + if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"] and event_subscription.event_filters: + current_app.logger.debug(event_subscription.event_filters) + result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) + if isinstance(result, Response): + return result # Generate subscriptionID subscription_id = secrets.token_hex(15) @@ -143,6 +172,11 @@ class EventSubscriptionsOperations(Resource): if isinstance(result, Response): return result + + if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"] and event_subscription.event_filters: + result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) + if isinstance(result, Response): + return result my_query = {'subscriber_id': subscriber_id, 'subscription_id': subscription_id} @@ -189,6 +223,19 @@ class EventSubscriptionsOperations(Resource): current_app.logger.error("Event subscription not found") return not_found_error(detail="Event subscription not exist", cause="Event API subscription id not found") + if EventSubscription.return_supp_feat_dict(eventdescription.get("supported_features"))["EnhancedEventReport"]: + current_app.logger.debug(event_subscription) + if event_subscription.events and event_subscription.event_filters: + result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) + elif event_subscription.events and event_subscription.event_filters is None and eventdescription.get("event_filters", None): + result = self.__check_event_filters(event_subscription.events, eventdescription.get("event_filters")) + elif event_subscription.events is None and event_subscription.event_filters: + current_app.logger.debug(clean_empty(event_subscription.to_dict()["event_filters"])) + result = self.__check_event_filters(eventdescription.get("events"), clean_empty(event_subscription.to_dict()["event_filters"])) + + if isinstance(result, Response): + return result + body = clean_empty(event_subscription.to_dict()) document = mycol.update_one(my_query, {"$set":body}) document = mycol.find_one(my_query) -- GitLab From 364ad5c888ba43d9e835c85bf8e3a6e329fb6639 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Fri, 10 Jan 2025 21:08:45 +0100 Subject: [PATCH 007/157] Fix logs --- .../TS29222_CAPIF_Events_API/capif_events/core/events_apis.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index 9bb723da..bf3be52f 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -224,13 +224,11 @@ class EventSubscriptionsOperations(Resource): return not_found_error(detail="Event subscription not exist", cause="Event API subscription id not found") if EventSubscription.return_supp_feat_dict(eventdescription.get("supported_features"))["EnhancedEventReport"]: - current_app.logger.debug(event_subscription) if event_subscription.events and event_subscription.event_filters: result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) elif event_subscription.events and event_subscription.event_filters is None and eventdescription.get("event_filters", None): result = self.__check_event_filters(event_subscription.events, eventdescription.get("event_filters")) elif event_subscription.events is None and event_subscription.event_filters: - current_app.logger.debug(clean_empty(event_subscription.to_dict()["event_filters"])) result = self.__check_event_filters(eventdescription.get("events"), clean_empty(event_subscription.to_dict()["event_filters"])) if isinstance(result, Response): -- GitLab From 1e4eecdbf19de19527eca370280c96eebcfe5e2b Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Fri, 31 Jan 2025 12:46:41 +0100 Subject: [PATCH 008/157] Removing information present on ocf documentation webpage --- README.md | 134 ++---------------------------------------------------- 1 file changed, 3 insertions(+), 131 deletions(-) diff --git a/README.md b/README.md index 74a32c28..7bb59f6b 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,6 @@ - [CAPIF\_API\_Services](#capif_api_services) - [Documentation](#documentation) - [Install and Run](#install-and-run) - - [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 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 Python](#run-each-service-using-python) -- [Important urls:](#important-urls) - - [Mongo CAPIF's DB Dashboard](#mongo-capifs-db-dashboard) - - [Mongo Register's DB Dashboard](#mongo-registers-db-dashboard) - [FAQ Documentation](#faq-documentation) @@ -24,130 +16,9 @@ This repository has the python-flask Mockup servers created with openapi-generat Please refer to [OCF Documentation] for more detailed information. +# Install and Run -# Install and Run - -## How to run CAPIF services in this Repository -Capif services are developed under /service/ folder. - -### Run All CAPIF Services locally with Docker images -To run using docker and docker compose, version 2.10 or higher, you must ensure you have that tools installed at your machine. Also to simplify the process, we have 3 script to control docker images to deploy, check and cleanup. - -To run all CAPIF APIs locally using docker and docker-compose you can execute: -``` -cd services/ - -./run.sh -``` -This will build and run all services using docker images, including mongodb and nginx locally and in background, and import ca.crt to nginx. - -Nginx deployed by default use **capifcore** hostname, but can add a parameter when run.sh is executed setting a different hostname, for example, -``` -./run.sh -c openshift.evolved-5g.eu -``` - -Also you can run monitoring just using option -m true, for example: -``` -./run.sh -m true -./run.sh -m true -c openshift.evolved-5g.eu -``` - -If you want to check if all CAPIF services are running properly in local machine after execute run.sh, we can use: -``` -./check_services_are_running.sh -``` -This shell script will return 0 if all services are running properly. - -When we need to stop all CAPIF services, we can use next bash script: -``` -./clean_capif_docker_services.sh -a -``` - -NOTE: You can use different flags if you only want to stop some of them, please check help using -``` -./clean_capif_docker_services.sh -h - -Usage: clean_capif_docker_services.sh - -c : clean capif services - -v : clean vault service - -r : clean register service - -m : clean monitoring service - -a : clean all services - -h : show this help -`````` - -This shell script will remove and clean all CAPIF services started previously with run.sh - -On the other hand you can check logs using show_logs.sh script, please check options: -``` -./show_logs.sh -You must specify an option before run script. -Usage: ./show_logs.sh - -c : Show capif services - -v : Show vault service - -r : Show register service - -m : Show monitoring service - -a : Show all services - -f : Follow log output - -h : Show this help -``` -You can also use option -f in order to live follow log output - -### Run All CAPIF Services locally with Docker images and deploy monitoring stack -It is now possible to deploy a monitoring stack for CAPIF with Grafana, Prometheus, FluentBit, Loki, Cadvisor, Tempo and Opentelemetry. - -To deploy CAPIF together with the monitoring stack, it is only necessary to execute the following. - -``` -./run.sh -m true -``` - -After they have been built, the different panels can be consulted in Grafana at the url - -``` -http://localhost:3000 -``` - -By default, the monitoring option is set to false. Once up, all data sources and dashboards are automatically provisioned - -### Run each service using Docker - -Also you can run service by service using docker: -``` -cd -docker build -t capif_security . -docker run -p 8080:8080 capif_security -``` - -### Run each service using Python - -Run using python -``` -cd -pip3 install -r requirements.txt -python3 -m -``` - -# Important urls: - -## Mongo CAPIF's DB Dashboard -``` -http://localhost:8082/ (if accessed from localhost) - -or - -http://:8082/ (if accessed from another host) -``` - -## Mongo Register's DB Dashboard -``` -http://localhost:8083/ (if accessed from localhost) - -or - -http://:8083/ (if accessed from another host) -``` - +Please refer to [OCF How to run] for more detailed information. # FAQ Documentation @@ -159,4 +30,5 @@ Frequently asked questions can be found here: [FAQ Directory] [Testing with Robot Framework]: ./docs/testing_with_robot/README.md "Testing with Robot Framework" [FAQ Directory]: https://ocf.etsi.org/documentation/latest/FAQ/ "FAQ Url" [OCF Documentation]: https://ocf.etsi.org/documentation/latest/ "OCF Documentation" +[OCF How to run]: https://ocf.etsi.org/documentation/latest/gettingstarted/howtorun/ "How to run" -- GitLab From 700894ce428839001c25da0968f5caaf57f5c28f Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Fri, 31 Jan 2025 12:51:41 +0100 Subject: [PATCH 009/157] Changed informatino on README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7bb59f6b..62f6b8a0 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,15 @@ # Common API Framework (CAPIF) - [Common API Framework (CAPIF)](#common-api-framework-capif) -- [CAPIF\_API\_Services](#capif_api_services) +- [3GPP Common API Framework CAPIF\_API\_Services](#3gpp-common-api-framework-capif_api_services) - [Documentation](#documentation) - [Install and Run](#install-and-run) - [FAQ Documentation](#faq-documentation) -# CAPIF_API_Services -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] +# 3GPP Common API Framework CAPIF_API_Services +This repository includes all services developed using Python Flask servers, created with openapi-generator with swagger definitions on [Open API Descriptions of 3GPP 5G APIs] for release 18 of Technical Specifications. # Documentation -- GitLab From 13edad80d4e62f78b62d4b265864b893153059e5 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Fri, 31 Jan 2025 12:52:38 +0100 Subject: [PATCH 010/157] Changed informatino on README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 62f6b8a0..8043acab 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # Common API Framework (CAPIF) - [Common API Framework (CAPIF)](#common-api-framework-capif) -- [3GPP Common API Framework CAPIF\_API\_Services](#3gpp-common-api-framework-capif_api_services) +- [3GPP Common API Framework OpenCAPIF implementation](#3gpp-common-api-framework-opencapif-implementation) - [Documentation](#documentation) - [Install and Run](#install-and-run) - [FAQ Documentation](#faq-documentation) -# 3GPP Common API Framework CAPIF_API_Services +# 3GPP Common API Framework OpenCAPIF implementation This repository includes all services developed using Python Flask servers, created with openapi-generator with swagger definitions on [Open API Descriptions of 3GPP 5G APIs] for release 18 of Technical Specifications. # Documentation -- GitLab From cfb7c695f5983f4d929ed12e62c847c266e34e1e Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 3 Feb 2025 12:37:54 +0100 Subject: [PATCH 011/157] Capif hostname change fixes on local deployment --- services/clean_capif_docker_services.sh | 11 +++++ services/docker-compose-register.yml | 1 + services/docker-compose-vault.yml | 1 + services/register/Dockerfile | 2 - services/run.sh | 24 +++++++++- services/vault/vault_prepare_certs.sh | 62 ++++++++----------------- 6 files changed, 56 insertions(+), 45 deletions(-) diff --git a/services/clean_capif_docker_services.sh b/services/clean_capif_docker_services.sh index dec71b82..b547fdb7 100755 --- a/services/clean_capif_docker_services.sh +++ b/services/clean_capif_docker_services.sh @@ -3,6 +3,8 @@ # Directories variables setup (no modification needed) export SERVICES_DIR=$(dirname "$(readlink -f "$0")") export CAPIF_BASE_DIR=$(dirname "$SERVICES_DIR") +# Path to the register config.yaml file +REGISTER_CONFIG_FILE="$SERVICES_DIR/register/config.yaml" help() { echo "Usage: $1 " @@ -81,6 +83,15 @@ for FILE in "${FILES[@]}"; do fi done +# Check if the backup config.yaml file exists before restoring +if [ -f "$REGISTER_CONFIG_FILE.bak" ]; then + git update-index --no-assume-unchanged "$REGISTER_CONFIG_FILE.bak" + mv "$REGISTER_CONFIG_FILE.bak" "$REGISTER_CONFIG_FILE" + git update-index --no-assume-unchanged "$REGISTER_CONFIG_FILE" +else + echo "Backup config file not found, skipping restore." +fi + docker network rm capif-network docker volume prune --all --force diff --git a/services/docker-compose-register.yml b/services/docker-compose-register.yml index 011e9063..9d5bc707 100644 --- a/services/docker-compose-register.yml +++ b/services/docker-compose-register.yml @@ -13,6 +13,7 @@ services: - VAULT_PORT=8200 - LOG_LEVEL=${LOG_LEVEL} - TIMEOUT=10 + - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} extra_hosts: - host.docker.internal:host-gateway - vault:host-gateway diff --git a/services/docker-compose-vault.yml b/services/docker-compose-vault.yml index 82a38d0a..d2d8f6db 100644 --- a/services/docker-compose-vault.yml +++ b/services/docker-compose-vault.yml @@ -10,6 +10,7 @@ services: environment: - VAULT_DEV_ROOT_TOKEN_ID=dev-only-token - VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200 + - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} volumes: - ./vault/data:/vault/data - ./vault/config:/vault/config diff --git a/services/register/Dockerfile b/services/register/Dockerfile index bb03b219..24676e54 100644 --- a/services/register/Dockerfile +++ b/services/register/Dockerfile @@ -17,8 +17,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN pip3 install --no-cache-dir -r requirements.txt RUN apt-get update && apt-get install -y --no-install-recommends openssl curl redis -#ENV CAPIF_PRIV_KEY = $CAPIF_PRIV_KEY - COPY . /usr/src/app EXPOSE 8080 diff --git a/services/run.sh b/services/run.sh index 8a0094e6..6b748037 100755 --- a/services/run.sh +++ b/services/run.sh @@ -3,6 +3,8 @@ # Directories variables setup (no modification needed) export SERVICES_DIR=$(dirname "$(readlink -f "$0")") export CAPIF_BASE_DIR=$(dirname "$SERVICES_DIR") +# Path to the register config.yaml file +REGISTER_CONFIG_FILE="$SERVICES_DIR/register/config.yaml" help() { echo "Usage: $1 " @@ -40,6 +42,13 @@ else exit 1 fi +# Check if yq is installed +if ! command -v yq &> /dev/null +then + echo "yq is not installed. Please install it first." + exit 1 +fi + # Read params while getopts ":c:l:mshr" opt; do case $opt in @@ -74,6 +83,7 @@ done echo Nginx hostname will be $HOSTNAME, deploy $DEPLOY, monitoring $MONITORING_STATE +# Deploy Monitoring stack if [ "$MONITORING_STATE" == "true" ] ; then echo '***Monitoring set as true***' echo '***Creating Monitoring stack***' @@ -90,7 +100,8 @@ fi docker network create capif-network -docker compose -f "$SERVICES_DIR/docker-compose-vault.yml" up --detach --build $CACHED_INFO +# Deploy Vault service +CAPIF_HOSTNAME=$HOSTNAME docker compose -f "$SERVICES_DIR/docker-compose-vault.yml" up --detach --build $CACHED_INFO status=$? if [ $status -eq 0 ]; then @@ -100,6 +111,7 @@ else exit $status fi +# Deploy Capif services CAPIF_HOSTNAME=$HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-capif.yml" up --detach --build $CACHED_INFO status=$? @@ -110,6 +122,15 @@ else exit $status fi +# Backup Original config.yaml file +cp $REGISTER_CONFIG_FILE $REGISTER_CONFIG_FILE.bak +# Mark the file as assume-unchanged +git update-index --assume-unchanged "$REGISTER_CONFIG_FILE" + +# Edit Register Service URL within ccf in the config.yaml file +yq eval ".ccf.url = \"$HOSTNAME\"" -i "$REGISTER_CONFIG_FILE" + +# Deploy Register service CAPIF_PRIV_KEY_BASE_64=$(echo "$(cat nginx/certs/server.key)") CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-register.yml" up --detach --build $CACHED_INFO @@ -121,6 +142,7 @@ else exit $status fi +# Deploy Robot Mock Server if [ "$ROBOT_MOCK_SERVER" == "true" ] ; then echo '***Robot Mock Server set as true***' echo '***Creating Robot Mock Server stack***' diff --git a/services/vault/vault_prepare_certs.sh b/services/vault/vault_prepare_certs.sh index dbec8fdb..b209ecfe 100644 --- a/services/vault/vault_prepare_certs.sh +++ b/services/vault/vault_prepare_certs.sh @@ -1,13 +1,17 @@ #!/bin/sh -# Establecer las variables de entorno de Vault +# Setup environment variables for Vault +export VAULT_ADDR="http://$VAULT_DEV_LISTEN_ADDRESS" +export VAULT_TOKEN=$VAULT_DEV_ROOT_TOKEN_ID +HOSTNAME="$CAPIF_HOSTNAME" -export VAULT_ADDR='http://0.0.0.0:8200' -export VAULT_TOKEN="dev-only-token" +echo "CAPIF_HOSTNAME: $HOSTNAME" +echo "VAULT_ADDR: $VAULT_ADDR" +echo "VAULT_TOKEN: $VAULT_TOKEN" vault secrets enable pki -# Generar una CA en Vault +# Generate a root CA vault secrets tune -max-lease-ttl=87600h pki vault write -field=certificate pki/root/generate/internal \ @@ -19,7 +23,7 @@ vault write pki/config/urls \ issuing_certificates="$VAULT_ADDR/v1/pki/ca" \ crl_distribution_points="$VAULT_ADDR/v1/pki/crl" -# # Generar una CA intermedia en Vault +# Generate an intermediate CA vault secrets enable -path=pki_int pki vault secrets tune -max-lease-ttl=43800h pki_int @@ -29,34 +33,20 @@ vault write -format=json pki_int/intermediate/generate/internal \ issuer_name="capif-intermediate" \ | jq -r '.data.csr' > pki_intermediate.csr -# Firmar la CA intermedia con la CA raíz +# Sign the intermediate CA vault write -format=json pki/root/sign-intermediate \ issuer_ref="root-2023" \ csr=@pki_intermediate.csr \ format=pem_bundle ttl="43800h" \ | jq -r '.data.certificate' > capif_intermediate.cert.pem -# Configurar la CA intermedia en Vault +# Configure the intermediate CA vault write pki_int/intermediate/set-signed certificate=@capif_intermediate.cert.pem -#Crear rol en Vault -vault write pki_int/roles/my-ca use_csr_common_name=false require_cn=true use_csr_sans=false allowed_domains=capifcore allow_any_name=true allow_bare_domains=true allow_glob_domains=true allow_subdomains=true max_ttl=4300h ttl=4300h +# Configure the role for the intermediate CA +vault write pki_int/roles/my-ca use_csr_common_name=false require_cn=true use_csr_sans=false allowed_domains=$HOSTNAME allow_any_name=true allow_bare_domains=true allow_glob_domains=true allow_subdomains=true max_ttl=4300h ttl=4300h -# Emitir un certificado firmado por la CA intermedia -# vault write -format=json pki_int/issue/my-ca \ -# common_name="capifcore" \ -# format=pem_bundle ttl="438h" \ -# | jq -r '.data.certificate' > ccf_cert.crt.pem \ -# && jq -r '.data.issuing_ca' > root_ca.crt.pem \ -# && jq -r '.data.private_key' > private_key.pem - -# vault write -format=json pki_int/issue/my-ca \ -# common_name="capifcore" \ -# format=pem_bundle ttl="438h" \ -# | jq -r '.data.private_key as $private_key | .data.issuing_ca as $issuing_ca | .data.certificate as $certificate | [$private_key, $issuing_ca, $certificate]' > cert_data.json - - -#Create CSR +# Generate a certificate openssl genrsa -out ./server.key 2048 @@ -65,7 +55,7 @@ STATE="Madrid" # state or province name LOCALITY="Madrid" # Locality Name (e.g. city) ORGNAME="Telefonica I+D" # Organization Name (eg, company) ORGUNIT="Innovation" # Organizational Unit Name (eg. section) -COMMONNAME="capifcore" +COMMONNAME="$HOSTNAME" EMAIL="inno@tid.es" # certificate's email address # optional extra details CHALLENGE="" # challenge password @@ -74,7 +64,6 @@ COMPANY="" # company name # DAYS="-days 365" # create the certificate request -#cat <<__EOF__ | openssl req -new $DAYS -nodes -keyout client.key -out client.csr cat <<__EOF__ | openssl req -new $DAYS -key ./server.key -out ./server.csr $COUNTRY $STATE @@ -87,31 +76,20 @@ $CHALLENGE $COMPANY __EOF__ -# vault write -format=json pki_int/issue/my-ca \ -# csr=@server.csr \ -# format=pem_bundle ttl="438h" \ -# | jq -r '.data.private_key as $private_key | .data.issuing_ca as $issuing_ca | .data.certificate as $certificate | [$private_key, $issuing_ca, $certificate]' > cert_data.json -vault write -format=json pki_int/sign/my-ca format=pem_bundle ttl="43000h" csr=@server.csr common_name="capifcore" | jq -r '.data.issuing_ca as $issuing_ca | .data.certificate as $certificate | [$issuing_ca, $certificate]' > cert_data.json +vault write -format=json pki_int/sign/my-ca format=pem_bundle ttl="43000h" csr=@server.csr common_name="$HOSTNAME" | jq -r '.data.issuing_ca as $issuing_ca | .data.certificate as $certificate | [$issuing_ca, $certificate]' > cert_data.json jq -r '.[0]' cert_data.json > root_ca.crt.pem jq -r '.[1]' cert_data.json > server_certificate.crt.pem openssl x509 -pubkey -noout -in server_certificate.crt.pem > server_certificate_pub.pem -# Guardar la clave privada en Vault - -#vault kv put secret/ca ca=@root_ca.crt.pem root_2023_ca.crt - -#cat root_2023_ca.crt root_2023_ca.crt > ca.crt - +# Concatenate the root and intermediate CA certificates cat > certificados_concatenados.crt << EOF $(cat "root_2023_ca.crt") $(cat "root_ca.crt.pem") EOF - -# vault kv put secret/ca ca=@root_2023_ca.crt vault kv put secret/ca ca=@certificados_concatenados.crt vault kv put secret/server_cert cert=@server_certificate.crt.pem @@ -124,15 +102,15 @@ POLICY_NAME="my-policy" POLICY_FILE="my-policy.hcl" TOKEN_ID="read-ca-token" -# Crear la política en Vault +# Create a policy to read the CA echo "path \"secret/data/ca\" { capabilities = [\"read\"] }" > "$POLICY_FILE" vault policy write "$POLICY_NAME" "$POLICY_FILE" -# Generar un nuevo token y asignar la política +# Create a token with the policy TOKEN=$(vault token create -id="$TOKEN_ID" -policy="$POLICY_NAME" -format=json | jq -r '.auth.client_token') -echo "Token generado:" +echo "Generated Token:" echo "$TOKEN" \ No newline at end of file -- GitLab From 78f9d5b772457b4c8ab447a0c7481349232d58a2 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Mon, 10 Feb 2025 14:17:49 +0100 Subject: [PATCH 012/157] All Event Filters --- .../capif_acl/core/internal_service_ops.py | 26 ++++++++-- .../capif_events/core/notifications.py | 48 ++++++++++++++----- 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py index 520f35c1..95b95599 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py @@ -1,4 +1,3 @@ - from datetime import datetime, timedelta from flask import current_app @@ -36,6 +35,22 @@ class InternalServiceOps(Resource): if r is None: mycol.update_one({"service_id": service_id, "aef_id": aef_id}, { "$push": {"api_invoker_policies": invoker_acl.to_dict()}}) + + inserted_invoker_acl = mycol.find_one({"service_id": service_id, "aef_id": aef_id, + "api_invoker_policies.api_invoker_id": invoker_id}, {"_id": 0}) + current_app.logger.info(inserted_invoker_acl) + inserted_invoker_acl_camel = dict_to_camel_case(inserted_invoker_acl) + current_app.logger.info(inserted_invoker_acl_camel) + + created_invoker_policy = next((policy for policy in inserted_invoker_acl_camel['apiInvokerPolicies'] if policy['apiInvokerId'] == invoker_id), None) + + accCtrlPolListExt = { + "apiId": service_id, + "apiInvokerPolicies": [created_invoker_policy] + } + RedisEvent("ACCESS_CONTROL_POLICY_UPDATE", + acc_ctrl_pol_list=accCtrlPolListExt).send_event() + else: current_app.logger.info( f"Creating service ACLs for service: {service_id}") @@ -51,13 +66,16 @@ class InternalServiceOps(Resource): } result = mycol.insert_one(service_acls) - inserted_service_acls=mycol.find_one({"_id": result.inserted_id}, {"_id": 0}) + inserted_service_acls = mycol.find_one({"_id": result.inserted_id}, {"_id": 0}) current_app.logger.info(inserted_service_acls) - inserted_service_acls_camel=dict_to_camel_case(inserted_service_acls) + inserted_service_acls_camel = dict_to_camel_case(inserted_service_acls) current_app.logger.info(inserted_service_acls_camel) + + created_invoker_policy = next((policy for policy in inserted_service_acls_camel['apiInvokerPolicies'] if policy['apiInvokerId'] == invoker_id), None) + accCtrlPolListExt = { "apiId": service_id, - "apiInvokerPolicies": inserted_service_acls_camel['apiInvokerPolicies'] + "apiInvokerPolicies": [created_invoker_policy] } RedisEvent("ACCESS_CONTROL_POLICY_UPDATE", acc_ctrl_pol_list=accCtrlPolListExt).send_event() diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index 3e85b6f8..ab769e51 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -40,18 +40,16 @@ class Notifications(): event_detail={} current_app.logger.debug(f"event: {event_detail_redis}") - # The nth entry in the "eventFilters" attribute shall correspond to the nth entry in the "events" attribute event_filters = sub.get("event_filters", None) event_filter=None - current_app.logger.debug(f"Event filters: {event_filters}") if event_filters: try: - event_filter = event_filters[sub.get("events", []).index(event)] + event_filter = None if all(value is None for value in event_filters[sub.get("events", []).index(event)].values()) else event_filters[sub.get("events", []).index(event)] + current_app.logger.debug(f"Event filters: {event_filter}") except IndexError: event_filter=None if event in ["SERVICE_API_AVAILABLE", "SERVICE_API_UNAVAILABLE"]: - current_app.logger.debug(event_filter) if event_filter: api_ids_list = event_filter.get("api_ids", None) if api_ids_list and event_detail_redis.get('apiIds', None)[0] in api_ids_list: @@ -84,9 +82,17 @@ class Notifications(): event_detail["apiInvokerIds"]=event_detail_redis.get('apiInvokerIds', None) elif event in ["ACCESS_CONTROL_POLICY_UPDATE"]: if event_filter: - invoker_ids_list = event_filter.get("api_invoker_ids", None) - api_ids_list = event_filter.get("api_ids", None) - if invoker_ids_list and (event_detail_redis.get('apiInvokerIds', None)[0] in invoker_ids_list or event_detail_redis.get('api_ids', None)[0] in api_ids_list): + filter_invoker_ids = event_filter.get("api_invoker_ids", []) + filter_api_ids = event_filter.get("api_ids", []) + + invoker_ids_list = [invoker.get("apiInvokerId") for invoker in event_detail_redis.get("accCtrlPolList", None).get("apiInvokerPolicies")] + api_id = event_detail_redis.get("accCtrlPolList").get("apiId", None) + + if (filter_api_ids and not filter_invoker_ids) and (api_id in filter_api_ids): + event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) + elif (not filter_api_ids and filter_invoker_ids) and bool(set(filter_invoker_ids) & set(invoker_ids_list)): + event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) + elif (filter_api_ids and filter_invoker_ids) and bool(set(filter_invoker_ids) & set(invoker_ids_list)) and api_id in filter_api_ids: event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) else: continue @@ -94,15 +100,31 @@ class Notifications(): event_detail["accCtrlPolList"]=event_detail_redis.get('accCtrlPolList', None) elif event in ["SERVICE_API_INVOCATION_SUCCESS", "SERVICE_API_INVOCATION_FAILURE"]: if event_filter: - invoker_ids_list = event_filter.get("api_invoker_ids", None) - api_ids_list = event_filter.get("api_ids", None) - aef_ids_list = event_filter.get("aef_ids", None) - if invoker_ids_list and (event_detail_redis.get('apiInvokerIds', None)[0] in invoker_ids_list or - event_detail_redis.get('apiIds', None)[0] in api_ids_list or - event_detail_redis.get('aefIds', None)[0] in aef_ids_list ): + filter_invoker_ids = event_filter.get("api_invoker_ids", None) + filter_api_ids = event_filter.get("api_ids", None) + filter_aef_ids = event_filter.get("aef_ids", None) + + invoker_id = event_detail_redis.get("invocationLogs", None)[0].get("api_invoker_id", None) + aef_id = event_detail_redis.get("invocationLogs", None)[0].get("aef_id", None) + api_id = event_detail_redis.get("invocationLogs", None)[0].get("logs", None)[0].get("api_id", None) + + if (filter_api_ids and not filter_invoker_ids and not filter_aef_ids) and (api_id in filter_api_ids): + event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) + elif (not filter_api_ids and filter_invoker_ids and not filter_aef_ids) and invoker_id in filter_invoker_ids: + event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) + elif (not filter_api_ids and not filter_invoker_ids and filter_aef_ids) and aef_id in filter_aef_ids: + event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) + elif (filter_api_ids and filter_invoker_ids and not filter_aef_ids) and (api_id in filter_api_ids) and invoker_id in filter_invoker_ids: + event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) + elif (filter_api_ids and not filter_invoker_ids and filter_aef_ids) and (api_id in filter_api_ids) and aef_id in filter_aef_ids: + event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) + elif (not filter_api_ids and filter_invoker_ids and filter_aef_ids) and invoker_id in filter_invoker_ids and aef_id in filter_aef_ids: + event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) + elif (filter_api_ids and filter_invoker_ids and filter_aef_ids) and (api_id in filter_api_ids) and invoker_id in filter_invoker_ids and aef_id in filter_aef_ids: event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) else: continue + else: event_detail["invocationLogs"]=event_detail_redis.get('invocationLogs', None) elif event in ["API_TOPOLOGY_HIDING_CREATED", "API_TOPOLOGY_HIDING_REVOKED"]: -- GitLab From c39b4d3c13e156c8bd24be9412e02635b17e589c Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Tue, 11 Feb 2025 09:39:52 +0100 Subject: [PATCH 013/157] Remove filter in capif_api_events-7 and capif_api_events-8 --- tests/features/CAPIF Api Events/capif_events_api.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index 9f8b4e23..69071ab5 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -245,7 +245,7 @@ Invoker subscribe to Service API Available and Unavailable events ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... event_filters=${event_filters} + # ... event_filters=${event_filters} ... supported_features=4 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions @@ -317,7 +317,7 @@ Invoker subscribe to Service API Update ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... event_filters=${event_filters} + # ... event_filters=${event_filters} ... supported_features=4 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions -- GitLab From 6c8f13b544223db874223a65ca8f62ef67d97354 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 13 Feb 2025 13:19:39 +0100 Subject: [PATCH 014/157] Added CAPIF configuration to MongoDB and integrated security method order selection --- .../capif_security/core/servicesecurity.py | 17 +++++++++++++++-- services/helper/config.yaml | 16 ++++++++++++++++ services/helper/helper_service/db/db.py | 19 +++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py index 916b2861..b1136480 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py @@ -182,8 +182,21 @@ class SecurityOperations(Resource): "Not found comptaible security method with pref security method") return bad_request_error(detail="Not found compatible security method with pref security method", cause="Error pref security method", invalid_params=[{"param": "prefSecurityMethods", "reason": "pref security method not compatible with security method available"}]) - service_instance.sel_security_method = list( - valid_security_method)[0] + # Retrieve security method priority configuration from the database + config_col = self.db.get_col_by_name("capifConfiguration") + capif_config = config_col.find_one({"config_name": "default"}) + if not capif_config: + current_app.logger.error("CAPIF Configuration not found when trying to retrieve security method priority") + return internal_server_error(detail="CAPIF Configuration not found when trying to retrieve security method priority", cause="Database Error") + + priority_mapping = capif_config["settings"]["security_method_priority"] + + # Sort valid security methods based on priority from the configuration + sorted_methods = sorted(valid_security_method, key=lambda method: priority_mapping.get(method.lower(), float('inf'))) + + # Select the highest-priority security method + service_instance.sel_security_method = sorted_methods[0] + # Send service instance to ACL current_app.logger.debug("Sending message to create ACL") publish_ops.publish_message("acls-messages", "create-acl:"+str( diff --git a/services/helper/config.yaml b/services/helper/config.yaml index bb090f08..d4cb1f40 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -7,6 +7,7 @@ mongo: { 'col_services': "serviceapidescriptions", 'col_security': "security", 'col_event': "eventsdetails", + 'col_capifConfiguration': "capifConfiguration", 'host': 'mongo', 'port': "27017" } @@ -17,3 +18,18 @@ ca_factory: { "token": "dev-only-token", "verify": False } + +capifConfiguration: { + config_name: "default", + version: "1.0", + description: "Default CAPIF Configuration", + settings: { + certify_expiration_period: 30, + acls_size_configuration: 24, + security_method_priority: { + psk: 1, + pki: 2, + oauth: 3 + } + } +} diff --git a/services/helper/helper_service/db/db.py b/services/helper/helper_service/db/db.py index 57b9b72e..85fdd7c5 100644 --- a/services/helper/helper_service/db/db.py +++ b/services/helper/helper_service/db/db.py @@ -16,6 +16,9 @@ class MongoDatabse(): self.services_col = self.config['mongo']['col_services'] self.security_context_col = self.config['mongo']['col_security'] self.events = self.config['mongo']['col_event'] + self.capifConfiguration = self.config['mongo']['col_capifConfiguration'] + + self.initialize_capif_configuration() def get_col_by_name(self, name): @@ -45,3 +48,19 @@ class MongoDatabse(): if self.db.client: self.db.client.close() + def initialize_capif_configuration(self): + """ + Inserts default data into the capifConfiguration collection if it is empty. + The data is taken from config.yaml. + """ + capif_col = self.get_col_by_name(self.capifConfiguration) + + if capif_col.count_documents({}) == 0: + # Read configuration from config.yaml + default_config = self.config["capifConfiguration"] + + capif_col.insert_one(default_config) + print("Default data inserted into the capifConfiguration collection from config.yaml") + else: + print("The capifConfiguration collection already contains data. No default values were inserted.") + -- GitLab From e9b1c334efc3f585f1785edc5e6236e031269190 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Fri, 14 Feb 2025 10:31:30 +0100 Subject: [PATCH 015/157] Changes to centralice information on variables.sh file --- services/check_services_are_running.sh | 16 +++--- services/clean_capif_docker_services.sh | 13 ++--- services/clean_mock_server.sh | 3 +- services/create_users.sh | 25 +-------- services/docker-compose-capif.yml | 74 ++++++++++++------------- services/docker-compose-mock-server.yml | 6 +- services/docker-compose-register.yml | 6 +- services/docker-compose-vault.yml | 6 +- services/remove_users.sh | 26 +-------- services/run.sh | 71 +++++++++++++----------- services/run_capif_tests.sh | 24 +------- services/run_mock_server.sh | 17 +++--- services/variables.sh | 50 +++++++++++++++++ 13 files changed, 159 insertions(+), 178 deletions(-) create mode 100755 services/variables.sh diff --git a/services/check_services_are_running.sh b/services/check_services_are_running.sh index b7e7a7a1..4e174bab 100755 --- a/services/check_services_are_running.sh +++ b/services/check_services_are_running.sh @@ -1,11 +1,11 @@ #!/bin/bash +source $(dirname "$(readlink -f "$0")")/variables.sh + export CAPIF_PRIV_KEY= export CAPIF_PRIV_KEY_BASE_64= -export MONITORING= -export LOG_LEVEL=DEBUG -running="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-vault.yml ps --services --all --filter "status=running")" -services="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-vault.yml ps --services --all)" +running="$(GITLAB_BASE_URL=$GITLAB_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f docker-compose-vault.yml ps --services --all --filter "status=running")" +services="$(GITLAB_BASE_URL=$GITLAB_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f docker-compose-vault.yml ps --services --all)" if [ "$running" != "$services" ]; then echo "Following Vault services are not running:" # Bash specific @@ -15,8 +15,8 @@ else echo "All Vault services are running" fi -running="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all --filter "status=running")" -services="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all)" +running="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all --filter "status=running")" +services="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all)" if [ "$running" != "$services" ]; then echo "Following CCF services are not running:" # Bash specific @@ -26,8 +26,8 @@ else echo "All CCF services are running" fi -running="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all --filter "status=running")" -services="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all)" +running="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all --filter "status=running")" +services="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all)" if [ "$running" != "$services" ]; then echo "Following Register services are not running:" # Bash specific diff --git a/services/clean_capif_docker_services.sh b/services/clean_capif_docker_services.sh index b547fdb7..3525377f 100755 --- a/services/clean_capif_docker_services.sh +++ b/services/clean_capif_docker_services.sh @@ -1,10 +1,5 @@ #!/bin/bash - -# Directories variables setup (no modification needed) -export SERVICES_DIR=$(dirname "$(readlink -f "$0")") -export CAPIF_BASE_DIR=$(dirname "$SERVICES_DIR") -# Path to the register config.yaml file -REGISTER_CONFIG_FILE="$SERVICES_DIR/register/config.yaml" +source $(dirname "$(readlink -f "$0")")/variables.sh help() { echo "Usage: $1 " @@ -28,7 +23,7 @@ FILES=() echo "${FILES[@]}" # Read params -while getopts "cvrahms" opt; do +while getopts "cvrahmsf:" opt; do case $opt in c) echo "Remove Capif services" @@ -74,7 +69,7 @@ echo "${FILES[@]}" for FILE in "${FILES[@]}"; do echo "Executing 'docker compose down' for file $FILE" - CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 DUID=$DUID DGID=$DGID MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$FILE" down --rmi all + GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 DUID=$DUID DGID=$DGID MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$FILE" down --rmi all status=$? if [ $status -eq 0 ]; then echo "*** Removed Service from $FILE ***" @@ -83,6 +78,8 @@ for FILE in "${FILES[@]}"; do fi done +# Path to the register config.yaml file +REGISTER_CONFIG_FILE="$SERVICES_DIR/register/config.yaml" # Check if the backup config.yaml file exists before restoring if [ -f "$REGISTER_CONFIG_FILE.bak" ]; then git update-index --no-assume-unchanged "$REGISTER_CONFIG_FILE.bak" diff --git a/services/clean_mock_server.sh b/services/clean_mock_server.sh index 157e39af..31b65412 100755 --- a/services/clean_mock_server.sh +++ b/services/clean_mock_server.sh @@ -1,8 +1,7 @@ #!/bin/bash +source $(dirname "$(readlink -f "$0")")/variables.sh # Directories variables setup (no modification needed) -export SERVICES_DIR=$(dirname "$(readlink -f "$0")") - FILE="$SERVICES_DIR/docker-compose-mock-server.yml" echo "Executing 'docker compose down' for file $FILE" diff --git a/services/create_users.sh b/services/create_users.sh index d285bd1e..4bcc8cb3 100755 --- a/services/create_users.sh +++ b/services/create_users.sh @@ -1,4 +1,5 @@ #!/bin/bash +source $(dirname "$(readlink -f "$0")")/variables.sh # User to create TOTAL_USERS=1 @@ -58,30 +59,6 @@ then exit -1 fi -# Other Stuff -DOCKER_ROBOT_IMAGE=labs.etsi.org:5050/ocf/capif/robot-tests-image -DOCKER_ROBOT_IMAGE_VERSION=1.0 -cd .. -REPOSITORY_BASE_FOLDER=${PWD} -TEST_FOLDER=$REPOSITORY_BASE_FOLDER/tests -RESULT_FOLDER=$REPOSITORY_BASE_FOLDER/results -ROBOT_DOCKER_FILE_FOLDER=$REPOSITORY_BASE_FOLDER/tools/robot - -# nginx Hostname and http port (80 by default) to reach for tests -CAPIF_REGISTER=capifcore -CAPIF_REGISTER_PORT=8084 -CAPIF_HOSTNAME=capifcore -CAPIF_HTTP_PORT=8080 -CAPIF_HTTPS_PORT=443 - -# VAULT access configuration -CAPIF_VAULT=vault -CAPIF_VAULT_PORT=8200 -CAPIF_VAULT_TOKEN=read-ca-token - -# Mock Server -MOCK_SERVER_URL=http://mock-server:9100 -NOTIFICATION_DESTINATION_URL=$MOCK_SERVER_URL PLATFORM=$(uname -m) if [ "x86_64" == "$PLATFORM" ]; then diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index 037d5f35..95aaa325 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -5,21 +5,21 @@ services: ports: - "6379:6379" volumes: - - $PWD/redis-data:/var/lib/redis - - $PWD/redis.conf:/usr/local/etc/redis/redis.conf + - ${SERVICES_DIR}/redis-data:/var/lib/redis + - ${SERVICES_DIR}/redis.conf:/usr/local/etc/redis/redis.conf environment: - REDIS_REPLICATION_MODE=master helper: build: - context: ./helper + context: ${SERVICES_DIR}/helper expose: - "8080" container_name: helper restart: unless-stopped volumes: - - ./helper:/usr/src/app + - ${SERVICES_DIR}/helper:/usr/src/app extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -32,17 +32,17 @@ services: - VAULT_ACCESS_TOKEN=dev-only-token - VAULT_PORT=8200 - LOG_LEVEL=${LOG_LEVEL} - image: labs.etsi.org:5050/ocf/capif/helper:v2.x.x-release + image: ${GITLAB_BASE_URL}/helper:${OCF_VERSION} depends_on: - nginx access-control-policy: build: - context: ./TS29222_CAPIF_Access_Control_Policy_API + context: ${SERVICES_DIR}/TS29222_CAPIF_Access_Control_Policy_API expose: - "8080" volumes: - - ./TS29222_CAPIF_Access_Control_Policy_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Access_Control_Policy_API:/usr/src/app extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -53,18 +53,18 @@ services: - MONITORING=${MONITORING} - LOG_LEVEL=${LOG_LEVEL} restart: unless-stopped - image: labs.etsi.org:5050/ocf/capif/access-control-policy:v2.x.x-release + image: ${GITLAB_BASE_URL}/access-control-policy:${OCF_VERSION} depends_on: - redis - nginx api-invoker-management: build: - context: ./TS29222_CAPIF_API_Invoker_Management_API + context: ${SERVICES_DIR}/TS29222_CAPIF_API_Invoker_Management_API expose: - "8080" volumes: - - ./TS29222_CAPIF_API_Invoker_Management_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_API_Invoker_Management_API:/usr/src/app extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -79,24 +79,24 @@ services: - VAULT_PORT=8200 - LOG_LEVEL=${LOG_LEVEL} restart: unless-stopped - image: labs.etsi.org:5050/ocf/capif/api-invoker-management-api:v2.x.x-release + image: ${GITLAB_BASE_URL}/api-invoker-management-api:${OCF_VERSION} depends_on: - redis - nginx api-provider-management: build: - context: ./TS29222_CAPIF_API_Provider_Management_API + context: ${SERVICES_DIR}/TS29222_CAPIF_API_Provider_Management_API expose: - "8080" volumes: - - ./TS29222_CAPIF_API_Provider_Management_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_API_Provider_Management_API:/usr/src/app extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway - otel-collector:host-gateway - vault:host-gateway - image: labs.etsi.org:5050/ocf/capif/api-provider-management-api:v2.x.x-release + image: ${GITLAB_BASE_URL}/api-provider-management-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-provider-management @@ -111,17 +111,17 @@ services: logs: build: - context: ./TS29222_CAPIF_Auditing_API + context: ${SERVICES_DIR}/TS29222_CAPIF_Auditing_API expose: - "8080" volumes: - - ./TS29222_CAPIF_Auditing_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Auditing_API:/usr/src/app extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway - otel-collector:host-gateway restart: unless-stopped - image: labs.etsi.org:5050/ocf/capif/auditing-api:v2.x.x-release + image: ${GITLAB_BASE_URL}/auditing-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-auditing @@ -132,17 +132,17 @@ services: service-apis: build: - context: ./TS29222_CAPIF_Discover_Service_API + context: ${SERVICES_DIR}/TS29222_CAPIF_Discover_Service_API expose: - "8080" volumes: - - ./TS29222_CAPIF_Discover_Service_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Discover_Service_API:/usr/src/app restart: unless-stopped extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway - otel-collector:host-gateway - image: labs.etsi.org:5050/ocf/capif/discover-service-api:v2.x.x-release + image: ${GITLAB_BASE_URL}/discover-service-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=services-apis @@ -153,12 +153,12 @@ services: capif-events: build: - context: ./TS29222_CAPIF_Events_API + context: ${SERVICES_DIR}/TS29222_CAPIF_Events_API expose: - "8080" volumes: - - ./TS29222_CAPIF_Events_API:/usr/src/app - image: labs.etsi.org:5050/ocf/capif/events-api:v2.x.x-release + - ${SERVICES_DIR}/TS29222_CAPIF_Events_API:/usr/src/app + image: ${GITLAB_BASE_URL}/events-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-events @@ -175,13 +175,13 @@ services: api-invocation-logs: build: - context: ./TS29222_CAPIF_Logging_API_Invocation_API + context: ${SERVICES_DIR}/TS29222_CAPIF_Logging_API_Invocation_API expose: - "8080" volumes: - - ./TS29222_CAPIF_Logging_API_Invocation_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Logging_API_Invocation_API:/usr/src/app restart: unless-stopped - image: labs.etsi.org:5050/ocf/capif/api-invocation-logs-api:v2.x.x-release + image: ${GITLAB_BASE_URL}/api-invocation-logs-api:${OCF_VERSION} extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -196,13 +196,13 @@ services: published-apis: build: - context: ./TS29222_CAPIF_Publish_Service_API + context: ${SERVICES_DIR}/TS29222_CAPIF_Publish_Service_API expose: - "8080" volumes: - - ./TS29222_CAPIF_Publish_Service_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Publish_Service_API:/usr/src/app restart: unless-stopped - image: labs.etsi.org:5050/ocf/capif/publish-service-api:v2.x.x-release + image: ${GITLAB_BASE_URL}/publish-service-api:${OCF_VERSION} extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -218,20 +218,20 @@ services: capif-routing-info: build: - context: ./TS29222_CAPIF_Routing_Info_API + context: ${SERVICES_DIR}/TS29222_CAPIF_Routing_Info_API expose: - "8080" - image: labs.etsi.org:5050/ocf/capif/routing-info-api:v2.x.x-release + image: ${GITLAB_BASE_URL}/routing-info-api:${OCF_VERSION} capif-security: build: - context: ./TS29222_CAPIF_Security_API + context: ${SERVICES_DIR}/TS29222_CAPIF_Security_API expose: - "8080" volumes: - - ./TS29222_CAPIF_Security_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Security_API:/usr/src/app restart: unless-stopped - image: labs.etsi.org:5050/ocf/capif/security-api:v2.x.x-release + image: ${GITLAB_BASE_URL}/security-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-security @@ -278,11 +278,11 @@ services: nginx: build: - context: ./nginx + context: ${SERVICES_DIR}/nginx ports: - "8080:8080" - "443:443" - image: labs.etsi.org:5050/ocf/capif/nginx:v2.x.x-release + image: ${GITLAB_BASE_URL}/nginx:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - VAULT_HOSTNAME=vault @@ -291,7 +291,7 @@ services: - LOG_LEVEL=${LOG_LEVEL} hostname: ${CAPIF_HOSTNAME} volumes: - - ./nginx/certs:/etc/nginx/certs + - ${SERVICES_DIR}/nginx/certs:/etc/nginx/certs extra_hosts: - host.docker.internal:host-gateway - vault:host-gateway diff --git a/services/docker-compose-mock-server.yml b/services/docker-compose-mock-server.yml index d769505c..f26c8765 100644 --- a/services/docker-compose-mock-server.yml +++ b/services/docker-compose-mock-server.yml @@ -1,17 +1,17 @@ services: mock-server: build: - context: ./mock_server + context: ${SERVICES_DIR}/mock_server ports: - 9100:9100 volumes: - - ./mock_server:/usr/src/app + - ${SERVICES_DIR}/mock_server:/usr/src/app extra_hosts: - host.docker.internal:host-gateway environment: - DEBUG_MODE=True restart: unless-stopped - image: labs.etsi.org:5050/ocf/capif/mock_server:latest + image: ${GITLAB_BASE_URL}/mock_server:${OCF_VERSION} networks: default: diff --git a/services/docker-compose-register.yml b/services/docker-compose-register.yml index 9d5bc707..0fd96777 100644 --- a/services/docker-compose-register.yml +++ b/services/docker-compose-register.yml @@ -1,11 +1,11 @@ services: register: build: - context: ./register + context: ${SERVICES_DIR}/register ports: - 8084:8080 volumes: - - ./register:/usr/src/app + - ${SERVICES_DIR}/register:/usr/src/app environment: - CAPIF_PRIV_KEY=${CAPIF_PRIV_KEY} - VAULT_HOSTNAME=vault @@ -18,7 +18,7 @@ services: - host.docker.internal:host-gateway - vault:host-gateway restart: unless-stopped - image: labs.etsi.org:5050/ocf/capif/register:v2.x.x-release + image: ${GITLAB_BASE_URL}/register:${OCF_VERSION} depends_on: - mongo_register diff --git a/services/docker-compose-vault.yml b/services/docker-compose-vault.yml index d2d8f6db..5b2bbed4 100644 --- a/services/docker-compose-vault.yml +++ b/services/docker-compose-vault.yml @@ -1,7 +1,7 @@ services: vault: build: - context: ./vault + context: ${SERVICES_DIR}/vault restart: unless-stopped ports: - 8200:8200 @@ -12,5 +12,5 @@ services: - VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200 - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} volumes: - - ./vault/data:/vault/data - - ./vault/config:/vault/config + - ${SERVICES_DIR}/vault/data:/vault/data + - ${SERVICES_DIR}/vault/config:/vault/config diff --git a/services/remove_users.sh b/services/remove_users.sh index 72219814..4b90988b 100755 --- a/services/remove_users.sh +++ b/services/remove_users.sh @@ -1,4 +1,5 @@ #!/bin/bash +source $(dirname "$(readlink -f "$0")")/variables.sh # User to remove USERNAME_PREFIX= @@ -37,31 +38,6 @@ then exit -1 fi -# Other Stuff -DOCKER_ROBOT_IMAGE=labs.etsi.org:5050/ocf/capif/robot-tests-image -DOCKER_ROBOT_IMAGE_VERSION=1.0 -cd .. -REPOSITORY_BASE_FOLDER=${PWD} -TEST_FOLDER=$REPOSITORY_BASE_FOLDER/tests -RESULT_FOLDER=$REPOSITORY_BASE_FOLDER/results -ROBOT_DOCKER_FILE_FOLDER=$REPOSITORY_BASE_FOLDER/tools/robot - -# nginx Hostname and http port (80 by default) to reach for tests -CAPIF_REGISTER=capifcore -CAPIF_REGISTER_PORT=8084 -CAPIF_HOSTNAME=capifcore -CAPIF_HTTP_PORT=8080 -CAPIF_HTTPS_PORT=443 - -# VAULT access configuration -CAPIF_VAULT=vault -CAPIF_VAULT_PORT=8200 -CAPIF_VAULT_TOKEN=read-ca-token - -# Mock Server -MOCK_SERVER_URL=http://mock-server:9100 -NOTIFICATION_DESTINATION_URL=$MOCK_SERVER_URL - PLATFORM=$(uname -m) if [ "x86_64" == "$PLATFORM" ]; then DOCKER_ROBOT_IMAGE_VERSION=$DOCKER_ROBOT_IMAGE_VERSION-amd64 diff --git a/services/run.sh b/services/run.sh index 6b748037..8dbb5fd3 100755 --- a/services/run.sh +++ b/services/run.sh @@ -1,10 +1,5 @@ #!/bin/bash - -# Directories variables setup (no modification needed) -export SERVICES_DIR=$(dirname "$(readlink -f "$0")") -export CAPIF_BASE_DIR=$(dirname "$SERVICES_DIR") -# Path to the register config.yaml file -REGISTER_CONFIG_FILE="$SERVICES_DIR/register/config.yaml" +source $(dirname "$(readlink -f "$0")")/variables.sh help() { echo "Usage: $1 " @@ -13,24 +8,14 @@ help() { echo " -m : Run monitoring service" echo " -l : Set Log Level (default DEBUG). Select one of: [CRITICAL, FATAL, ERROR, WARNING, WARN, INFO, DEBUG, NOTSET]" echo " -r : Remove cached information on build" + echo " -v : Set OCF version of images" + echo " -f : Services directory. (Default $SERVICES_DIR)" + echo " -g : Gitlab base URL. (Default $GITLAB_BASE_URL)" + echo " -b : Build docker images. Default TRUE" echo " -h : show this help" exit 1 } -HOSTNAME=capifcore -MONITORING_STATE=false -DEPLOY=all -LOG_LEVEL=DEBUG -CACHED_INFO="" - -# Needed to avoid write permissions on bind volumes with prometheus and grafana -DUID=$(id -u) -DGID=$(id -g) - -# Mock Server configuration -IP=0.0.0.0 -PORT=9100 - # Get docker compose version docker_version=$(docker compose version --short | cut -d',' -f1) IFS='.' read -ra version_components <<< "$docker_version" @@ -50,10 +35,10 @@ then fi # Read params -while getopts ":c:l:mshr" opt; do +while getopts ":c:l:mshrv:f:g:b:" opt; do case $opt in c) - HOSTNAME="$OPTARG" + CAPIF_HOSTNAME="$OPTARG" ;; m) MONITORING_STATE=true @@ -61,6 +46,18 @@ while getopts ":c:l:mshr" opt; do s) ROBOT_MOCK_SERVER=true ;; + v) + OCF_VERSION="$OPTARG" + ;; + f) + SERVICES_DIR="$OPTARG" + ;; + g) + GITLAB_BASE_URL="$OPTARG" + ;; + b) + BUILD_DOCKER_IMAGES="$OPTARG" + ;; h) help ;; @@ -81,13 +78,20 @@ while getopts ":c:l:mshr" opt; do esac done -echo Nginx hostname will be $HOSTNAME, deploy $DEPLOY, monitoring $MONITORING_STATE +echo Nginx hostname will be $CAPIF_HOSTNAME, deploy $DEPLOY, monitoring $MONITORING_STATE + +if [ "$BUILD_DOCKER_IMAGES" == "false" ] ; then + echo '***Building Docker images set as false***' + NO_BUILD="--no-build" +else + NO_BUILD="" +fi # Deploy Monitoring stack if [ "$MONITORING_STATE" == "true" ] ; then echo '***Monitoring set as true***' echo '***Creating Monitoring stack***' - DUID=$DUID DGID=$DGID docker compose -f "$SERVICES_DIR/monitoring/docker-compose.yml" up --detach --build $CACHED_INFO + DUID=$DUID DGID=$DGID docker compose -f "$SERVICES_DIR/monitoring/docker-compose.yml" up --detach --build $CACHED_INFO $NO_BUILD status=$? if [ $status -eq 0 ]; then @@ -101,7 +105,7 @@ fi docker network create capif-network # Deploy Vault service -CAPIF_HOSTNAME=$HOSTNAME docker compose -f "$SERVICES_DIR/docker-compose-vault.yml" up --detach --build $CACHED_INFO +GITLAB_BASE_URL=$GITLAB_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f "$SERVICES_DIR/docker-compose-vault.yml" up --detach --build $CACHED_INFO $NO_BUILD status=$? if [ $status -eq 0 ]; then @@ -112,7 +116,7 @@ else fi # Deploy Capif services -CAPIF_HOSTNAME=$HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-capif.yml" up --detach --build $CACHED_INFO +GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-capif.yml" up --detach --build $CACHED_INFO $NO_BUILD status=$? if [ $status -eq 0 ]; then @@ -122,17 +126,20 @@ else exit $status fi + +# Path to the register config.yaml file +REGISTER_CONFIG_FILE="$SERVICES_DIR/register/config.yaml" # Backup Original config.yaml file cp $REGISTER_CONFIG_FILE $REGISTER_CONFIG_FILE.bak # Mark the file as assume-unchanged git update-index --assume-unchanged "$REGISTER_CONFIG_FILE" # Edit Register Service URL within ccf in the config.yaml file -yq eval ".ccf.url = \"$HOSTNAME\"" -i "$REGISTER_CONFIG_FILE" +yq eval ".ccf.url = \"$CAPIF_HOSTNAME\"" -i "$REGISTER_CONFIG_FILE" # Deploy Register service -CAPIF_PRIV_KEY_BASE_64=$(echo "$(cat nginx/certs/server.key)") -CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-register.yml" up --detach --build $CACHED_INFO +CAPIF_PRIV_KEY_BASE_64=$(echo "$(cat ${SERVICES_DIR}/nginx/certs/server.key)") +GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-register.yml" up --detach --build $CACHED_INFO $NO_BUILD status=$? if [ $status -eq 0 ]; then @@ -147,12 +154,12 @@ if [ "$ROBOT_MOCK_SERVER" == "true" ] ; then echo '***Robot Mock Server set as true***' echo '***Creating Robot Mock Server stack***' - IP=$IP PORT=$PORT docker compose -f "$SERVICES_DIR/docker-compose-mock-server.yml" up --detach --build $CACHED_INFO + GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION IP=$MOCK_SERVER_IP PORT=$MOCK_SERVER_PORT docker compose -f "$SERVICES_DIR/docker-compose-mock-server.yml" up --detach --build $CACHED_INFO $NO_BUILD status=$? if [ $status -eq 0 ]; then - echo "*** Monitoring Stack Runing ***" + echo "*** Mock Server Runing ***" else - echo "*** Monitoring Stack failed to start ***" + echo "*** Mock Server failed to start ***" exit $status fi fi diff --git a/services/run_capif_tests.sh b/services/run_capif_tests.sh index 65749bf3..c2d65f46 100755 --- a/services/run_capif_tests.sh +++ b/services/run_capif_tests.sh @@ -1,27 +1,5 @@ #!/bin/bash - -DOCKER_ROBOT_IMAGE=labs.etsi.org:5050/ocf/capif/robot-tests-image -DOCKER_ROBOT_IMAGE_VERSION=1.0 -cd .. -REPOSITORY_BASE_FOLDER=${PWD} -TEST_FOLDER=$REPOSITORY_BASE_FOLDER/tests -RESULT_FOLDER=$REPOSITORY_BASE_FOLDER/results -ROBOT_DOCKER_FILE_FOLDER=$REPOSITORY_BASE_FOLDER/tools/robot - -# nginx Hostname and http port (80 by default) to reach for tests -CAPIF_REGISTER=capifcore -CAPIF_REGISTER_PORT=8084 -CAPIF_HOSTNAME=capifcore -CAPIF_HTTP_PORT=8080 -CAPIF_HTTPS_PORT=443 - -# VAULT access configuration -CAPIF_VAULT=vault -CAPIF_VAULT_PORT=8200 -CAPIF_VAULT_TOKEN=dev-only-token - -MOCK_SERVER_URL=http://mock-server:9100 -NOTIFICATION_DESTINATION_URL=http://mock-server:9100 +source $(dirname "$(readlink -f "$0")")/variables.sh PLATFORM=$(uname -m) if [ "x86_64" == "$PLATFORM" ]; then diff --git a/services/run_mock_server.sh b/services/run_mock_server.sh index c7393861..5f62cf5c 100755 --- a/services/run_mock_server.sh +++ b/services/run_mock_server.sh @@ -1,8 +1,5 @@ #!/bin/bash - -# Directories variables setup (no modification needed) -export SERVICES_DIR=$(dirname "$(readlink -f "$0")") -export CAPIF_BASE_DIR=$(dirname "$SERVICES_DIR") +source $(dirname "$(readlink -f "$0")")/variables.sh help() { echo "Usage: $1 " @@ -12,17 +9,17 @@ help() { exit 1 } -IP=0.0.0.0 -PORT=9100 +MOCK_SERVER_IP=0.0.0.0 +MOCK_SERVER_PORT=9100 # Read params while getopts ":i:p:h" opt; do case $opt in i) - IP="$OPTARG" + MOCK_SERVER_IP="$OPTARG" ;; p) - PORT=$OPTARG + MOCK_SERVER_PORT=$OPTARG ;; h) help @@ -38,11 +35,11 @@ while getopts ":i:p:h" opt; do esac done -echo Robot Framework Mock Server will listen on $IP:$PORT +echo Robot Framework Mock Server will listen on $MOCK_SERVER_IP:$MOCK_SERVER_PORT docker network create capif-network || echo "capif-network previously created on docker networks" -IP=$IP PORT=$PORT docker compose -f "$SERVICES_DIR/docker-compose-mock-server.yml" up --detach --build +MOCK_SERVER_IP=$IP MOCK_SERVER_PORT=$PORT docker compose -f "$SERVICES_DIR/docker-compose-mock-server.yml" up --detach --build status=$? if [ $status -eq 0 ]; then diff --git a/services/variables.sh b/services/variables.sh new file mode 100755 index 00000000..ec4cb1e3 --- /dev/null +++ b/services/variables.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# Directories variables setup (no modification needed) +export SERVICES_DIR=$(dirname "$(readlink -f "$0")") +export CAPIF_BASE_DIR=$(dirname "$SERVICES_DIR") +export TEST_FOLDER=$CAPIF_BASE_DIR/tests +export RESULT_FOLDER=$CAPIF_BASE_DIR/results +export ROBOT_DOCKER_FILE_FOLDER=$CAPIF_BASE_DIR/tools/robot + +# Image URL and version +export GITLAB_BASE_URL="labs.etsi.org:5050/ocf/capif/staging" +export OCF_VERSION="v2.x.x-release" + +# Capif hostname +export CAPIF_HOSTNAME=capifcore +export CAPIF_HTTP_PORT=8080 +export CAPIF_HTTPS_PORT=443 + +# Register hostname and port +export CAPIF_REGISTER=capifcore +export CAPIF_REGISTER_PORT=8084 + +# VAULT access configuration +export CAPIF_VAULT=vault +export CAPIF_VAULT_PORT=8200 +export CAPIF_VAULT_TOKEN=dev-only-token + +# Build and Deployment variables +export MONITORING_STATE=false +export DEPLOY=all +export LOG_LEVEL=DEBUG +export CACHED_INFO="" +export BUILD_DOCKER_IMAGES=true + +# Needed to avoid write permissions on bind volumes with prometheus and grafana +export DUID=$(id -u) +export DGID=$(id -g) + +# Mock Server configuration +export MOCK_SERVER_IP=0.0.0.0 +export MOCK_SERVER_PORT=9100 + +# Robot tests variables +export DOCKER_ROBOT_IMAGE=labs.etsi.org:5050/ocf/capif/robot-tests-image +export DOCKER_ROBOT_IMAGE_VERSION=1.0 + +# Mock server variables +export MOCK_SERVER_URL=http://mock-server:${MOCK_SERVER_PORT} +export NOTIFICATION_DESTINATION_URL=http://mock-server:${MOCK_SERVER_PORT} + -- GitLab From 2152e0c19a03073864e873edd57d60264ad4b1e3 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Fri, 14 Feb 2025 12:21:16 +0100 Subject: [PATCH 016/157] Minor adjustments on local scripts --- services/docker-compose-capif.yml | 20 ++++++++++---------- services/docker-compose-mock-server.yml | 2 +- services/docker-compose-vault.yml | 2 ++ services/run.sh | 20 ++++++++++---------- services/variables.sh | 6 +++--- services/vault/vault_prepare_certs.sh | 10 +++++----- 6 files changed, 31 insertions(+), 29 deletions(-) mode change 100644 => 100755 services/vault/vault_prepare_certs.sh diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index 95aaa325..a24c33b2 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -53,7 +53,7 @@ services: - MONITORING=${MONITORING} - LOG_LEVEL=${LOG_LEVEL} restart: unless-stopped - image: ${GITLAB_BASE_URL}/access-control-policy:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/ocf-access-control-policy-api:${OCF_VERSION} depends_on: - redis - nginx @@ -79,7 +79,7 @@ services: - VAULT_PORT=8200 - LOG_LEVEL=${LOG_LEVEL} restart: unless-stopped - image: ${GITLAB_BASE_URL}/api-invoker-management-api:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/ocf-api-invoker-management-api:${OCF_VERSION} depends_on: - redis - nginx @@ -96,7 +96,7 @@ services: - fluent-bit:host-gateway - otel-collector:host-gateway - vault:host-gateway - image: ${GITLAB_BASE_URL}/api-provider-management-api:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/ocf-api-provider-management-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-provider-management @@ -121,7 +121,7 @@ services: - fluent-bit:host-gateway - otel-collector:host-gateway restart: unless-stopped - image: ${GITLAB_BASE_URL}/auditing-api:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/ocf-auditing-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-auditing @@ -142,7 +142,7 @@ services: - host.docker.internal:host-gateway - fluent-bit:host-gateway - otel-collector:host-gateway - image: ${GITLAB_BASE_URL}/discover-service-api:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/ocf-discover-service-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=services-apis @@ -158,7 +158,7 @@ services: - "8080" volumes: - ${SERVICES_DIR}/TS29222_CAPIF_Events_API:/usr/src/app - image: ${GITLAB_BASE_URL}/events-api:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/ocf-events-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-events @@ -181,7 +181,7 @@ services: volumes: - ${SERVICES_DIR}/TS29222_CAPIF_Logging_API_Invocation_API:/usr/src/app restart: unless-stopped - image: ${GITLAB_BASE_URL}/api-invocation-logs-api:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/ocf-logging-api-invocation-api:${OCF_VERSION} extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -202,7 +202,7 @@ services: volumes: - ${SERVICES_DIR}/TS29222_CAPIF_Publish_Service_API:/usr/src/app restart: unless-stopped - image: ${GITLAB_BASE_URL}/publish-service-api:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/ocf-publish-service-api:${OCF_VERSION} extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -221,7 +221,7 @@ services: context: ${SERVICES_DIR}/TS29222_CAPIF_Routing_Info_API expose: - "8080" - image: ${GITLAB_BASE_URL}/routing-info-api:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/ocf-routing-info-api:${OCF_VERSION} capif-security: build: @@ -231,7 +231,7 @@ services: volumes: - ${SERVICES_DIR}/TS29222_CAPIF_Security_API:/usr/src/app restart: unless-stopped - image: ${GITLAB_BASE_URL}/security-api:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/ocf-security-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-security diff --git a/services/docker-compose-mock-server.yml b/services/docker-compose-mock-server.yml index f26c8765..2bcbf64c 100644 --- a/services/docker-compose-mock-server.yml +++ b/services/docker-compose-mock-server.yml @@ -11,7 +11,7 @@ services: environment: - DEBUG_MODE=True restart: unless-stopped - image: ${GITLAB_BASE_URL}/mock_server:${OCF_VERSION} + image: ${GITLAB_BASE_URL}/mock-server:${OCF_VERSION} networks: default: diff --git a/services/docker-compose-vault.yml b/services/docker-compose-vault.yml index 5b2bbed4..b142be41 100644 --- a/services/docker-compose-vault.yml +++ b/services/docker-compose-vault.yml @@ -1,5 +1,6 @@ services: vault: + image: ${GITLAB_BASE_URL}/vault:${OCF_VERSION} build: context: ${SERVICES_DIR}/vault restart: unless-stopped @@ -14,3 +15,4 @@ services: volumes: - ${SERVICES_DIR}/vault/data:/vault/data - ${SERVICES_DIR}/vault/config:/vault/config + - ${SERVICES_DIR}/vault/vault_prepare_certs.sh:/vault_prepare_certs.sh diff --git a/services/run.sh b/services/run.sh index 8dbb5fd3..3cf05a9e 100755 --- a/services/run.sh +++ b/services/run.sh @@ -80,18 +80,19 @@ done echo Nginx hostname will be $CAPIF_HOSTNAME, deploy $DEPLOY, monitoring $MONITORING_STATE -if [ "$BUILD_DOCKER_IMAGES" == "false" ] ; then - echo '***Building Docker images set as false***' - NO_BUILD="--no-build" +if [ "$BUILD_DOCKER_IMAGES" == "true" ] ; then + echo '***Building Docker images set as true***' + BUILD="--build" else - NO_BUILD="" + echo '***Building Docker images set as false***' + BUILD="--no-build" fi # Deploy Monitoring stack if [ "$MONITORING_STATE" == "true" ] ; then echo '***Monitoring set as true***' echo '***Creating Monitoring stack***' - DUID=$DUID DGID=$DGID docker compose -f "$SERVICES_DIR/monitoring/docker-compose.yml" up --detach --build $CACHED_INFO $NO_BUILD + DUID=$DUID DGID=$DGID docker compose -f "$SERVICES_DIR/monitoring/docker-compose.yml" up --detach $BUILD $CACHED_INFO status=$? if [ $status -eq 0 ]; then @@ -105,7 +106,7 @@ fi docker network create capif-network # Deploy Vault service -GITLAB_BASE_URL=$GITLAB_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f "$SERVICES_DIR/docker-compose-vault.yml" up --detach --build $CACHED_INFO $NO_BUILD +GITLAB_BASE_URL=$GITLAB_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f "$SERVICES_DIR/docker-compose-vault.yml" up --detach $BUILD $CACHED_INFO status=$? if [ $status -eq 0 ]; then @@ -116,7 +117,7 @@ else fi # Deploy Capif services -GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-capif.yml" up --detach --build $CACHED_INFO $NO_BUILD +GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-capif.yml" up --detach $BUILD $CACHED_INFO status=$? if [ $status -eq 0 ]; then @@ -126,7 +127,6 @@ else exit $status fi - # Path to the register config.yaml file REGISTER_CONFIG_FILE="$SERVICES_DIR/register/config.yaml" # Backup Original config.yaml file @@ -139,7 +139,7 @@ yq eval ".ccf.url = \"$CAPIF_HOSTNAME\"" -i "$REGISTER_CONFIG_FILE" # Deploy Register service CAPIF_PRIV_KEY_BASE_64=$(echo "$(cat ${SERVICES_DIR}/nginx/certs/server.key)") -GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-register.yml" up --detach --build $CACHED_INFO $NO_BUILD +GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-register.yml" up --detach $BUILD $CACHED_INFO status=$? if [ $status -eq 0 ]; then @@ -154,7 +154,7 @@ if [ "$ROBOT_MOCK_SERVER" == "true" ] ; then echo '***Robot Mock Server set as true***' echo '***Creating Robot Mock Server stack***' - GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION IP=$MOCK_SERVER_IP PORT=$MOCK_SERVER_PORT docker compose -f "$SERVICES_DIR/docker-compose-mock-server.yml" up --detach --build $CACHED_INFO $NO_BUILD + GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION IP=$MOCK_SERVER_IP PORT=$MOCK_SERVER_PORT docker compose -f "$SERVICES_DIR/docker-compose-mock-server.yml" up --detach $BUILD $CACHED_INFO status=$? if [ $status -eq 0 ]; then echo "*** Mock Server Runing ***" diff --git a/services/variables.sh b/services/variables.sh index ec4cb1e3..617a48db 100755 --- a/services/variables.sh +++ b/services/variables.sh @@ -8,8 +8,8 @@ export RESULT_FOLDER=$CAPIF_BASE_DIR/results export ROBOT_DOCKER_FILE_FOLDER=$CAPIF_BASE_DIR/tools/robot # Image URL and version -export GITLAB_BASE_URL="labs.etsi.org:5050/ocf/capif/staging" -export OCF_VERSION="v2.x.x-release" +export GITLAB_BASE_URL="labs.etsi.org:5050/ocf/capif/prod" +export OCF_VERSION="v2.0.0-release" # Capif hostname export CAPIF_HOSTNAME=capifcore @@ -30,7 +30,7 @@ export MONITORING_STATE=false export DEPLOY=all export LOG_LEVEL=DEBUG export CACHED_INFO="" -export BUILD_DOCKER_IMAGES=true +export BUILD_DOCKER_IMAGES=false # Needed to avoid write permissions on bind volumes with prometheus and grafana export DUID=$(id -u) diff --git a/services/vault/vault_prepare_certs.sh b/services/vault/vault_prepare_certs.sh old mode 100644 new mode 100755 index b209ecfe..160e7497 --- a/services/vault/vault_prepare_certs.sh +++ b/services/vault/vault_prepare_certs.sh @@ -3,9 +3,9 @@ # Setup environment variables for Vault export VAULT_ADDR="http://$VAULT_DEV_LISTEN_ADDRESS" export VAULT_TOKEN=$VAULT_DEV_ROOT_TOKEN_ID -HOSTNAME="$CAPIF_HOSTNAME" +CAPIF_HOSTNAME="${CAPIF_HOSTNAME:-capifcore}" -echo "CAPIF_HOSTNAME: $HOSTNAME" +echo "CAPIF_HOSTNAME: $CAPIF_HOSTNAME" echo "VAULT_ADDR: $VAULT_ADDR" echo "VAULT_TOKEN: $VAULT_TOKEN" @@ -44,7 +44,7 @@ vault write -format=json pki/root/sign-intermediate \ vault write pki_int/intermediate/set-signed certificate=@capif_intermediate.cert.pem # Configure the role for the intermediate CA -vault write pki_int/roles/my-ca use_csr_common_name=false require_cn=true use_csr_sans=false allowed_domains=$HOSTNAME allow_any_name=true allow_bare_domains=true allow_glob_domains=true allow_subdomains=true max_ttl=4300h ttl=4300h +vault write pki_int/roles/my-ca use_csr_common_name=false require_cn=true use_csr_sans=false allowed_domains=$CAPIF_HOSTNAME allow_any_name=true allow_bare_domains=true allow_glob_domains=true allow_subdomains=true max_ttl=4300h ttl=4300h # Generate a certificate openssl genrsa -out ./server.key 2048 @@ -55,7 +55,7 @@ STATE="Madrid" # state or province name LOCALITY="Madrid" # Locality Name (e.g. city) ORGNAME="Telefonica I+D" # Organization Name (eg, company) ORGUNIT="Innovation" # Organizational Unit Name (eg. section) -COMMONNAME="$HOSTNAME" +COMMONNAME="$CAPIF_HOSTNAME" EMAIL="inno@tid.es" # certificate's email address # optional extra details CHALLENGE="" # challenge password @@ -77,7 +77,7 @@ $COMPANY __EOF__ -vault write -format=json pki_int/sign/my-ca format=pem_bundle ttl="43000h" csr=@server.csr common_name="$HOSTNAME" | jq -r '.data.issuing_ca as $issuing_ca | .data.certificate as $certificate | [$issuing_ca, $certificate]' > cert_data.json +vault write -format=json pki_int/sign/my-ca format=pem_bundle ttl="43000h" csr=@server.csr common_name="$CAPIF_HOSTNAME" | jq -r '.data.issuing_ca as $issuing_ca | .data.certificate as $certificate | [$issuing_ca, $certificate]' > cert_data.json jq -r '.[0]' cert_data.json > root_ca.crt.pem jq -r '.[1]' cert_data.json > server_certificate.crt.pem -- GitLab From 74e79b92095cd39d8c2c877696f8283ebf67394b Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 17 Feb 2025 12:35:56 +0100 Subject: [PATCH 017/157] New retries on prepare scripts --- .../prepare_invoker.sh | 41 ++++-- .../prepare_provider.sh | 40 ++++-- .../prepare_security.sh | 40 ++++-- services/clean_capif_docker_services.sh | 21 ++- services/nginx/nginx_prepare.sh | 136 ++++++++++++++---- 5 files changed, 218 insertions(+), 60 deletions(-) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh b/services/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh index 971ce337..0e2accbb 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh @@ -1,18 +1,39 @@ #!/bin/bash - VAULT_ADDR="http://$VAULT_HOSTNAME:$VAULT_PORT" VAULT_TOKEN=$VAULT_ACCESS_TOKEN -curl -vv -k -retry 30 \ - --retry-all-errors \ - --connect-timeout 5 \ - --max-time 10 \ - --retry-delay 10 \ - --retry-max-time 300 \ - --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/server_cert/pub" 2>/dev/null | jq -r '.data.data.pub_key' -j > /usr/src/app/api_invoker_management/pubkey.pem +# Maximum number of retry attempts +MAX_RETRIES=30 +# Delay between retries (in seconds) +RETRY_DELAY=10 +# Attempt counter +ATTEMPT=0 + +while [ $ATTEMPT -lt $MAX_RETRIES ]; do + # Increment ATTEMPT using eval + eval "ATTEMPT=\$((ATTEMPT + 1))" + echo "Attempt $ATTEMPT of $MAX_RETRIES" + # Make the request to Vault and store the response in a variable + RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ + --header "X-Vault-Token: $VAULT_TOKEN" \ + --request GET "$VAULT_ADDR/v1/secret/data/server_cert/pub" | jq -r '.data.data.pub_key') -gunicorn -k uvicorn.workers.UvicornH11Worker --bind 0.0.0.0:8080 \ + echo "$RESPONSE" + + # Check if the response is "null" or empty + if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then + echo "$RESPONSE" > /usr/src/app/api_invoker_management/pubkey.pem + echo "Public key successfully saved." + gunicorn -k uvicorn.workers.UvicornH11Worker --bind 0.0.0.0:8080 \ --chdir /usr/src/app/api_invoker_management wsgi:app + exit 0 # Exit successfully + else + echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." + sleep $RETRY_DELAY + fi +done + +echo "Error: Failed to retrieve a valid response after $MAX_RETRIES attempts." +exit 1 # Exit with failure diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh b/services/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh index 27cd6183..edefb582 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh +++ b/services/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh @@ -3,15 +3,37 @@ VAULT_ADDR="http://$VAULT_HOSTNAME:$VAULT_PORT" VAULT_TOKEN=$VAULT_ACCESS_TOKEN -curl -vv -k -retry 30 \ - --retry-all-errors \ - --connect-timeout 5 \ - --max-time 10 \ - --retry-delay 10 \ - --retry-max-time 300 \ - --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/server_cert/pub" 2>/dev/null | jq -r '.data.data.pub_key' -j > /usr/src/app/api_provider_management/pubkey.pem +# Maximum number of retry attempts +MAX_RETRIES=30 +# Delay between retries (in seconds) +RETRY_DELAY=10 +# Attempt counter +ATTEMPT=0 -gunicorn -k uvicorn.workers.UvicornH11Worker --bind 0.0.0.0:8080 \ +while [ $ATTEMPT -lt $MAX_RETRIES ]; do + # Increment ATTEMPT using eval + eval "ATTEMPT=\$((ATTEMPT + 1))" + echo "Attempt $ATTEMPT of $MAX_RETRIES" + + # Make the request to Vault and store the response in a variable + RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ + --header "X-Vault-Token: $VAULT_TOKEN" \ + --request GET "$VAULT_ADDR/v1/secret/data/server_cert/pub" | jq -r '.data.data.pub_key') + + echo "$RESPONSE" + + # Check if the response is "null" or empty + if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then + echo "$RESPONSE" > /usr/src/app/api_provider_management/pubkey.pem + echo "Public key successfully saved." + gunicorn -k uvicorn.workers.UvicornH11Worker --bind 0.0.0.0:8080 \ --chdir /usr/src/app/api_provider_management wsgi:app + exit 0 # Exit successfully + else + echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." + sleep $RETRY_DELAY + fi +done +echo "Error: Failed to retrieve a valid response after $MAX_RETRIES attempts." +exit 1 # Exit with failure diff --git a/services/TS29222_CAPIF_Security_API/prepare_security.sh b/services/TS29222_CAPIF_Security_API/prepare_security.sh index 86f10f24..3bfb1558 100644 --- a/services/TS29222_CAPIF_Security_API/prepare_security.sh +++ b/services/TS29222_CAPIF_Security_API/prepare_security.sh @@ -3,17 +3,37 @@ VAULT_ADDR="http://$VAULT_HOSTNAME:$VAULT_PORT" VAULT_TOKEN=$VAULT_ACCESS_TOKEN +# Maximum number of retry attempts +MAX_RETRIES=30 +# Delay between retries (in seconds) +RETRY_DELAY=10 +# Attempt counter +ATTEMPT=0 +while [ $ATTEMPT -lt $MAX_RETRIES ]; do + # Increment ATTEMPT using eval + eval "ATTEMPT=\$((ATTEMPT + 1))" + echo "Attempt $ATTEMPT of $MAX_RETRIES" -curl -k -retry 30 \ - --retry-all-errors \ - --connect-timeout 5 \ - --max-time 10 \ - --retry-delay 10 \ - --retry-max-time 300 \ - --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/server_cert/private" 2>/dev/null | jq -r '.data.data.key' -j > /usr/src/app/capif_security/server.key + # Make the request to Vault and store the response in a variable + RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ + --header "X-Vault-Token: $VAULT_TOKEN" \ + --request GET "$VAULT_ADDR/v1/secret/data/server_cert/private" | jq -r '.data.data.key') + echo "$RESPONSE" -gunicorn -k uvicorn.workers.UvicornH11Worker --bind 0.0.0.0:8080 \ - --chdir /usr/src/app/capif_security wsgi:app \ No newline at end of file + # Check if the response is "null" or empty + if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then + echo "$RESPONSE" > /usr/src/app/capif_security/server.key + echo "Public key successfully saved." + gunicorn -k uvicorn.workers.UvicornH11Worker --bind 0.0.0.0:8080 \ + --chdir /usr/src/app/capif_security wsgi:app + exit 0 # Exit successfully + else + echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." + sleep $RETRY_DELAY + fi +done + +echo "Error: Failed to retrieve a valid response after $MAX_RETRIES attempts." +exit 1 # Exit with failure diff --git a/services/clean_capif_docker_services.sh b/services/clean_capif_docker_services.sh index 3525377f..5922fb14 100755 --- a/services/clean_capif_docker_services.sh +++ b/services/clean_capif_docker_services.sh @@ -9,6 +9,7 @@ help() { echo " -m : Clean monitoring service" echo " -s : Clean Robot Mock service" echo " -a : Clean all services" + echo " -z : Clean images generated by docker-compose. Boolean. Default true" echo " -h : show this help" exit 1 } @@ -22,8 +23,10 @@ fi FILES=() echo "${FILES[@]}" +REMOVE_IMAGES=false + # Read params -while getopts "cvrahmsf:" opt; do +while getopts "cvrahmsz:" opt; do case $opt in c) echo "Remove Capif services" @@ -49,6 +52,10 @@ while getopts "cvrahmsf:" opt; do echo "Remove all services" FILES=("$SERVICES_DIR/docker-compose-capif.yml" "$SERVICES_DIR/docker-compose-vault.yml" "$SERVICES_DIR/docker-compose-register.yml" "$SERVICES_DIR/docker-compose-mock-server.yml" "$SERVICES_DIR//monitoring/docker-compose.yml") ;; + z) + echo "Remove images generated by docker-compose" + REMOVE_IMAGES=$OPTARG + ;; h) help ;; @@ -67,9 +74,19 @@ done echo "after check" echo "${FILES[@]}" +echo "Remove images set to $REMOVE_IMAGES" +if [ $REMOVE_IMAGES == "true" ] ; then + echo "Removing images generated by docker-compose" + REMOVE_IMAGES="--rmi all" +else + echo "Not removing images generated by docker-compose" + REMOVE_IMAGES="" +fi + + for FILE in "${FILES[@]}"; do echo "Executing 'docker compose down' for file $FILE" - GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 DUID=$DUID DGID=$DGID MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$FILE" down --rmi all + GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 DUID=$DUID DGID=$DGID MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$FILE" down $REMOVE_IMAGES status=$? if [ $status -eq 0 ]; then echo "*** Removed Service from $FILE ***" diff --git a/services/nginx/nginx_prepare.sh b/services/nginx/nginx_prepare.sh index 75fc9fd5..91884863 100644 --- a/services/nginx/nginx_prepare.sh +++ b/services/nginx/nginx_prepare.sh @@ -5,34 +5,112 @@ cd $CERTS_FOLDER VAULT_ADDR="http://$VAULT_HOSTNAME:$VAULT_PORT" VAULT_TOKEN=$VAULT_ACCESS_TOKEN -curl -k -retry 30 \ - --retry-all-errors \ - --connect-timeout 5 \ - --max-time 10 \ - --retry-delay 10 \ - --retry-max-time 300 \ - --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/ca" 2>/dev/null | jq -r '.data.data.ca' -j > $CERTS_FOLDER/ca.crt - -openssl verify -CAfile $CERTS_FOLDER/ca.crt $CERTS_FOLDER/ca.crt - -curl -k -retry 30 \ - --retry-all-errors \ - --connect-timeout 5 \ - --max-time 10 \ - --retry-delay 10 \ - --retry-max-time 300 \ - --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/server_cert" 2>/dev/null | jq -r '.data.data.cert' -j > $CERTS_FOLDER/server.crt - -curl -k -retry 30 \ - --retry-all-errors \ - --connect-timeout 5 \ - --max-time 10 \ - --retry-delay 10 \ - --retry-max-time 300 \ - --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/server_cert/private" 2>/dev/null | jq -r '.data.data.key' -j > $CERTS_FOLDER/server.key +# Maximum number of retry attempts +MAX_RETRIES=30 +# Delay between retries (in seconds) +RETRY_DELAY=10 +# Attempt counter +ATTEMPT=0 +# Success check +SUCCES_OPERATION=false + +while [ $ATTEMPT -lt $MAX_RETRIES ]; do + # Increment ATTEMPT using eval + eval "ATTEMPT=\$((ATTEMPT + 1))" + echo "Attempt $ATTEMPT of $MAX_RETRIES" + + # Make the request to Vault and store the response in a variable + RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ + --header "X-Vault-Token: $VAULT_TOKEN" \ + --request GET "$VAULT_ADDR/v1/secret/data/ca" | jq -r '.data.data.ca') + + echo "$RESPONSE" + + # Check if the response is "null" or empty + if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then + echo "$RESPONSE" > $CERTS_FOLDER/ca.crt + openssl verify -CAfile $CERTS_FOLDER/ca.crt $CERTS_FOLDER/ca.crt + echo "CA Root successfully saved." + SUCCES_OPERATION=true + break + else + echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." + sleep $RETRY_DELAY + fi +done + +if [ "$SUCCES_OPERATION" = false ]; then + echo "Error: Failed to retrieve a valid response after $MAX_RETRIES attempts." + exit 1 # Exit with failure +fi + +# Setup inital value to ATTEMPT and SUCCESS_OPERATION +ATTEMPT=0 +SUCCES_OPERATION=false + +while [ $ATTEMPT -lt $MAX_RETRIES ]; do + # Increment ATTEMPT using eval + eval "ATTEMPT=\$((ATTEMPT + 1))" + echo "Attempt $ATTEMPT of $MAX_RETRIES" + + # Make the request to Vault and store the response in a variable + RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ + --header "X-Vault-Token: $VAULT_TOKEN" \ + --request GET "$VAULT_ADDR/v1/secret/data/server_cert" | jq -r '.data.data.cert') + + echo "$RESPONSE" + + # Check if the response is "null" or empty + if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then + echo "$RESPONSE" > $CERTS_FOLDER/server.crt + echo "Server Certificate successfully saved." + ATTEMPT=0 + SUCCES_OPERATION=true + break + else + echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." + sleep $RETRY_DELAY + fi +done + +if [ "$SUCCES_OPERATION" = false ]; then + echo "Error: Failed to retrieve a valid response after $MAX_RETRIES attempts." + exit 1 # Exit with failure +fi + +# Setup inital value to ATTEMPT and SUCCESS_OPERATION +ATTEMPT=0 +SUCCES_OPERATION=false + +while [ $ATTEMPT -lt $MAX_RETRIES ]; do + # Increment ATTEMPT using eval + eval "ATTEMPT=\$((ATTEMPT + 1))" + echo "Attempt $ATTEMPT of $MAX_RETRIES" + + # Make the request to Vault and store the response in a variable + RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ + --header "X-Vault-Token: $VAULT_TOKEN" \ + --request GET "$VAULT_ADDR/v1/secret/data/server_cert/private" | jq -r '.data.data.key') + + echo "$RESPONSE" + + # Check if the response is "null" or empty + if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then + echo "$RESPONSE" > $CERTS_FOLDER/server.key + echo "Server Key successfully saved." + ATTEMPT=0 + SUCCES_OPERATION=true + break + else + echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." + sleep $RETRY_DELAY + fi +done + +if [ "$SUCCES_OPERATION" = false ]; then + echo "Error: Failed to retrieve a valid response after $MAX_RETRIES attempts." + exit 1 # Exit with failure +fi LOG_LEVEL=$(echo "${LOG_LEVEL}" | tr '[:upper:]' '[:lower:]') @@ -50,4 +128,4 @@ esac envsubst '$LOG_LEVEL' < /etc/nginx/nginx.conf > /etc/nginx/nginx.conf.tmp mv /etc/nginx/nginx.conf.tmp /etc/nginx/nginx.conf -nginx \ No newline at end of file +nginx -- GitLab From 72fdab4fcd3df9b35a1e59eb0f40dec7b3854538 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 17 Feb 2025 15:32:37 +0100 Subject: [PATCH 018/157] Change of local variables of REGISTRY URL --- services/check_services_are_running.sh | 12 ++++++------ services/clean_capif_docker_services.sh | 2 +- services/docker-compose-capif.yml | 24 ++++++++++++------------ services/docker-compose-mock-server.yml | 2 +- services/docker-compose-register.yml | 2 +- services/docker-compose-vault.yml | 2 +- services/run.sh | 12 ++++++------ services/variables.sh | 2 +- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/services/check_services_are_running.sh b/services/check_services_are_running.sh index 4e174bab..a278793b 100755 --- a/services/check_services_are_running.sh +++ b/services/check_services_are_running.sh @@ -4,8 +4,8 @@ source $(dirname "$(readlink -f "$0")")/variables.sh export CAPIF_PRIV_KEY= export CAPIF_PRIV_KEY_BASE_64= -running="$(GITLAB_BASE_URL=$GITLAB_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f docker-compose-vault.yml ps --services --all --filter "status=running")" -services="$(GITLAB_BASE_URL=$GITLAB_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f docker-compose-vault.yml ps --services --all)" +running="$(REGISTRY_BASE_URL=$REGISTRY_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f docker-compose-vault.yml ps --services --all --filter "status=running")" +services="$(REGISTRY_BASE_URL=$REGISTRY_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f docker-compose-vault.yml ps --services --all)" if [ "$running" != "$services" ]; then echo "Following Vault services are not running:" # Bash specific @@ -15,8 +15,8 @@ else echo "All Vault services are running" fi -running="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all --filter "status=running")" -services="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all)" +running="$(REGISTRY_BASE_URL=$REGISTRY_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all --filter "status=running")" +services="$(REGISTRY_BASE_URL=$REGISTRY_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all)" if [ "$running" != "$services" ]; then echo "Following CCF services are not running:" # Bash specific @@ -26,8 +26,8 @@ else echo "All CCF services are running" fi -running="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all --filter "status=running")" -services="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all)" +running="$(REGISTRY_BASE_URL=$REGISTRY_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all --filter "status=running")" +services="$(REGISTRY_BASE_URL=$REGISTRY_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all)" if [ "$running" != "$services" ]; then echo "Following Register services are not running:" # Bash specific diff --git a/services/clean_capif_docker_services.sh b/services/clean_capif_docker_services.sh index 5922fb14..17bbb369 100755 --- a/services/clean_capif_docker_services.sh +++ b/services/clean_capif_docker_services.sh @@ -86,7 +86,7 @@ fi for FILE in "${FILES[@]}"; do echo "Executing 'docker compose down' for file $FILE" - GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 DUID=$DUID DGID=$DGID MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$FILE" down $REMOVE_IMAGES + REGISTRY_BASE_URL=$REGISTRY_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 DUID=$DUID DGID=$DGID MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$FILE" down $REMOVE_IMAGES status=$? if [ $status -eq 0 ]; then echo "*** Removed Service from $FILE ***" diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index a24c33b2..0f9d7da0 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -32,7 +32,7 @@ services: - VAULT_ACCESS_TOKEN=dev-only-token - VAULT_PORT=8200 - LOG_LEVEL=${LOG_LEVEL} - image: ${GITLAB_BASE_URL}/helper:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/helper:${OCF_VERSION} depends_on: - nginx @@ -53,7 +53,7 @@ services: - MONITORING=${MONITORING} - LOG_LEVEL=${LOG_LEVEL} restart: unless-stopped - image: ${GITLAB_BASE_URL}/ocf-access-control-policy-api:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/ocf-access-control-policy-api:${OCF_VERSION} depends_on: - redis - nginx @@ -79,7 +79,7 @@ services: - VAULT_PORT=8200 - LOG_LEVEL=${LOG_LEVEL} restart: unless-stopped - image: ${GITLAB_BASE_URL}/ocf-api-invoker-management-api:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/ocf-api-invoker-management-api:${OCF_VERSION} depends_on: - redis - nginx @@ -96,7 +96,7 @@ services: - fluent-bit:host-gateway - otel-collector:host-gateway - vault:host-gateway - image: ${GITLAB_BASE_URL}/ocf-api-provider-management-api:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/ocf-api-provider-management-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-provider-management @@ -121,7 +121,7 @@ services: - fluent-bit:host-gateway - otel-collector:host-gateway restart: unless-stopped - image: ${GITLAB_BASE_URL}/ocf-auditing-api:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/ocf-auditing-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-auditing @@ -142,7 +142,7 @@ services: - host.docker.internal:host-gateway - fluent-bit:host-gateway - otel-collector:host-gateway - image: ${GITLAB_BASE_URL}/ocf-discover-service-api:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/ocf-discover-service-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=services-apis @@ -158,7 +158,7 @@ services: - "8080" volumes: - ${SERVICES_DIR}/TS29222_CAPIF_Events_API:/usr/src/app - image: ${GITLAB_BASE_URL}/ocf-events-api:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/ocf-events-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-events @@ -181,7 +181,7 @@ services: volumes: - ${SERVICES_DIR}/TS29222_CAPIF_Logging_API_Invocation_API:/usr/src/app restart: unless-stopped - image: ${GITLAB_BASE_URL}/ocf-logging-api-invocation-api:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/ocf-logging-api-invocation-api:${OCF_VERSION} extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -202,7 +202,7 @@ services: volumes: - ${SERVICES_DIR}/TS29222_CAPIF_Publish_Service_API:/usr/src/app restart: unless-stopped - image: ${GITLAB_BASE_URL}/ocf-publish-service-api:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/ocf-publish-service-api:${OCF_VERSION} extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -221,7 +221,7 @@ services: context: ${SERVICES_DIR}/TS29222_CAPIF_Routing_Info_API expose: - "8080" - image: ${GITLAB_BASE_URL}/ocf-routing-info-api:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/ocf-routing-info-api:${OCF_VERSION} capif-security: build: @@ -231,7 +231,7 @@ services: volumes: - ${SERVICES_DIR}/TS29222_CAPIF_Security_API:/usr/src/app restart: unless-stopped - image: ${GITLAB_BASE_URL}/ocf-security-api:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/ocf-security-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - CONTAINER_NAME=api-security @@ -282,7 +282,7 @@ services: ports: - "8080:8080" - "443:443" - image: ${GITLAB_BASE_URL}/nginx:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/nginx:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - VAULT_HOSTNAME=vault diff --git a/services/docker-compose-mock-server.yml b/services/docker-compose-mock-server.yml index 2bcbf64c..851f9f28 100644 --- a/services/docker-compose-mock-server.yml +++ b/services/docker-compose-mock-server.yml @@ -11,7 +11,7 @@ services: environment: - DEBUG_MODE=True restart: unless-stopped - image: ${GITLAB_BASE_URL}/mock-server:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/mock-server:${OCF_VERSION} networks: default: diff --git a/services/docker-compose-register.yml b/services/docker-compose-register.yml index 0fd96777..f5572a26 100644 --- a/services/docker-compose-register.yml +++ b/services/docker-compose-register.yml @@ -18,7 +18,7 @@ services: - host.docker.internal:host-gateway - vault:host-gateway restart: unless-stopped - image: ${GITLAB_BASE_URL}/register:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/register:${OCF_VERSION} depends_on: - mongo_register diff --git a/services/docker-compose-vault.yml b/services/docker-compose-vault.yml index b142be41..f1439122 100644 --- a/services/docker-compose-vault.yml +++ b/services/docker-compose-vault.yml @@ -1,6 +1,6 @@ services: vault: - image: ${GITLAB_BASE_URL}/vault:${OCF_VERSION} + image: ${REGISTRY_BASE_URL}/vault:${OCF_VERSION} build: context: ${SERVICES_DIR}/vault restart: unless-stopped diff --git a/services/run.sh b/services/run.sh index 3cf05a9e..fbd0750d 100755 --- a/services/run.sh +++ b/services/run.sh @@ -10,7 +10,7 @@ help() { echo " -r : Remove cached information on build" echo " -v : Set OCF version of images" echo " -f : Services directory. (Default $SERVICES_DIR)" - echo " -g : Gitlab base URL. (Default $GITLAB_BASE_URL)" + echo " -g : Gitlab base URL. (Default $REGISTRY_BASE_URL)" echo " -b : Build docker images. Default TRUE" echo " -h : show this help" exit 1 @@ -53,7 +53,7 @@ while getopts ":c:l:mshrv:f:g:b:" opt; do SERVICES_DIR="$OPTARG" ;; g) - GITLAB_BASE_URL="$OPTARG" + REGISTRY_BASE_URL="$OPTARG" ;; b) BUILD_DOCKER_IMAGES="$OPTARG" @@ -106,7 +106,7 @@ fi docker network create capif-network # Deploy Vault service -GITLAB_BASE_URL=$GITLAB_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f "$SERVICES_DIR/docker-compose-vault.yml" up --detach $BUILD $CACHED_INFO +REGISTRY_BASE_URL=$REGISTRY_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f "$SERVICES_DIR/docker-compose-vault.yml" up --detach $BUILD $CACHED_INFO status=$? if [ $status -eq 0 ]; then @@ -117,7 +117,7 @@ else fi # Deploy Capif services -GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-capif.yml" up --detach $BUILD $CACHED_INFO +REGISTRY_BASE_URL=$REGISTRY_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-capif.yml" up --detach $BUILD $CACHED_INFO status=$? if [ $status -eq 0 ]; then @@ -139,7 +139,7 @@ yq eval ".ccf.url = \"$CAPIF_HOSTNAME\"" -i "$REGISTER_CONFIG_FILE" # Deploy Register service CAPIF_PRIV_KEY_BASE_64=$(echo "$(cat ${SERVICES_DIR}/nginx/certs/server.key)") -GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-register.yml" up --detach $BUILD $CACHED_INFO +REGISTRY_BASE_URL=$REGISTRY_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-register.yml" up --detach $BUILD $CACHED_INFO status=$? if [ $status -eq 0 ]; then @@ -154,7 +154,7 @@ if [ "$ROBOT_MOCK_SERVER" == "true" ] ; then echo '***Robot Mock Server set as true***' echo '***Creating Robot Mock Server stack***' - GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION IP=$MOCK_SERVER_IP PORT=$MOCK_SERVER_PORT docker compose -f "$SERVICES_DIR/docker-compose-mock-server.yml" up --detach $BUILD $CACHED_INFO + REGISTRY_BASE_URL=$REGISTRY_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION IP=$MOCK_SERVER_IP PORT=$MOCK_SERVER_PORT docker compose -f "$SERVICES_DIR/docker-compose-mock-server.yml" up --detach $BUILD $CACHED_INFO status=$? if [ $status -eq 0 ]; then echo "*** Mock Server Runing ***" diff --git a/services/variables.sh b/services/variables.sh index 617a48db..101c8718 100755 --- a/services/variables.sh +++ b/services/variables.sh @@ -8,7 +8,7 @@ export RESULT_FOLDER=$CAPIF_BASE_DIR/results export ROBOT_DOCKER_FILE_FOLDER=$CAPIF_BASE_DIR/tools/robot # Image URL and version -export GITLAB_BASE_URL="labs.etsi.org:5050/ocf/capif/prod" +export REGISTRY_BASE_URL="labs.etsi.org:5050/ocf/capif/prod" export OCF_VERSION="v2.0.0-release" # Capif hostname -- GitLab From cc06bc10f8a332c2fddbce1639f906c99082b48b Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 18 Feb 2025 09:25:58 +0100 Subject: [PATCH 019/157] New variable for local testing --- services/create_users.sh | 2 +- services/remove_users.sh | 2 +- services/run_capif_tests.sh | 2 +- services/variables.sh | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/create_users.sh b/services/create_users.sh index 4bcc8cb3..b88bb7f7 100755 --- a/services/create_users.sh +++ b/services/create_users.sh @@ -108,7 +108,7 @@ fi mkdir -p $RESULT_FOLDER -docker run -ti --rm --network="host" \ +docker run $DOCKER_ROBOT_TTY_OPTIONS --rm --network="host" \ --add-host host.docker.internal:host-gateway \ --add-host vault:host-gateway \ --add-host register:host-gateway \ diff --git a/services/remove_users.sh b/services/remove_users.sh index 4b90988b..e499fa99 100755 --- a/services/remove_users.sh +++ b/services/remove_users.sh @@ -85,7 +85,7 @@ fi mkdir -p $RESULT_FOLDER -docker run -ti --rm --network="host" \ +docker run $DOCKER_ROBOT_TTY_OPTIONS --rm --network="host" \ --add-host host.docker.internal:host-gateway \ --add-host vault:host-gateway \ --add-host register:host-gateway \ diff --git a/services/run_capif_tests.sh b/services/run_capif_tests.sh index c2d65f46..65c9a45f 100755 --- a/services/run_capif_tests.sh +++ b/services/run_capif_tests.sh @@ -50,7 +50,7 @@ fi mkdir -p $RESULT_FOLDER -docker run -ti --rm --network="host" \ +docker run $DOCKER_ROBOT_TTY_OPTIONS --rm --network="host" \ --add-host host.docker.internal:host-gateway \ --add-host vault:host-gateway \ --add-host register:host-gateway \ diff --git a/services/variables.sh b/services/variables.sh index 101c8718..2c913909 100755 --- a/services/variables.sh +++ b/services/variables.sh @@ -43,6 +43,7 @@ export MOCK_SERVER_PORT=9100 # Robot tests variables export DOCKER_ROBOT_IMAGE=labs.etsi.org:5050/ocf/capif/robot-tests-image export DOCKER_ROBOT_IMAGE_VERSION=1.0 +export DOCKER_ROBOT_TTY_OPTIONS="-ti" # Mock server variables export MOCK_SERVER_URL=http://mock-server:${MOCK_SERVER_PORT} -- GitLab From ec32f3c5a39436f925c6e31cbacfb0f69cfac662 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Tue, 18 Feb 2025 10:37:13 +0100 Subject: [PATCH 020/157] Integrated configuration para ACL sizes --- .../capif_acl/core/internal_service_ops.py | 25 ++++++++-- services/helper/config.yaml | 10 ++-- .../controllers/helper_controller.py | 29 +++++++++++ .../helper_service/core/helper_operations.py | 48 +++++++++++++++++++ 4 files changed, 105 insertions(+), 7 deletions(-) diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py index 520f35c1..db159726 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py @@ -21,6 +21,23 @@ class InternalServiceOps(Resource): mycol = self.db.get_col_by_name(self.db.acls) + # 🚨 Nueva Lógica: Recuperar configuración desde capifConfiguration en MongoDB + config_col = self.db.get_col_by_name("capifConfiguration") + capif_config = config_col.find_one({"config_name": "default"}) + + if capif_config: + settings = capif_config.get("settings", {}).get("acl_policy_settings", {}) + allowed_total_invocations = settings.get("allowedTotalInvocations", 100) + allowed_invocations_per_second = settings.get("allowedInvocationsPerSecond", 10) + time_range_days = settings.get("allowedInvocationTimeRangeDays", 365) + else: + current_app.logger.error("CAPIF Configuration not found, applying all values to 0.") + allowed_total_invocations = 0 + allowed_invocations_per_second = 0 + time_range_days = 0 + + + res = mycol.find_one( {"service_id": service_id, "aef_id": aef_id}, {"_id": 0}) @@ -28,9 +45,9 @@ class InternalServiceOps(Resource): current_app.logger.info( f"Adding invoker ACL for invoker {invoker_id}") range_list = [TimeRangeList( - datetime.utcnow(), datetime.utcnow()+timedelta(days=365))] + datetime.utcnow(), datetime.utcnow()+timedelta(days=time_range_days))] invoker_acl = ApiInvokerPolicy( - invoker_id, current_app.config["invocations"]["total"], current_app.config["invocations"]["perSecond"], range_list) + invoker_id, allowed_total_invocations, allowed_invocations_per_second, range_list) r = mycol.find_one({"service_id": service_id, "aef_id": aef_id, "api_invoker_policies.api_invoker_id": invoker_id}, {"_id": 0}) if r is None: @@ -40,9 +57,9 @@ class InternalServiceOps(Resource): current_app.logger.info( f"Creating service ACLs for service: {service_id}") range_list = [TimeRangeList( - datetime.utcnow(), datetime.utcnow()+timedelta(days=365))] + datetime.utcnow(), datetime.utcnow()+timedelta(days=time_range_days))] invoker_acl = ApiInvokerPolicy( - invoker_id, current_app.config["invocations"]["total"], current_app.config["invocations"]["perSecond"], range_list) + invoker_id, allowed_total_invocations, allowed_invocations_per_second, range_list) service_acls = { "service_id": service_id, diff --git a/services/helper/config.yaml b/services/helper/config.yaml index d4cb1f40..94c01773 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -25,11 +25,15 @@ capifConfiguration: { description: "Default CAPIF Configuration", settings: { certify_expiration_period: 30, - acls_size_configuration: 24, security_method_priority: { - psk: 1, + oauth: 1, pki: 2, - oauth: 3 + psk: 3 + }, + acl_policy_settings: { + allowedTotalInvocations: 5, + allowedInvocationsPerSecond: 10, + allowedInvocationTimeRangeDays: 365 } } } diff --git a/services/helper/helper_service/controllers/helper_controller.py b/services/helper/helper_service/controllers/helper_controller.py index 03d276b7..f2ba5f4a 100644 --- a/services/helper/helper_service/controllers/helper_controller.py +++ b/services/helper/helper_service/controllers/helper_controller.py @@ -113,3 +113,32 @@ def getEvents(): @helper_routes.route("/helper/deleteEntities/", methods=["DELETE"]) def deleteUserEntities(uuid): return helper_operation.remove_entities(uuid) + + +@helper_routes.route("/helper/getConfiguration", methods=["GET"]) +def getConfiguration(): + """Devuelve toda la configuración actual""" + return helper_operation.get_configuration() + + +@helper_routes.route("/helper/updateConfigParam", methods=["PATCH"]) +def updateConfigParam(): + """Actualiza un único parámetro de la configuración""" + data = request.json + param_path = data.get("param_path") # Ej. "settings.acl_policy_settings.allowedTotalInvocations" + new_value = data.get("new_value") + + if not param_path or new_value is None: + return jsonify(message="Missing 'param_path' or 'new_value' in request body"), 400 + + return helper_operation.update_config_param(param_path, new_value) + + +@helper_routes.route("/helper/replaceConfiguration", methods=["PUT"]) +def replaceConfiguration(): + """Reemplaza toda la configuración con una nueva""" + new_config = request.json + if not new_config: + return jsonify(message="Missing new configuration in request body"), 400 + + return helper_operation.replace_configuration(new_config) diff --git a/services/helper/helper_service/core/helper_operations.py b/services/helper/helper_service/core/helper_operations.py index d8a49c01..87dd366f 100644 --- a/services/helper/helper_service/core/helper_operations.py +++ b/services/helper/helper_service/core/helper_operations.py @@ -201,6 +201,54 @@ class HelperOperations: current_app.logger.debug(f"User entities removed successfully") return jsonify(message="User entities removed successfully"), 200 + def get_configuration(self): + """Recupera toda la configuración actual""" + current_app.logger.debug("Retrieving current CAPIF configuration") + config_col = self.db.get_col_by_name(self.db.capifConfiguration) + config = config_col.find_one({"config_name": "default"}, {"_id": 0}) + + if not config: + return jsonify(message="No CAPIF configuration found"), 404 + + return jsonify(config), 200 + + + def update_config_param(self, param_path, new_value): + """ + Actualiza un único parámetro en la configuración. + param_path: Ruta del parámetro (ej. settings.acl_policy_settings.allowedTotalInvocations) + """ + current_app.logger.debug(f"Updating configuration parameter: {param_path} with value: {new_value}") + + config_col = self.db.get_col_by_name(self.db.capifConfiguration) + + # Construir el query dinámico para actualizar un parámetro específico + update_query = {"$set": {param_path: new_value}} + + result = config_col.update_one({"config_name": "default"}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 + + return jsonify(message=f"Parameter '{param_path}' updated successfully"), 200 + def replace_configuration(self, new_config): + """ + Reemplaza toda la configuración actual con una nueva. + """ + current_app.logger.debug("Replacing entire CAPIF configuration") + + config_col = self.db.get_col_by_name(self.db.capifConfiguration) + + # Reemplazar la configuración existente con la nueva + result = config_col.replace_one({"config_name": "default"}, new_config, upsert=True) + + if result.matched_count == 0: + return jsonify(message="No existing configuration found; a new one was created"), 201 + + return jsonify(message="Configuration replaced successfully"), 200 + + + -- GitLab From 41177b112a413a242e77397e237d03ed7bb8f2c6 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 19 Feb 2025 09:59:42 +0100 Subject: [PATCH 021/157] minor fix create and remove users --- services/create_users.sh | 2 ++ services/remove_users.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/services/create_users.sh b/services/create_users.sh index b88bb7f7..c740deb8 100755 --- a/services/create_users.sh +++ b/services/create_users.sh @@ -113,6 +113,8 @@ docker run $DOCKER_ROBOT_TTY_OPTIONS --rm --network="host" \ --add-host vault:host-gateway \ --add-host register:host-gateway \ --add-host mock-server:host-gateway \ + --add-host $CAPIF_HOSTNAME:host-gateway \ + --add-host $CAPIF_REGISTER:host-gateway \ -v $TEST_FOLDER:/opt/robot-tests/tests \ -v $RESULT_FOLDER:/opt/robot-tests/results ${DOCKER_ROBOT_IMAGE}:${DOCKER_ROBOT_IMAGE_VERSION} \ --variable CAPIF_HOSTNAME:$CAPIF_HOSTNAME \ diff --git a/services/remove_users.sh b/services/remove_users.sh index e499fa99..01cceb4f 100755 --- a/services/remove_users.sh +++ b/services/remove_users.sh @@ -90,6 +90,8 @@ docker run $DOCKER_ROBOT_TTY_OPTIONS --rm --network="host" \ --add-host vault:host-gateway \ --add-host register:host-gateway \ --add-host mock-server:host-gateway \ + --add-host $CAPIF_HOSTNAME:host-gateway \ + --add-host $CAPIF_REGISTER:host-gateway \ -v $TEST_FOLDER:/opt/robot-tests/tests \ -v $RESULT_FOLDER:/opt/robot-tests/results ${DOCKER_ROBOT_IMAGE}:${DOCKER_ROBOT_IMAGE_VERSION} \ --variable CAPIF_HOSTNAME:$CAPIF_HOSTNAME \ -- GitLab From f3e63c1ec88075f6cbb9eabc2429803fafc1ea03 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 19 Feb 2025 10:43:31 +0100 Subject: [PATCH 022/157] Docker compose of capif and register will be only mount volumes with configuration files --- services/docker-compose-capif.yml | 26 +++++++++++++++----------- services/docker-compose-register.yml | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index 0f9d7da0..8ed11c38 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -19,7 +19,7 @@ services: container_name: helper restart: unless-stopped volumes: - - ${SERVICES_DIR}/helper:/usr/src/app + - ${SERVICES_DIR}/helper/config.yaml:/usr/src/app/config.yaml extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -41,8 +41,8 @@ services: context: ${SERVICES_DIR}/TS29222_CAPIF_Access_Control_Policy_API expose: - "8080" - volumes: - - ${SERVICES_DIR}/TS29222_CAPIF_Access_Control_Policy_API:/usr/src/app + # volumes: + # - ${SERVICES_DIR}/TS29222_CAPIF_Access_Control_Policy_API:/usr/src/app extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -64,7 +64,8 @@ services: expose: - "8080" volumes: - - ${SERVICES_DIR}/TS29222_CAPIF_API_Invoker_Management_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_API_Invoker_Management_API/config.yaml:/usr/src/app/config.yaml + - ${SERVICES_DIR}/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh:/usr/src/app/prepare_invoker.sh extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -90,7 +91,8 @@ services: expose: - "8080" volumes: - - ${SERVICES_DIR}/TS29222_CAPIF_API_Provider_Management_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_API_Provider_Management_API/config.yaml:/usr/src/app/config.yaml + - ${SERVICES_DIR}/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh:/usr/src/app/prepare_provider.sh extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -115,7 +117,7 @@ services: expose: - "8080" volumes: - - ${SERVICES_DIR}/TS29222_CAPIF_Auditing_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Auditing_API/config.yaml:/usr/src/app/config.yaml extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -136,7 +138,7 @@ services: expose: - "8080" volumes: - - ${SERVICES_DIR}/TS29222_CAPIF_Discover_Service_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Discover_Service_API/config.yaml:/usr/src/app/config.yaml restart: unless-stopped extra_hosts: - host.docker.internal:host-gateway @@ -157,7 +159,7 @@ services: expose: - "8080" volumes: - - ${SERVICES_DIR}/TS29222_CAPIF_Events_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Events_API/config.yaml:/usr/src/app/config.yaml image: ${REGISTRY_BASE_URL}/ocf-events-api:${OCF_VERSION} environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} @@ -179,7 +181,7 @@ services: expose: - "8080" volumes: - - ${SERVICES_DIR}/TS29222_CAPIF_Logging_API_Invocation_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Logging_API_Invocation_API/config.yaml:/usr/src/app/config.yaml restart: unless-stopped image: ${REGISTRY_BASE_URL}/ocf-logging-api-invocation-api:${OCF_VERSION} extra_hosts: @@ -200,7 +202,7 @@ services: expose: - "8080" volumes: - - ${SERVICES_DIR}/TS29222_CAPIF_Publish_Service_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Publish_Service_API/config.yaml:/usr/src/app/config.yaml restart: unless-stopped image: ${REGISTRY_BASE_URL}/ocf-publish-service-api:${OCF_VERSION} extra_hosts: @@ -229,7 +231,8 @@ services: expose: - "8080" volumes: - - ${SERVICES_DIR}/TS29222_CAPIF_Security_API:/usr/src/app + - ${SERVICES_DIR}/TS29222_CAPIF_Security_API/config.yaml:/usr/src/app/config.yaml + - ${SERVICES_DIR}/TS29222_CAPIF_Security_API/prepare_security.sh:/usr/src/app/prepare_security.sh restart: unless-stopped image: ${REGISTRY_BASE_URL}/ocf-security-api:${OCF_VERSION} environment: @@ -292,6 +295,7 @@ services: hostname: ${CAPIF_HOSTNAME} volumes: - ${SERVICES_DIR}/nginx/certs:/etc/nginx/certs + - ${SERVICES_DIR}/nginx/nginx_prepare.sh:/nginx_prepare.sh extra_hosts: - host.docker.internal:host-gateway - vault:host-gateway diff --git a/services/docker-compose-register.yml b/services/docker-compose-register.yml index f5572a26..02599a32 100644 --- a/services/docker-compose-register.yml +++ b/services/docker-compose-register.yml @@ -5,7 +5,7 @@ services: ports: - 8084:8080 volumes: - - ${SERVICES_DIR}/register:/usr/src/app + - ${SERVICES_DIR}/register/config.yaml:/usr/src/app/config.yaml environment: - CAPIF_PRIV_KEY=${CAPIF_PRIV_KEY} - VAULT_HOSTNAME=vault -- GitLab From 0726eec631a9500b3e3162faf330453fa6390465 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 19 Feb 2025 10:58:03 +0100 Subject: [PATCH 023/157] Set default values on variables.sh under services folder --- services/variables.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/variables.sh b/services/variables.sh index 2c913909..04143940 100755 --- a/services/variables.sh +++ b/services/variables.sh @@ -17,7 +17,7 @@ export CAPIF_HTTP_PORT=8080 export CAPIF_HTTPS_PORT=443 # Register hostname and port -export CAPIF_REGISTER=capifcore +export CAPIF_REGISTER=register export CAPIF_REGISTER_PORT=8084 # VAULT access configuration @@ -30,7 +30,7 @@ export MONITORING_STATE=false export DEPLOY=all export LOG_LEVEL=DEBUG export CACHED_INFO="" -export BUILD_DOCKER_IMAGES=false +export BUILD_DOCKER_IMAGES=true # Needed to avoid write permissions on bind volumes with prometheus and grafana export DUID=$(id -u) -- GitLab From 90e93a35b4f9d8fd7da06000312d4080080a7641 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 19 Feb 2025 12:26:25 +0100 Subject: [PATCH 024/157] Setting default values --- services/clean_capif_docker_services.sh | 4 +--- services/variables.sh | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/services/clean_capif_docker_services.sh b/services/clean_capif_docker_services.sh index 17bbb369..171bc55f 100755 --- a/services/clean_capif_docker_services.sh +++ b/services/clean_capif_docker_services.sh @@ -9,7 +9,7 @@ help() { echo " -m : Clean monitoring service" echo " -s : Clean Robot Mock service" echo " -a : Clean all services" - echo " -z : Clean images generated by docker-compose. Boolean. Default true" + echo " -z : Clean images generated by docker-compose. Boolean. Default false" echo " -h : show this help" exit 1 } @@ -23,8 +23,6 @@ fi FILES=() echo "${FILES[@]}" -REMOVE_IMAGES=false - # Read params while getopts "cvrahmsz:" opt; do case $opt in diff --git a/services/variables.sh b/services/variables.sh index 04143940..748c8c0a 100755 --- a/services/variables.sh +++ b/services/variables.sh @@ -31,6 +31,7 @@ export DEPLOY=all export LOG_LEVEL=DEBUG export CACHED_INFO="" export BUILD_DOCKER_IMAGES=true +export REMOVE_IMAGES=false # Needed to avoid write permissions on bind volumes with prometheus and grafana export DUID=$(id -u) -- GitLab From 0317811c5885a1695decf6c27c4b1f8b9e409e35 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 24 Feb 2025 11:40:43 +0100 Subject: [PATCH 025/157] Setup new url for mongo, mongo-express and redis images --- services/docker-compose-capif.yml | 6 +++--- services/docker-compose-register.yml | 4 ++-- tools/base_images_scripts/push_base_images_ocf.sh | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index 8ed11c38..6b5a504c 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -1,6 +1,6 @@ services: redis: - image: "redis:alpine" + image: "labs.etsi.org:5050/ocf/capif/redis:7.4.2-alpine" command: redis-server ports: - "6379:6379" @@ -254,7 +254,7 @@ services: - nginx mongo: - image: mongo:6.0.2 + image: labs.etsi.org:5050/ocf/capif/mongo:6.0.2 logging: driver: 'none' restart: unless-stopped @@ -263,7 +263,7 @@ services: MONGO_INITDB_ROOT_PASSWORD: example mongo-express: - image: mongo-express:1.0.0-alpha.4 + image: labs.etsi.org:5050/ocf/capif/mongo-express:1.0.0-alpha.4 logging: driver: 'none' restart: unless-stopped diff --git a/services/docker-compose-register.yml b/services/docker-compose-register.yml index 02599a32..4abed673 100644 --- a/services/docker-compose-register.yml +++ b/services/docker-compose-register.yml @@ -23,7 +23,7 @@ services: - mongo_register mongo_register: - image: mongo:6.0.2 + image: labs.etsi.org:5050/ocf/capif/mongo:6.0.2 logging: driver: 'none' restart: unless-stopped @@ -32,7 +32,7 @@ services: MONGO_INITDB_ROOT_PASSWORD: example mongo_register_express: - image: mongo-express:1.0.0-alpha.4 + image: labs.etsi.org:5050/ocf/capif/mongo-express:1.0.0-alpha.4 logging: driver: 'none' restart: unless-stopped diff --git a/tools/base_images_scripts/push_base_images_ocf.sh b/tools/base_images_scripts/push_base_images_ocf.sh index 0407dae6..2a9d472e 100755 --- a/tools/base_images_scripts/push_base_images_ocf.sh +++ b/tools/base_images_scripts/push_base_images_ocf.sh @@ -7,8 +7,10 @@ PLATFORMS=("linux/arm64" BASIC_IMAGES=("python:3-slim-bullseye" "nginx:1.27.1" "vault:1.13.2" -"ubuntu:20.04") - +"ubuntu:20.04" +"redis:7.4.2-alpine" +"mongo-express:1.0.0-alpha.4" +"mongo:6.0.2") docker login labs.etsi.org:5050 for basic_image in "${BASIC_IMAGES[@]}"; do -- GitLab From a97ab9abfaf0d3d218d0e22b8810afea3847bb25 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 24 Feb 2025 12:21:41 +0100 Subject: [PATCH 026/157] Check architecture script uploaded --- services/check_architecture.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 services/check_architecture.sh diff --git a/services/check_architecture.sh b/services/check_architecture.sh new file mode 100755 index 00000000..0301b9b9 --- /dev/null +++ b/services/check_architecture.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +IMAGES=$(docker images|grep -v "REPOSITORY"|awk '{ print $1 ":" $2 }') + +for i in $IMAGES; do + Architecture=$(docker inspect $i|grep Architecture|awk '{ print $2 }') + + echo "Image $i with architecture $Architecture" +done -- GitLab From f99991eceb29a16297deff15b707d47f03e2031e Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 24 Feb 2025 13:44:48 +0100 Subject: [PATCH 027/157] add some log to check architecture --- services/check_architecture.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/check_architecture.sh b/services/check_architecture.sh index 0301b9b9..62cf2e35 100755 --- a/services/check_architecture.sh +++ b/services/check_architecture.sh @@ -1,5 +1,7 @@ #!/bin/bash +echo "Checking all images architecture" + IMAGES=$(docker images|grep -v "REPOSITORY"|awk '{ print $1 ":" $2 }') for i in $IMAGES; do -- GitLab From 8ff735480f6b20619804e7a6f425b95282cda15d Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 24 Feb 2025 18:35:53 +0100 Subject: [PATCH 028/157] New Event Filter test suite --- tests/features/Event Filter/__init__.robot | 2 + .../features/Event Filter/event_filter.robot | 248 ++++++++++++++++++ tests/libraries/api_events/bodyRequests.py | 25 +- tests/resources/common.resource | 6 +- 4 files changed, 272 insertions(+), 9 deletions(-) create mode 100644 tests/features/Event Filter/__init__.robot create mode 100644 tests/features/Event Filter/event_filter.robot diff --git a/tests/features/Event Filter/__init__.robot b/tests/features/Event Filter/__init__.robot new file mode 100644 index 00000000..2b28f206 --- /dev/null +++ b/tests/features/Event Filter/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Force Tags event_filter \ No newline at end of file diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot new file mode 100644 index 00000000..19fb636b --- /dev/null +++ b/tests/features/Event Filter/event_filter.robot @@ -0,0 +1,248 @@ +*** Settings *** +Resource /opt/robot-tests/tests/resources/common.resource +Library /opt/robot-tests/tests/libraries/bodyRequests.py +Library XML +Library String +Resource /opt/robot-tests/tests/resources/common/basicRequests.robot +Resource ../../resources/common.resource +Resource ../../resources/common/basicRequests.robot + +Suite Teardown Reset Testing Environment +Test Setup Reset Testing Environment +Test Teardown Reset Testing Environment + + +*** Variables *** +${API_INVOKER_NOT_REGISTERED} not-valid +${SUBSCRIBER_ID_NOT_VALID} not-valid +${SUBSCRIPTION_ID_NOT_VALID} not-valid + + +*** Test Cases *** +Service API Available filtered by apiIds + [Tags] event_filter-1 mockserver + + # Initialize Mock server + Init Mock Server + + # Default Invoker Registration and Onboarding + ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding + + # Register APF + ${register_user_info_provider}= Provider Default Registration total_aef_roles=2 + + ${aef_id_1}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} + ${aef_id_2}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} + ${aef_empty_list}= Create List + + # Publish api with 2 aefIds + ${service_api_description_published} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + ... aef_id=${aef_ids} + ... api_status=${aef_empty_list} + ... supported_features=020 + + # Register other provider + ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_NEW + + ${aef2_id_1}= Set Variable ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} + + # Publish api with other provider + ${service_api_description_published_2} ${resource_url_2} ${request_body_2}= Publish Service Api + ... ${register_user_info_provider_2} + ... service_2 + ... aef_id=${aef2_id_1} + ... api_status=${aef2_id_1} + ... supported_features=020 + + # Discover APIs by invoker + ${resp}= Get Request Capif + ... ${DISCOVER_URL}${register_user_info_invoker['api_invoker_id']}&aef-id=${aef_id_1} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + Check Response Variable Type And Values ${resp} 200 DiscoveredAPIs + + # # Check Results + Dictionary Should Contain Key ${resp.json()} serviceAPIDescriptions + Should Not Be Empty ${resp.json()['serviceAPIDescriptions']} + Length Should Be ${resp.json()['serviceAPIDescriptions']} 1 + List Should Contain Value ${resp.json()['serviceAPIDescriptions']} ${service_api_description_published} + + ${api_id}= Set Variable ${resp.json()['serviceAPIDescriptions'][0]['apiId']} + + # Subscribe to events + ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE SERVICE_API_UPDATE + ${event_filter}= Create Capif Event Filter apiIds=${api_id} + ${event_filters}= Create List ${event_filter} ${event_filter} ${event_filter} + + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + # Check Results + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + + # Update Request to published API + ${service_api_description_modified}= Create Service Api Description + ... service_1 + ... aef_id=${aef_ids} + ... supported_features=20 + ... api_status=${aef_ids} + ${resp}= Put Request Capif + ... ${resource_url.path} + ... json=${service_api_description_modified} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${APF_PROVIDER_USERNAME} + + Check Response Variable Type And Values ${resp} 200 ServiceAPIDescription + ... apiName=service_1 + Dictionary Should Contain Key ${resp.json()} apiStatus + + # Provider Remove service_1 published API + ${resp}= Delete Request Capif + ... ${resource_url.path} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${APF_PROVIDER_USERNAME} + + Status Should Be 204 ${resp} + + # Provider 2 Remove service_1 published API + ${resp}= Delete Request Capif + ... ${resource_url_2.path} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${APF_PROVIDER_USERNAME}_NEW + + Status Should Be 204 ${resp} + + # Check Event Notifications + ## Create check Events to ensure all notifications were received + ${service_api_available_resources}= Create List ${resource_url} + ${events_expected}= Create Expected Events For Service API Notifications + ... subscription_id=${subscription_id} + ... service_api_available_resources=${service_api_available_resources} + ... event_detail_expected=${TRUE} + ... service_api_description_expected=${TRUE} + ... service_api_description=${service_api_description_modified} + Log List ${events_expected} + + ${events_expected}= Create Expected Service Update Event + ... subscription_id=${subscription_id} + ... service_api_resource=${resource_url} + ... service_api_descriptions=${service_api_description_modified} + ... events_expected=${events_expected} + Log List ${events_expected} + + ${service_api_unavailable_resources}= Create List ${resource_url} + ${events_expected}= Create Expected Events For Service API Notifications + ... subscription_id=${subscription_id} + ... service_api_unavailable_resources=${service_api_unavailable_resources} + ... event_detail_expected=${TRUE} + ... service_api_description_expected=${TRUE} + ... service_api_description=${service_api_description_modified} + ... events_expected=${events_expected} + Log List ${events_expected} + + ## Check Events Expected towards received notifications at mock server + Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} + + +Try error + [Tags] event_filter-2 mockserver + + # Initialize Mock server + Init Mock Server + + # Default Invoker Registration and Onboarding + ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding + + # Register APF + ${register_user_info_provider}= Provider Default Registration total_aef_roles=2 + + ${aef_id_1}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} + ${aef_id_2}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} + ${aef_empty_list}= Create List + + # Publish api with 2 aefIds + ${service_api_description_published} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + ... aef_id=${aef_ids} + ... api_status=${aef_empty_list} + ... supported_features=020 + + # Register other provider + ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_NEW + + ${aef2_id_1}= Set Variable ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} + + # Publish api with other provider + ${service_api_description_published_2} ${resource_url_2} ${request_body_2}= Publish Service Api + ... ${register_user_info_provider_2} + ... service_2 + ... aef_id=${aef2_id_1} + ... api_status=${aef2_id_1} + ... supported_features=020 + + # Discover APIs by invoker + ${resp}= Get Request Capif + ... ${DISCOVER_URL}${register_user_info_invoker['api_invoker_id']}&aef-id=${aef_id_1} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + Check Response Variable Type And Values ${resp} 200 DiscoveredAPIs + + # # Check Results + Dictionary Should Contain Key ${resp.json()} serviceAPIDescriptions + Should Not Be Empty ${resp.json()['serviceAPIDescriptions']} + Length Should Be ${resp.json()['serviceAPIDescriptions']} 1 + List Should Contain Value ${resp.json()['serviceAPIDescriptions']} ${service_api_description_published} + + ${api_id}= Set Variable ${resp.json()['serviceAPIDescriptions'][0]['apiId']} + + # Subscribe to events + ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE SERVICE_API_UPDATE + ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} + ${event_filters}= Create List ${event_filter} ${event_filter} ${event_filter} + + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + # Check Results + ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event SERVICE_API_AVAILABLE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event SERVICE_API_AVAILABLE + ... invalidParams=${invalid_param_list} diff --git a/tests/libraries/api_events/bodyRequests.py b/tests/libraries/api_events/bodyRequests.py index 20d82a40..1bb4604f 100644 --- a/tests/libraries/api_events/bodyRequests.py +++ b/tests/libraries/api_events/bodyRequests.py @@ -18,15 +18,24 @@ def create_events_subscription(events=["SERVICE_API_AVAILABLE", "API_INVOKER_ONB def create_capif_event_filter(aefIds=None, apiIds=None, apiInvokerIds=None): - if aefIds == None and apiIds == None and apiInvokerIds: - raise ("Error, no data present to create event filter") + # if aefIds == None and apiIds == None and apiInvokerIds: + # raise ("Error, no data present to create event filter") capif_event_filter = dict() - if aefIds != None: - capif_event_filter['aefIds'] = aefIds - if apiIds != None: - capif_event_filter['apiIds'] = apiIds - if apiInvokerIds != None: - capif_event_filter['apiInvokerIds'] = apiInvokerIds + if aefIds is not None: + if isinstance(aefIds, list): + capif_event_filter['aefIds'] = aefIds + else: + capif_event_filter['aefIds'] = [aefIds] + if apiIds is not None: + if isinstance(apiIds, list): + capif_event_filter['apiIds'] = apiIds + else: + capif_event_filter['apiIds'] = [apiIds] + if apiInvokerIds is not None: + if isinstance(apiInvokerIds, list): + capif_event_filter['apiInvokerIds'] = apiInvokerIds + else: + capif_event_filter['apiInvokerIds'] = [apiInvokerIds] return capif_event_filter diff --git a/tests/resources/common.resource b/tests/resources/common.resource index bf596b33..96b09429 100644 --- a/tests/resources/common.resource +++ b/tests/resources/common.resource @@ -84,7 +84,11 @@ Check Response Variable Type And Values Check Variable ${resp.json()} ${variable_type} FOR ${input} IN @{input_parameters} Log ${input}=${input_parameters['${input}']} - Should Match Regexp "${resp.json()['${input}']}" "${input_parameters['${input}']}" + IF "${input}"=="invalidParams" + Should Be Equal ${resp.json()['${input}']} ${input_parameters['${input}']} + ELSE + Should Match Regexp "${resp.json()['${input}']}" "${input_parameters['${input}']}" + END END Remove Keys From Object -- GitLab From 34bc690acdf17aaec95a4a28e0848353630e16a0 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Thu, 27 Feb 2025 17:37:02 +0100 Subject: [PATCH 029/157] Fix events including filter properly in eventfilter array --- tests/features/CAPIF Api Events/capif_events_api.robot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index 9f8b4e23..06599fcf 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -167,7 +167,7 @@ Invoker receives Service API Invocation events ${events_list}= Create List SERVICE_API_INVOCATION_SUCCESS SERVICE_API_INVOCATION_FAILURE ${aef_ids}= Create List ${register_user_info['aef_id']} ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} - ${event_filters}= Create List ${event_filter} + ${event_filters}= Create List ${event_filter} ${event_filter} ${request_body}= Create Events Subscription ... events=@{events_list} @@ -240,7 +240,7 @@ Invoker subscribe to Service API Available and Unavailable events ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE ${aef_ids}= Create List ${register_user_info_provider['aef_id']} ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} - ${event_filters}= Create List ${event_filter} + ${event_filters}= Create List ${event_filter} ${event_filter} ${request_body}= Create Events Subscription ... events=@{events_list} @@ -712,7 +712,7 @@ Invoker receives Service API Invocation events without Enhanced Event Report ${events_list}= Create List SERVICE_API_INVOCATION_SUCCESS SERVICE_API_INVOCATION_FAILURE ${aef_ids}= Create List ${register_user_info['aef_id']} ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} - ${event_filters}= Create List ${event_filter} + ${event_filters}= Create List ${event_filter} ${event_filter} ${request_body}= Create Events Subscription ... events=@{events_list} @@ -786,7 +786,7 @@ Invoker subscribe to Service API Available and Unavailable events without Enhanc ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE ${aef_ids}= Create List ${register_user_info_provider['aef_id']} ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} - ${event_filters}= Create List ${event_filter} + ${event_filters}= Create List ${event_filter} ${event_filter} ${request_body}= Create Events Subscription ... events=@{events_list} -- GitLab From 685dc89943fd3035ac349c18b4857000f25a90e7 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Fri, 28 Feb 2025 13:06:06 +0100 Subject: [PATCH 030/157] Fix enhanced Event report flag --- .../capif_events/core/events_apis.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index e5348759..b2a0b716 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -87,11 +87,20 @@ class EventSubscriptionsOperations(Resource): return result - if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"] and event_subscription.event_filters: - current_app.logger.debug(event_subscription.event_filters) - result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) - if isinstance(result, Response): - return result + if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"]: + if event_subscription.event_filters: + current_app.logger.debug(event_subscription.event_filters) + result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) + if isinstance(result, Response): + return result + else: + if event_subscription.event_filters: + current_app.logger.error("Event filters provided but EnhancedEventReport is not enabled") + return bad_request_error( + detail="Bad Param", + cause="Event filters provided but EnhancedEventReport is not enabled", + invalid_params=[{"param": "eventFilters", "reason": "EnhancedEventReport is not enabled"}] + ) # Generate subscriptionID subscription_id = secrets.token_hex(15) -- GitLab From 17f94cdee3a4f52fae76d4a58d0ed96b281c72ec Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Fri, 28 Feb 2025 13:13:08 +0100 Subject: [PATCH 031/157] doc line --- .../TS29222_CAPIF_Events_API/capif_events/core/events_apis.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index b2a0b716..d6b0bdf2 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -87,6 +87,8 @@ class EventSubscriptionsOperations(Resource): return result + # Check if EnhancedEventReport is enabled and validate event filters + if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"]: if event_subscription.event_filters: current_app.logger.debug(event_subscription.event_filters) -- GitLab From 942ba13cd48507dd98a4f03cc83f47a8c7811cc3 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 3 Mar 2025 09:17:11 +0100 Subject: [PATCH 032/157] Set fixed version at docker-compose monitoring file --- services/monitoring/docker-compose.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/monitoring/docker-compose.yml b/services/monitoring/docker-compose.yml index e71dff52..3a83d239 100644 --- a/services/monitoring/docker-compose.yml +++ b/services/monitoring/docker-compose.yml @@ -32,7 +32,7 @@ services: - /var/run/docker.sock:/var/run/docker.sock:rw grafana: - image: grafana/grafana + image: grafana/grafana:11.5.2 user: "${DUID}:${DGID}" environment: - GF_SECURITY_ADMIN_PASSWORD=secure_pass @@ -68,7 +68,7 @@ services: # grafana image renderer renderer: - image: grafana/grafana-image-renderer:latest + image: grafana/grafana-image-renderer:3.12.1 container_name: grafana-image-renderer expose: - "8081" @@ -77,7 +77,7 @@ services: # fluent-bit send logs to loki fluent-bit: - image: grafana/fluent-bit-plugin-loki:latest + image: grafana/fluent-bit-plugin-loki:3.1.2 container_name: fluent-bit environment: - LOKI_URL=http://loki:3100/loki/api/v1/push @@ -89,7 +89,7 @@ services: # opentelemetry collector otel-collector: - image: otel/opentelemetry-collector:latest + image: otel/opentelemetry-collector:0.120.0 ports: - 55680:55680 - 4317:4317 @@ -99,7 +99,7 @@ services: # tempo is a distributed tracing backend tempo: - image: grafana/tempo:latest + image: grafana/tempo:r190-70f6095 command: [ "-config.file=/etc/tempo.yaml" ] volumes: - ./tempo/tempo.yaml:/etc/tempo.yaml -- GitLab From e11502a81a5b8f02b5cc6f5b93303362036198a8 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Mon, 3 Mar 2025 10:42:51 +0100 Subject: [PATCH 033/157] remove filter in capif_api_events-14, 15, 16 --- tests/features/CAPIF Api Events/capif_events_api.robot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index 69071ab5..1368e0cf 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -717,7 +717,7 @@ Invoker receives Service API Invocation events without Enhanced Event Report ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... event_filters=${event_filters} + # ... event_filters=${event_filters} ... supported_features=0 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions @@ -791,7 +791,7 @@ Invoker subscribe to Service API Available and Unavailable events without Enhanc ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... event_filters=${event_filters} + # ... event_filters=${event_filters} ... supported_features=0 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions @@ -863,7 +863,7 @@ Invoker subscribe to Service API Update without Enhanced Event Report ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... event_filters=${event_filters} + # ... event_filters=${event_filters} ... supported_features=0 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions -- GitLab From 404084e8c0505ad5c7a0c5c9f0b35fb4c6539456 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 3 Mar 2025 11:19:58 +0100 Subject: [PATCH 034/157] Upgrade invoker expected messages and new tests at event filter feature --- .../CAPIF Api Events/capif_events_api.robot | 28 ++-- .../features/Event Filter/event_filter.robot | 140 +++++++++++++++++- tests/resources/common/expectedMessages.robot | 74 ++++++--- 3 files changed, 208 insertions(+), 34 deletions(-) diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index 9cd68c3b..6e07c865 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -378,7 +378,7 @@ Provider subscribe to API Invoker events ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} # Register INVOKER - ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding + ${register_user_info_invoker} ${invoker_url} ${request_body}= Invoker Default Onboarding # Update Invoker onboarded information ${new_notification_destination}= Set Variable @@ -387,7 +387,7 @@ Provider subscribe to API Invoker events ... ${request_body} ... notificationDestination=${new_notification_destination} ${resp}= Put Request Capif - ... ${url.path} + ... ${invoker_url.path} ... ${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt @@ -399,21 +399,24 @@ Provider subscribe to API Invoker events # Remove Invoker from CCF ${resp}= Delete Request Capif - ... ${url.path} + ... ${invoker_url.path} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt ... username=${INVOKER_USERNAME} - Call Method ${CAPIF_USERS} remove_capif_users_entry ${url.path} + Call Method ${CAPIF_USERS} remove_capif_users_entry ${invoker_url.path} # Check Remove Should Be Equal As Strings ${resp.status_code} 204 # Check Event Notifications ## Create check Events to ensure all notifications were received + ${invoker_urls}= Create List ${invoker_url} ${events_expected}= Create Expected Api Invoker Events ... ${subscription_id} - ... ${register_user_info_invoker['api_invoker_id']} + ... api_invoker_onboarded_resources=${invoker_urls} + ... api_invoker_updated_resources=${invoker_urls} + ... api_invoker_offboarded_resources=${invoker_urls} ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} @@ -718,7 +721,7 @@ Invoker receives Service API Invocation events without Enhanced Event Report ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing ... event_filters=${event_filters} - ... supported_features=0 + ... supported_features=4 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions ... json=${request_body} @@ -925,7 +928,7 @@ Provider subscribe to API Invoker events without Enhanced Event Report ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} # Register INVOKER - ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding + ${register_user_info_invoker} ${invoker_url} ${request_body}= Invoker Default Onboarding # Update Invoker onboarded information ${new_notification_destination}= Set Variable @@ -934,7 +937,7 @@ Provider subscribe to API Invoker events without Enhanced Event Report ... ${request_body} ... notificationDestination=${new_notification_destination} ${resp}= Put Request Capif - ... ${url.path} + ... ${invoker_url.path} ... ${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt @@ -946,21 +949,24 @@ Provider subscribe to API Invoker events without Enhanced Event Report # Remove Invoker from CCF ${resp}= Delete Request Capif - ... ${url.path} + ... ${invoker_url.path} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt ... username=${INVOKER_USERNAME} - Call Method ${CAPIF_USERS} remove_capif_users_entry ${url.path} + Call Method ${CAPIF_USERS} remove_capif_users_entry ${invoker_url.path} # Check Remove Should Be Equal As Strings ${resp.status_code} 204 # Check Event Notifications ## Create check Events to ensure all notifications were received + ${invoker_urls}= Create List ${invoker_url} ${events_expected}= Create Expected Api Invoker Events ... ${subscription_id} - ... ${register_user_info_invoker['api_invoker_id']} + ... api_invoker_onboarded_resources=${invoker_urls} + ... api_invoker_updated_resources=${invoker_urls} + ... api_invoker_offboarded_resources=${invoker_urls} ... event_detail_expected=${FALSE} ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index 19fb636b..7ff276c4 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -162,7 +162,145 @@ Service API Available filtered by apiIds Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} -Try error +Invoker events filtered by invokerIds + [Tags] event_filter-3 mockserver + + # Initialize Mock server + Init Mock Server + + # Register APF + ${register_user_info_provider}= Provider Default Registration total_aef_roles=2 + + ${aef_id_1}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} + ${aef_id_2}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} + ${aef_empty_list}= Create List + + # Publish api with 2 aefIds + ${service_api_description_published} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + ... aef_id=${aef_ids} + ... api_status=${aef_empty_list} + ... supported_features=020 + + # Subscribe to events + ${events_list}= Create List API_INVOKER_ONBOARDED + ${event_filter}= Create Capif Event Filter + ${event_filters}= Create List ${event_filter} + + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + # Check Results + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + + # Default Invoker Registration and Onboarding + ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 + ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} + + # Default Invoker Registration and Onboarding + ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 + ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} + + # Subscribe to events + ${events_list}= Create List API_INVOKER_ONBOARDED API_INVOKER_OFFBOARDED API_INVOKER_UPDATED + ${event_filter_empty}= Create Capif Event Filter + ${event_filter_invoker_id_1}= Create Capif Event Filter apiInvokersIds=${api_invoker_id_1} + ${event_filters}= Create List ${event_filter_empty} ${event_filter_invoker_id_1} ${event_filter_invoker_id_1} + + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + # Check Results + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + + # Update Invokers + ## Update Invoker 1 + ${new_notification_destination}= Set Variable + ... http://${CAPIF_CALLBACK_IP}:${CAPIF_CALLBACK_PORT}/netapp_new_callback_1 + Set To Dictionary + ... ${request_body} + ... notificationDestination=${new_notification_destination} + ${resp}= Put Request Capif + ... ${invoker_url_1.path} + ... ${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME}_1 + Check Response Variable Type And Values ${resp} 200 APIInvokerEnrolmentDetails + ... notificationDestination=${new_notification_destination} + + ## Update Invoker 1 + ${new_notification_destination}= Set Variable + ... http://${CAPIF_CALLBACK_IP}:${CAPIF_CALLBACK_PORT}/netapp_new_callback_2 + Set To Dictionary + ... ${request_body} + ... notificationDestination=${new_notification_destination} + ${resp}= Put Request Capif + ... ${invoker_url_2.path} + ... ${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME}_2 + Check Response Variable Type And Values ${resp} 200 APIInvokerEnrolmentDetails + ... notificationDestination=${new_notification_destination} + + # Remove invokers + ## Remove Invoker 1 + ${resp}= Delete Request Capif + ... ${invoker_url_1.path} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME}_1 + Call Method ${CAPIF_USERS} remove_capif_users_entry ${invoker_url_1.path} + Should Be Equal As Strings ${resp.status_code} 204 + + ## Remove Invoker 2 + ${resp}= Delete Request Capif + ... ${invoker_url_2.path} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME}_2 + Call Method ${CAPIF_USERS} remove_capif_users_entry ${invoker_url_2.path} + Should Be Equal As Strings ${resp.status_code} 204 + + # Check Event Notifications + ## Create check Events to ensure all notifications were received + ${invoker_urls}= Create List ${invoker_url_1} + ${empty_list}= Create List + ${events_expected}= Create Expected Api Invoker Events + ... ${subscription_id} + ... api_invoker_onboarded_resources=${empty_list} + ... api_invoker_updated_resources=${invoker_url} + ... api_invoker_offboarded_resources=${invoker_url} + ... event_detail_expected=${FALSE} + Log List ${events_expected} + ## Check Events Expected towards received notifications at mock server + Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} + + +Service API Available filtered by aefIds [Tags] event_filter-2 mockserver # Initialize Mock server diff --git a/tests/resources/common/expectedMessages.robot b/tests/resources/common/expectedMessages.robot index 128f9831..65e6ac6f 100644 --- a/tests/resources/common/expectedMessages.robot +++ b/tests/resources/common/expectedMessages.robot @@ -113,7 +113,9 @@ Create Expected Events For Service API Notifications Create Expected Api Invoker Events [Arguments] ... ${subscription_id} - ... ${api_invoker_id} + ... ${api_invoker_onboarded_resources}=${NONE} + ... ${api_invoker_updated_resources}=${NONE} + ... ${api_invoker_offboarded_resources}=${NONE} ... ${events_expected}=${NONE} ... ${event_detail_expected}=${TRUE} @@ -121,31 +123,59 @@ Create Expected Api Invoker Events ${events_expected}= Create List END - ${api_invoker_id_used}= Set Variable ${api_invoker_id} - IF "${event_detail_expected}" != "${TRUE}" - ${api_invoker_id_used}= Set Variable ${NONE} + # Create Notification Events expected to be received for Onboarded event + IF "${api_invoker_onboarded_resources}" != "${NONE}" + FOR ${api_invoker_onboarded_resource} IN @{api_invoker_onboarded_resources} + Log ${api_invoker_onboarded_resource} + ${api_invoker_id}= Fetch From Right ${api_invoker_onboarded_resource.path} / + + IF "${event_detail_expected}" != "${TRUE}" + ${api_invoker_id}= Set Variable ${NONE} + END + + ${event_expected}= Create Notification Event + ... ${subscription_id} + ... API_INVOKER_ONBOARDED + ... apiInvokerIds=${api_invoker_id} + Append To List ${events_expected} ${event_expected} + END END - ## Create events expected - # Create Notification Events expected to be received for Onboard event - ${event_expected}= Create Notification Event - ... ${subscription_id} - ... API_INVOKER_ONBOARDED - ... apiInvokerIds=${api_invoker_id_used} - Append To List ${events_expected} ${event_expected} # Create Notification Events expected to be received for Updated event - ${event_expected}= Create Notification Event - ... ${subscription_id} - ... API_INVOKER_UPDATED - ... apiInvokerIds=${api_invoker_id_used} - Append To List ${events_expected} ${event_expected} + IF "${api_invoker_updated_resources}" != "${NONE}" + FOR ${api_invoker_updated_resource} IN @{api_invoker_updated_resources} + Log ${api_invoker_updated_resource} + ${api_invoker_id}= Fetch From Right ${api_invoker_updated_resource.path} / - # Create Notification Events expected to be received for Offboard event - ${event_expected}= Create Notification Event - ... ${subscription_id} - ... API_INVOKER_OFFBOARDED - ... apiInvokerIds=${api_invoker_id_used} - Append To List ${events_expected} ${event_expected} + IF "${event_detail_expected}" != "${TRUE}" + ${api_invoker_id}= Set Variable ${NONE} + END + + ${event_expected}= Create Notification Event + ... ${subscription_id} + ... API_INVOKER_UPDATED + ... apiInvokerIds=${api_invoker_id} + Append To List ${events_expected} ${event_expected} + END + END + + # Create Notification Events expected to be received for Offboarded event + IF "${api_invoker_offboarded_resources}" != "${NONE}" + FOR ${api_invoker_offboarded_resource} IN @{api_invoker_offboarded_resources} + Log ${api_invoker_offboarded_resource} + ${api_invoker_id}= Fetch From Right ${api_invoker_offboarded_resource.path} / + + IF "${event_detail_expected}" != "${TRUE}" + ${api_invoker_id}= Set Variable ${NONE} + END + + ${event_expected}= Create Notification Event + ... ${subscription_id} + ... API_INVOKER_OFFBOARDED + ... apiInvokerIds=${api_invoker_id} + Append To List ${events_expected} ${event_expected} + END + END RETURN ${events_expected} -- GitLab From 1acd09eb8c7a845def82b71cbb2b82ddd1833e57 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 3 Mar 2025 12:17:42 +0100 Subject: [PATCH 035/157] new tests under development on event filter feature --- .../features/Event Filter/event_filter.robot | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index 7ff276c4..de65c30e 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -203,21 +203,22 @@ Invoker events filtered by invokerIds # Check Results Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} # Default Invoker Registration and Onboarding - ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 + ${register_user_info_invoker_1} ${invoker_url_1} ${invoker_request_body_1}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} # Default Invoker Registration and Onboarding - ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 + ${register_user_info_invoker_2} ${invoker_url_2} ${invoker_request_body_2}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_2 ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} # Subscribe to events ${events_list}= Create List API_INVOKER_ONBOARDED API_INVOKER_OFFBOARDED API_INVOKER_UPDATED ${event_filter_empty}= Create Capif Event Filter - ${event_filter_invoker_id_1}= Create Capif Event Filter apiInvokersIds=${api_invoker_id_1} - ${event_filters}= Create List ${event_filter_empty} ${event_filter_invoker_id_1} ${event_filter_invoker_id_1} + ${event_filter_invoker_id_1}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} + ${event_filter_invoker_id_2}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_2} + ${event_filters}= Create List ${event_filter_empty} ${event_filter_invoker_id_1} ${event_filter_invoker_id_2} ${request_body}= Create Events Subscription ... events=@{events_list} @@ -229,22 +230,22 @@ Invoker events filtered by invokerIds ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt - ... username=${INVOKER_USERNAME} + ... username=${AMF_PROVIDER_USERNAME} # Check Results Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + ${subscriber_id} ${subscription_id_2}= Check Event Location Header ${resp} # Update Invokers ## Update Invoker 1 ${new_notification_destination}= Set Variable ... http://${CAPIF_CALLBACK_IP}:${CAPIF_CALLBACK_PORT}/netapp_new_callback_1 Set To Dictionary - ... ${request_body} + ... ${invoker_request_body_1} ... notificationDestination=${new_notification_destination} ${resp}= Put Request Capif ... ${invoker_url_1.path} - ... ${request_body} + ... ${invoker_request_body_1} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt ... username=${INVOKER_USERNAME}_1 @@ -255,11 +256,11 @@ Invoker events filtered by invokerIds ${new_notification_destination}= Set Variable ... http://${CAPIF_CALLBACK_IP}:${CAPIF_CALLBACK_PORT}/netapp_new_callback_2 Set To Dictionary - ... ${request_body} + ... ${invoker_request_body_2} ... notificationDestination=${new_notification_destination} ${resp}= Put Request Capif ... ${invoker_url_2.path} - ... ${request_body} + ... ${invoker_request_body_2} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt ... username=${INVOKER_USERNAME}_2 @@ -287,14 +288,20 @@ Invoker events filtered by invokerIds # Check Event Notifications ## Create check Events to ensure all notifications were received - ${invoker_urls}= Create List ${invoker_url_1} + ${invoker_urls_both}= Create List ${invoker_url_1} ${invoker_url_2} + ${invoker_urls_1}= Create List ${invoker_url_1} + ${invoker_urls_2}= Create List ${invoker_url_2} ${empty_list}= Create List ${events_expected}= Create Expected Api Invoker Events - ... ${subscription_id} - ... api_invoker_onboarded_resources=${empty_list} - ... api_invoker_updated_resources=${invoker_url} - ... api_invoker_offboarded_resources=${invoker_url} - ... event_detail_expected=${FALSE} + ... ${subscription_id_1} + ... api_invoker_onboarded_resources=${invoker_urls_both} + ... event_detail_expected=${TRUE} + ${events_expected}= Create Expected Api Invoker Events + ... ${subscription_id_2} + ... events_expected=${events_expected} + ... api_invoker_updated_resources=${invoker_urls_2} + ... api_invoker_offboarded_resources=${invoker_urls_1} + ... event_detail_expected=${TRUE} Log List ${events_expected} ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} -- GitLab From 3c7bbe2343b1af4c98024e4bd4f1316146d3c213 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 3 Mar 2025 14:20:28 +0100 Subject: [PATCH 036/157] Use ttls from configuratio database and add config database for register --- .../core/apiinvokerenrolmentdetails.py | 9 ++++- .../core/sign_certificate.py | 8 ++++- services/helper/config.yaml | 4 ++- services/helper/helper_service/app.py | 9 ++++- .../controllers/helper_controller.py | 6 ++-- services/register/register_service/app.py | 7 +++- .../controllers/register_controller.py | 36 +++++++++++++++++++ .../core/register_operations.py | 36 +++++++++++++++++++ services/register/register_service/db/db.py | 13 ++++++- services/vault/vault_prepare_certs.sh | 2 +- 10 files changed, 120 insertions(+), 10 deletions(-) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py index fcc1a188..8b4b74fd 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py @@ -18,6 +18,9 @@ from .responses import bad_request_error, not_found_error, forbidden_error, inte from ..config import Config from ..util import dict_to_camel_case, serialize_clean_camel_case +from api_invoker_management.db.db import MongoDatabse + + publisher_ops = Publisher() @@ -38,11 +41,14 @@ class InvokerManagementOperations(Resource): def __sign_cert(self, publick_key, invoker_id): + capif_config = self.db.get_col_by_name("capifConfiguration").find_one({"config_name": "default"}) + ttl_invoker_cert = capif_config["settings"].get("ttl_invoker_cert", "43000h") + url = f"http://{self.config['ca_factory']['url']}:{self.config['ca_factory']['port']}/v1/pki_int/sign/my-ca" headers = {'X-Vault-Token': self.config['ca_factory']['token']} data = { 'format': 'pem_bundle', - 'ttl': '43000h', + 'ttl': ttl_invoker_cert, 'csr': publick_key, 'common_name': invoker_id } @@ -58,6 +64,7 @@ class InvokerManagementOperations(Resource): Resource.__init__(self) self.auth_manager = AuthManager() self.config = Config().get_config() + self.db = MongoDatabse() def add_apiinvokerenrolmentdetail(self, apiinvokerenrolmentdetail, username, uuid): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/sign_certificate.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/sign_certificate.py index f535a6c8..45c5c08e 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/sign_certificate.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/sign_certificate.py @@ -3,17 +3,23 @@ import json import requests from ..config import Config +from ..db.db import MongoDatabse def sign_certificate(publick_key, provider_id): config = Config().get_config() + + db = MongoDatabse() + capif_config = db.get_col_by_name("capifConfiguration").find_one({"config_name": "default"}) + ttl_provider_cert = capif_config.get("settings", {}).get("ttl_provider_cert", "4300h") + url = f"http://{config['ca_factory']['url']}:{config['ca_factory']['port']}/v1/pki_int/sign/my-ca" headers = {'X-Vault-Token': config['ca_factory']['token']} data = { 'format':'pem_bundle', - 'ttl': '43000h', + 'ttl': ttl_provider_cert, 'csr': publick_key, 'common_name': provider_id } diff --git a/services/helper/config.yaml b/services/helper/config.yaml index 94c01773..c895dfae 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -24,7 +24,9 @@ capifConfiguration: { version: "1.0", description: "Default CAPIF Configuration", settings: { - certify_expiration_period: 30, + ttl_superadmin_cert: "4300h", + ttl_invoker_cert: "4300h", + ttl_provider_cert: "4300h", security_method_priority: { oauth: 1, pki: 2, diff --git a/services/helper/helper_service/app.py b/services/helper/helper_service/app.py index 3f9ae5c1..9440cbd3 100644 --- a/services/helper/helper_service/app.py +++ b/services/helper/helper_service/app.py @@ -2,6 +2,8 @@ import json import logging import os +from db.db import MongoDatabse + import requests from OpenSSL.crypto import PKey, TYPE_RSA, X509Req, dump_certificate_request, FILETYPE_PEM, dump_privatekey from flask import Flask @@ -12,6 +14,11 @@ from controllers.helper_controller import helper_routes app = Flask(__name__) config = Config().get_config() +# Connect MongoDB and get TTL for superadmin certificate +db = MongoDatabse() +capif_config = db.get_col_by_name("capifConfiguration").find_one({"config_name": "default"}) +ttl_superadmin_cert = capif_config["settings"].get("ttl_superadmin_cert", "43000h") + # Setting log level log_level = os.getenv('LOG_LEVEL', 'INFO').upper() numeric_level = getattr(logging, log_level, logging.INFO) @@ -42,7 +49,7 @@ url = 'http://{}:{}/v1/pki_int/sign/my-ca'.format(config["ca_factory"]["url"], c headers = {'X-Vault-Token': f"{config["ca_factory"]["token"]}"} data = { 'format':'pem_bundle', - 'ttl': '43000h', + 'ttl': ttl_superadmin_cert, 'csr': csr_request, 'common_name': "superadmin" } diff --git a/services/helper/helper_service/controllers/helper_controller.py b/services/helper/helper_service/controllers/helper_controller.py index f2ba5f4a..66a20d6b 100644 --- a/services/helper/helper_service/controllers/helper_controller.py +++ b/services/helper/helper_service/controllers/helper_controller.py @@ -117,13 +117,13 @@ def deleteUserEntities(uuid): @helper_routes.route("/helper/getConfiguration", methods=["GET"]) def getConfiguration(): - """Devuelve toda la configuración actual""" + """Returns the current configuration""" return helper_operation.get_configuration() @helper_routes.route("/helper/updateConfigParam", methods=["PATCH"]) def updateConfigParam(): - """Actualiza un único parámetro de la configuración""" + """Updates a single configuration parameter""" data = request.json param_path = data.get("param_path") # Ej. "settings.acl_policy_settings.allowedTotalInvocations" new_value = data.get("new_value") @@ -136,7 +136,7 @@ def updateConfigParam(): @helper_routes.route("/helper/replaceConfiguration", methods=["PUT"]) def replaceConfiguration(): - """Reemplaza toda la configuración con una nueva""" + """Replaces the entire configuration with a new one""" new_config = request.json if not new_config: return jsonify(message="Missing new configuration in request body"), 400 diff --git a/services/register/register_service/app.py b/services/register/register_service/app.py index 5e9c9a45..c1e5424c 100644 --- a/services/register/register_service/app.py +++ b/services/register/register_service/app.py @@ -19,6 +19,11 @@ jwt_manager = JWTManager(app) config = Config().get_config() +# Connect MongoDB and get TTL for superadmin certificate +db = MongoDatabse() +capif_config = db.get_col_by_name("capifConfiguration").find_one({"config_name": "default"}) +ttl_superadmin_cert = capif_config.get("settings", {}).get("ttl_superadmin_cert", "43000h") + # Setting log level log_level = os.getenv('LOG_LEVEL', 'INFO').upper() numeric_level = getattr(logging, log_level, logging.INFO) @@ -49,7 +54,7 @@ url = 'http://{}:{}/v1/pki_int/sign/my-ca'.format(config["ca_factory"]["url"], c headers = {'X-Vault-Token': f"{config["ca_factory"]["token"]}"} data = { 'format':'pem_bundle', - 'ttl': '43000h', + 'ttl': ttl_superadmin_cert, 'csr': csr_request, 'common_name': "superadmin" } diff --git a/services/register/register_service/controllers/register_controller.py b/services/register/register_service/controllers/register_controller.py index ff3a5618..b2fdc876 100644 --- a/services/register/register_service/controllers/register_controller.py +++ b/services/register/register_service/controllers/register_controller.py @@ -156,3 +156,39 @@ def remove(username, uuid): def getUsers(username): current_app.logger.debug(f"Returning list of users to admin {username}") return register_operation.get_users() + + +@register_routes.route("/configuration", methods=["GET"]) +@admin_required() +def get_register_configuration(username): + """Retrieve the current register configuration""" + current_app.logger.debug(f"Admin {username} is retrieving the register configuration") + return register_operation.get_register_configuration() + + +@register_routes.route("/configuration", methods=["PATCH"]) +@admin_required() +def update_register_config_param(username): + """Update a single parameter in the register configuration""" + data = request.json + param_path = data.get("param_path") + new_value = data.get("new_value") + + if not param_path or new_value is None: + return jsonify(message="Missing 'param_path' or 'new_value' in request body"), 400 + + current_app.logger.debug(f"Admin {username} is updating parameter {param_path} with value {new_value}") + return register_operation.update_register_config_param(param_path, new_value) + + +@register_routes.route("/configuration", methods=["PUT"]) +@admin_required() +def replace_register_configuration(username): + """Replace the entire register configuration""" + new_config = request.json + if not new_config: + return jsonify(message="Missing new configuration in request body"), 400 + + current_app.logger.debug(f"Admin {username} is replacing the entire register configuration") + return register_operation.replace_register_configuration(new_config) + diff --git a/services/register/register_service/core/register_operations.py b/services/register/register_service/core/register_operations.py index 937ce0bd..07b837f8 100644 --- a/services/register/register_service/core/register_operations.py +++ b/services/register/register_service/core/register_operations.py @@ -94,3 +94,39 @@ class RegisterOperations: except Exception as e: return jsonify(message=f"Error trying to get users: {e}"), 500 + + def get_register_configuration(self): + """Retrieve the current register configuration from MongoDB""" + current_app.logger.debug("Retrieving register configuration") + config_col = self.db.get_col_by_name(self.db.capifConfiguration) + config = config_col.find_one({"config_name": "default"}, {"_id": 0}) + + if not config: + return jsonify(message="No register configuration found"), 404 + + return jsonify(config), 200 + + def update_register_config_param(self, param_path, new_value): + """Update a specific parameter in the register configuration""" + current_app.logger.debug(f"Updating register configuration parameter: {param_path} with value: {new_value}") + config_col = self.db.get_col_by_name(self.db.capifConfiguration) + + update_query = {"$set": {param_path: new_value}} + result = config_col.update_one({"config_name": "default"}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 + + return jsonify(message=f"Parameter '{param_path}' updated successfully"), 200 + + def replace_register_configuration(self, new_config): + """Replace the entire register configuration""" + current_app.logger.debug("Replacing entire register configuration") + config_col = self.db.get_col_by_name(self.db.capifConfiguration) + + result = config_col.replace_one({"config_name": "default"}, new_config, upsert=True) + + if result.matched_count == 0: + return jsonify(message="No existing configuration found; a new one was created"), 201 + + return jsonify(message="Register configuration replaced successfully"), 200 diff --git a/services/register/register_service/db/db.py b/services/register/register_service/db/db.py index e1db51bd..88cbce1b 100644 --- a/services/register/register_service/db/db.py +++ b/services/register/register_service/db/db.py @@ -12,7 +12,9 @@ class MongoDatabse(): self.db = self.__connect() self.capif_users = self.config['mongo']['col'] self.capif_admins = self.config['mongo']['admins'] - + self.capifConfiguration = self.config['mongo']['col_capifConfiguration'] + + self.initialize_capif_configuration() def get_col_by_name(self, name): return self.db[name] @@ -33,6 +35,15 @@ class MongoDatabse(): time.sleep(retry_delay) return None + def initialize_capif_configuration(self): + capif_col = self.get_col_by_name(self.capifConfiguration) + if capif_col.count_documents({}) == 0: + default_config = self.config["capifConfiguration"] + capif_col.insert_one(default_config) + print("Default data inserted into the capifConfiguration collection from config.yaml") + else: + print("The capifConfiguration collection already contains data. No default values were inserted.") + def close_connection(self): if self.db.client: self.db.client.close() diff --git a/services/vault/vault_prepare_certs.sh b/services/vault/vault_prepare_certs.sh index b209ecfe..58a83ba0 100644 --- a/services/vault/vault_prepare_certs.sh +++ b/services/vault/vault_prepare_certs.sh @@ -44,7 +44,7 @@ vault write -format=json pki/root/sign-intermediate \ vault write pki_int/intermediate/set-signed certificate=@capif_intermediate.cert.pem # Configure the role for the intermediate CA -vault write pki_int/roles/my-ca use_csr_common_name=false require_cn=true use_csr_sans=false allowed_domains=$HOSTNAME allow_any_name=true allow_bare_domains=true allow_glob_domains=true allow_subdomains=true max_ttl=4300h ttl=4300h +vault write pki_int/roles/my-ca use_csr_common_name=false require_cn=true use_csr_sans=false allowed_domains=$HOSTNAME allow_any_name=true allow_bare_domains=true allow_glob_domains=true allow_subdomains=true max_ttl=4300h # Generate a certificate openssl genrsa -out ./server.key 2048 -- GitLab From 2476a00fe95a2fa8dcc4f708102cdff6b66968c9 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Tue, 4 Mar 2025 12:03:44 +0100 Subject: [PATCH 037/157] check API with interface details --- .../capif_security/core/servicesecurity.py | 66 +++++++++++++++++-- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py index 916b2861..06fafd11 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py @@ -155,7 +155,31 @@ class SecurityOperations(Resource): for service_instance in service_security.security_info: if service_instance.interface_details is not None: - security_methods = service_instance.interface_details.security_methods + + # We look for if the passed interface exists for the given apiId + capif_service_col = self.db.get_col_by_name( + self.db.capif_service_col) + + aef_profile = capif_service_col.find_one( + {"api_id": service_instance.api_id, + "aef_profiles.interface_descriptions":{ + "$elemMatch": service_instance.interface_details.to_dict() + } + }, + {"aef_profiles.interface_descriptions.$": 1, "_id": 0}) + + current_app.logger.debug("Aef profile: " + str(aef_profile)) + + if aef_profile is None: + current_app.logger.error( + "Not found service with this interface description: " + json.dumps(clean_empty(service_instance.interface_details.to_dict()))) + return not_found_error(detail=f"Service with interfaceDescription {json.dumps(clean_empty(service_instance.interface_details.to_dict()))} not found", cause="Not found Service") + + # We obtain the interface security methods + security_methods = aef_profile["aef_profiles"][0]["interface_descriptions"][0]["security_methods"] + + current_app.logger.debug("Interface security methods: " + str(security_methods)) + pref_security_methods = service_instance.pref_security_methods valid_security_method = set( security_methods) & set(pref_security_methods) @@ -319,12 +343,35 @@ class SecurityOperations(Resource): for service_instance in service_security.security_info: if service_instance.interface_details is not None: - security_methods = service_instance.interface_details.security_methods + + # We look for if the passed interface exists for the given apiId + capif_service_col = self.db.get_col_by_name( + self.db.capif_service_col) + + aef_profile = capif_service_col.find_one( + {"api_id": service_instance.api_id, + "aef_profiles.interface_descriptions":{ + "$elemMatch": service_instance.interface_details.to_dict() + } + }, + {"aef_profiles.interface_descriptions.$": 1, "_id": 0}) + + current_app.logger.debug("Aef profile: " + str(aef_profile)) + + if aef_profile is None: + current_app.logger.error( + "Not found service with this interface description: " + json.dumps(clean_empty(service_instance.interface_details.to_dict()))) + return not_found_error(detail=f"Service with interfaceDescription {json.dumps(clean_empty(service_instance.interface_details.to_dict()))} not found", cause="Not found Service") + + # We obtain the interface security methods + security_methods = aef_profile["aef_profiles"][0]["interface_descriptions"][0]["security_methods"] + + current_app.logger.debug("Interface security methods: " + str(security_methods)) + pref_security_methods = service_instance.pref_security_methods valid_security_method = set( security_methods) & set(pref_security_methods) - service_instance.sel_security_method = list( - valid_security_method)[0] + else: capif_service_col = self.db.get_col_by_name( self.db.capif_service_col) @@ -341,9 +388,16 @@ class SecurityOperations(Resource): for security_method in array_methods["security_methods"]] valid_security_method = set( valid_security_methods) & set(pref_security_methods) - service_instance.sel_security_method = list( + + + if len(list(valid_security_method)) == 0: + current_app.logger.error( + "Not found comptaible security method with pref security method") + return bad_request_error(detail="Not found compatible security method with pref security method", cause="Error pref security method", invalid_params=[{"param": "prefSecurityMethods", "reason": "pref security method not compatible with security method available"}]) + + service_instance.sel_security_method = list( valid_security_method)[0] - + service_security = service_security.to_dict() service_security = clean_empty(service_security) -- GitLab From 2cc7d8e404e1c37f9c97b1ad4e1b513c84a511e6 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 4 Mar 2025 13:38:19 +0100 Subject: [PATCH 038/157] ACL UPDATE event when we update ACL using POST /update at security service --- .../capif_security/core/servicesecurity.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py index 916b2861..8be9b362 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py @@ -317,6 +317,7 @@ class SecurityOperations(Resource): "Service api not found with id: " + api_invoker_id) return not_found_error(detail="Service API not existing", cause="Not exist securiy information for this invoker") + update_acls=list() for service_instance in service_security.security_info: if service_instance.interface_details is not None: security_methods = service_instance.interface_details.security_methods @@ -343,14 +344,22 @@ class SecurityOperations(Resource): valid_security_methods) & set(pref_security_methods) service_instance.sel_security_method = list( valid_security_method)[0] + update_acls.append({"api_id": service_instance.api_id, "aef_id": service_instance.aef_id}) service_security = service_security.to_dict() service_security = clean_empty(service_security) result = mycol.find_one_and_update(old_object, {"$set": service_security}, projection={ '_id': 0, "api_invoker_id": 0}, return_document=ReturnDocument.AFTER, upsert=False) + current_app.logger.debug( + "Inserted security context in database") # result = clean_empty(result) + for update_acl in update_acls: + # Send service instance to ACL + current_app.logger.debug("Sending message to create ACL") + publish_ops.publish_message("acls-messages", "create-acl:"+str( + api_invoker_id)+":"+str(update_acl['api_id'])+":"+str(update_acl['aef_id'])) current_app.logger.debug("Updated security context") -- GitLab From 61abfa7e6b594add486f86900f268b4008ba249c Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 4 Mar 2025 13:39:18 +0100 Subject: [PATCH 039/157] New tests insisde event_filter features --- .../features/Event Filter/event_filter.robot | 523 ++++++++++++++++-- tests/libraries/security_api/bodyRequests.py | 31 +- 2 files changed, 515 insertions(+), 39 deletions(-) diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index de65c30e..48c3b1d8 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -18,6 +18,114 @@ ${SUBSCRIBER_ID_NOT_VALID} not-valid ${SUBSCRIPTION_ID_NOT_VALID} not-valid +*** Keywords *** +Create Security Context between ${invoker_info} and ${provider_info} + # Discover APIs by invoker + ${discover_response}= Get Request Capif + ... ${DISCOVER_URL}${invoker_info['api_invoker_id']}&aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + Check Response Variable Type And Values ${discover_response} 200 DiscoveredAPIs + + # create Security Context + ${request_service_security_body} ${api_ids}= Create Service Security From Discover Response + ... http://${CAPIF_HOSTNAME}:${CAPIF_HTTP_PORT}/test + ... ${discover_response} + ... legacy=${FALSE} + ${resp}= Put Request Capif + ... /capif-security/v1/trustedInvokers/${invoker_info['api_invoker_id']} + ... json=${request_service_security_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + Set To Dictionary ${invoker_info} security_body=${request_service_security_body} + # Check Service Security + Check Response Variable Type And Values ${resp} 201 ServiceSecurity + ${resource_url}= Check Location Header ${resp} ${LOCATION_SECURITY_RESOURCE_REGEX} + + ${api_invoker_policies_list}= Create List + + FOR ${api_id} IN @{api_ids} + Log ${api_id} + ${resp}= Get Request Capif + ... /access-control-policy/v1/accessControlPolicyList/${api_id}?aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${provider_info['aef_username']} + + Check Response Variable Type And Values ${resp} 200 AccessControlPolicyList + # Check returned values + Should Not Be Empty ${resp.json()['apiInvokerPolicies']} + # Length Should Be ${resp.json()['apiInvokerPolicies']} 1 + # Should Be Equal As Strings + # ... ${resp.json()['apiInvokerPolicies'][0]['apiInvokerId']} + # ... ${invoker_info['api_invoker_id']} + + ${api_invoker_policies}= Set Variable ${resp.json()['apiInvokerPolicies']} + # Append To List ${api_invoker_policies_list} ${api_invoker_policies} + ${api_invoker_policies_list}= Set Variable ${api_invoker_policies} + END + + Log List ${api_invoker_policies_list} + + RETURN ${api_invoker_policies_list} + +Update Security Context between ${invoker_info} and ${provider_info} + # Discover APIs by invoker + ${discover_response}= Get Request Capif + ... ${DISCOVER_URL}${invoker_info['api_invoker_id']}&aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + Check Response Variable Type And Values ${discover_response} 200 DiscoveredAPIs + + # create Security Context + ${request_service_security_body} ${api_ids}= Update Service Security With Discover Response + ... ${invoker_info['security_body']} + ... ${discover_response} + ... legacy=${FALSE} + ${resp}= Post Request Capif + ... /capif-security/v1/trustedInvokers/${invoker_info['api_invoker_id']}/update + ... json=${request_service_security_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + # Check Service Security + Check Response Variable Type And Values ${resp} 200 ServiceSecurity + ${resource_url}= Check Location Header ${resp} ${LOCATION_SECURITY_RESOURCE_REGEX} + + ${api_invoker_policies_list}= Create List + + ${api_id}= Get From List ${api_ids} -1 + Log ${api_id} + ${resp}= Get Request Capif + ... /access-control-policy/v1/accessControlPolicyList/${api_id}?aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${provider_info['aef_username']} + + Check Response Variable Type And Values ${resp} 200 AccessControlPolicyList + # Check returned values + Should Not Be Empty ${resp.json()['apiInvokerPolicies']} + # Length Should Be ${resp.json()['apiInvokerPolicies']} 1 + # Should Be Equal As Strings + # ... ${resp.json()['apiInvokerPolicies'][0]['apiInvokerId']} + # ... ${invoker_info['api_invoker_id']} + + ${api_invoker_policies}= Set Variable ${resp.json()['apiInvokerPolicies']} + # Append To List ${api_invoker_policies_list} ${api_invoker_policies} + ${api_invoker_policies_list}= Set Variable ${api_invoker_policies} + + Log List ${api_invoker_policies_list} + + RETURN ${api_invoker_policies_list} + + *** Test Cases *** Service API Available filtered by apiIds [Tags] event_filter-1 mockserver @@ -46,7 +154,7 @@ Service API Available filtered by apiIds # Register other provider ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_NEW - + ${aef2_id_1}= Set Variable ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} # Publish api with other provider @@ -161,6 +269,175 @@ Service API Available filtered by apiIds ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} +Service API Available filtered by not valid filters + [Tags] event_filter-2 mockserver + + # Initialize Mock server + Init Mock Server + + # Default Invoker Registration and Onboarding + ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding + + # Register APF + ${register_user_info_provider}= Provider Default Registration total_aef_roles=2 + + ${aef_id_1}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} + ${aef_id_2}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} + ${aef_empty_list}= Create List + + # Publish api with 2 aefIds + ${service_api_description_published} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + ... aef_id=${aef_ids} + ... api_status=${aef_empty_list} + ... supported_features=020 + + # Register other provider + ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_NEW + + ${aef2_id_1}= Set Variable ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} + + # Publish api with other provider + ${service_api_description_published_2} ${resource_url_2} ${request_body_2}= Publish Service Api + ... ${register_user_info_provider_2} + ... service_2 + ... aef_id=${aef2_id_1} + ... api_status=${aef2_id_1} + ... supported_features=020 + + # Discover APIs by invoker + ${resp}= Get Request Capif + ... ${DISCOVER_URL}${register_user_info_invoker['api_invoker_id']}&aef-id=${aef_id_1} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + Check Response Variable Type And Values ${resp} 200 DiscoveredAPIs + + # # Check Results + Dictionary Should Contain Key ${resp.json()} serviceAPIDescriptions + Should Not Be Empty ${resp.json()['serviceAPIDescriptions']} + Length Should Be ${resp.json()['serviceAPIDescriptions']} 1 + List Should Contain Value ${resp.json()['serviceAPIDescriptions']} ${service_api_description_published} + + ${api_id}= Set Variable ${resp.json()['serviceAPIDescriptions'][0]['apiId']} + + # Wrong filter on SERVICE_API_AVAILABLE + ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE SERVICE_API_UPDATE + ${event_filter_empty}= Create Capif Event Filter + ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_ids} + ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_description_published['apiId']} + ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${register_user_info_invoker['api_invoker_id']} + ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_empty} ${event_filter_empty} + + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + # Check Results + ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event SERVICE_API_AVAILABLE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event SERVICE_API_AVAILABLE + ... invalidParams=${invalid_param_list} + + # Wrong filter on SERVICE_API_UNAVAILABLE + ${event_filters}= Create List ${event_filter_empty} ${event_filter_aef_ids} ${event_filter_empty} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + # Check Results + ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event SERVICE_API_UNAVAILABLE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event SERVICE_API_UNAVAILABLE + ... invalidParams=${invalid_param_list} + + + # Wrong filter on SERVICE_API_UPDATE + ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_aef_ids} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + # Check Results + ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event SERVICE_API_UPDATE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event SERVICE_API_UPDATE + ... invalidParams=${invalid_param_list} + + # Wrong filter on SERVICE_API_UPDATE with apiIds + ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_api_invoker_ids} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + # Check Results + ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'api_invoker_ids'} for event SERVICE_API_UPDATE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event SERVICE_API_UPDATE + ... invalidParams=${invalid_param_list} Invoker events filtered by invokerIds [Tags] event_filter-3 mockserver @@ -306,16 +583,12 @@ Invoker events filtered by invokerIds ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} - -Service API Available filtered by aefIds - [Tags] event_filter-2 mockserver +Invoker events filtered by not valid filters + [Tags] event_filter-4 mockserver # Initialize Mock server Init Mock Server - # Default Invoker Registration and Onboarding - ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - # Register APF ${register_user_info_provider}= Provider Default Registration total_aef_roles=2 @@ -332,40 +605,42 @@ Service API Available filtered by aefIds ... api_status=${aef_empty_list} ... supported_features=020 - # Register other provider - ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_NEW - - ${aef2_id_1}= Set Variable ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} - - # Publish api with other provider - ${service_api_description_published_2} ${resource_url_2} ${request_body_2}= Publish Service Api - ... ${register_user_info_provider_2} - ... service_2 - ... aef_id=${aef2_id_1} - ... api_status=${aef2_id_1} - ... supported_features=020 + # Subscribe to events + ${events_list}= Create List API_INVOKER_ONBOARDED + ${event_filter}= Create Capif Event Filter + ${event_filters}= Create List ${event_filter} - # Discover APIs by invoker - ${resp}= Get Request Capif - ... ${DISCOVER_URL}${register_user_info_invoker['api_invoker_id']}&aef-id=${aef_id_1} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions + ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt - ... username=${INVOKER_USERNAME} + ... username=${AMF_PROVIDER_USERNAME} - Check Response Variable Type And Values ${resp} 200 DiscoveredAPIs + # Check Results + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} - # # Check Results - Dictionary Should Contain Key ${resp.json()} serviceAPIDescriptions - Should Not Be Empty ${resp.json()['serviceAPIDescriptions']} - Length Should Be ${resp.json()['serviceAPIDescriptions']} 1 - List Should Contain Value ${resp.json()['serviceAPIDescriptions']} ${service_api_description_published} + # Default Invoker Registration and Onboarding + ${register_user_info_invoker_1} ${invoker_url_1} ${invoker_request_body_1}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 + ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} - ${api_id}= Set Variable ${resp.json()['serviceAPIDescriptions'][0]['apiId']} + # Default Invoker Registration and Onboarding + ${register_user_info_invoker_2} ${invoker_url_2} ${invoker_request_body_2}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_2 + ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} # Subscribe to events - ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE SERVICE_API_UPDATE - ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} - ${event_filters}= Create List ${event_filter} ${event_filter} ${event_filter} + ${events_list}= Create List API_INVOKER_ONBOARDED API_INVOKER_OFFBOARDED API_INVOKER_UPDATED + ${event_filter_empty}= Create Capif Event Filter + ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_ids} + ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_description_published['apiId']} + ${event_filter_invoker_id_2}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_2} + ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_empty} ${event_filter_empty} ${request_body}= Create Events Subscription ... events=@{events_list} @@ -373,14 +648,14 @@ Service API Available filtered by aefIds ... supported_features=C ... event_filters=${event_filters} ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions + ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt - ... username=${INVOKER_USERNAME} + ... username=${AMF_PROVIDER_USERNAME} # Check Results - ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event SERVICE_API_AVAILABLE are not applicable. + ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event API_INVOKER_ONBOARDED are not applicable. ${invalid_param_list}= Create List ${invalid_param} Check Response Variable Type And Values ... ${resp} @@ -389,5 +664,179 @@ Service API Available filtered by aefIds ... title=Bad Request ... status=400 ... detail=Bad Param - ... cause=Invalid eventFilter for event SERVICE_API_AVAILABLE + ... cause=Invalid eventFilter for event API_INVOKER_ONBOARDED + ... invalidParams=${invalid_param_list} + + # Check API_INVOKER_OFFBOARDED + ${event_filters}= Create List ${event_filter_empty} ${event_filter_aef_ids} ${event_filter_empty} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + # Check Results + ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event API_INVOKER_OFFBOARDED are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event API_INVOKER_OFFBOARDED + ... invalidParams=${invalid_param_list} + + # Check API_INVOKER_UPDATED + ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_aef_ids} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + # Check Results + ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event API_INVOKER_UPDATED are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event API_INVOKER_UPDATED ... invalidParams=${invalid_param_list} + + # Check API_INVOKER_UPDATED + ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_api_ids} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + # Check Results + ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'api_ids'} for event API_INVOKER_UPDATED are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event API_INVOKER_UPDATED + ... invalidParams=${invalid_param_list} + + +Invoker subscribed to ACL update event filtered by apiInvokerId + [Tags] event_filter-5 mockserver smoke + + # Initialize Mock server + Init Mock Server + + # Register provider 1 + ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 + + # Publish one api + ${service_api_description_published_1} ${provider_resource_url_1} ${provider_request_body_1}= Publish Service Api + ... ${register_user_info_provider_1} + ... service_name=service_1 + + # Register APF + ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_2 + + # Publish one api + ${service_api_description_published_2} ${provider_resource_url_2} ${provider_request_body_2}= Publish Service Api + ... ${register_user_info_provider_2} + ... service_name=service_2 + + # Store apiId1 and apiId2 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + ${service_api_id_2}= Set Variable ${service_api_description_published_2['apiId']} + + # Register INVOKER 1 + ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 + ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} + + # Register INVOKER 2 + ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding invoke_username=${INVOKER_USERNAME}_2 + ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} + + + # Subscribe to events + ${events_list}= Create List ACCESS_CONTROL_POLICY_UPDATE + + # Event filters + ${event_filter_empty}= Create Capif Event Filter + ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} + ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} + ${event_filter_api_invoker_ids_and_api_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} apiIds=${service_api_id_1} + + ${event_filters}= Create List ${event_filter_api_invoker_ids} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=4 + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${register_user_info_provider_1['amf_username']} + + # Check Results + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} + + ${acl_provider_1}= Create Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_1} + ${acl_provider_1}= Create Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_1} + + ${acl_provider_2}= Update Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_2} + ${acl_provider_2}= Update Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_2} + + # Check Event Notifications + ## Create check Events to ensure all notifications were received + ${acl_to_check}= Create List ${acl_provider_1[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_1} + ... ${service_api_id_1} + ... ${acl_to_check} + + ${acl_to_check}= Create List ${acl_provider_1[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_1} + ... ${service_api_id_1} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ${acl_to_check}= Create List ${acl_provider_2[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_1} + ... ${service_api_id_2} + ... ${acl_to_check} + ... events_expected=${events_expected} + ## Check Events Expected towards received notifications at mock server + Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} diff --git a/tests/libraries/security_api/bodyRequests.py b/tests/libraries/security_api/bodyRequests.py index dabee876..0e2f826d 100644 --- a/tests/libraries/security_api/bodyRequests.py +++ b/tests/libraries/security_api/bodyRequests.py @@ -32,7 +32,7 @@ def create_service_security_body(notification_destination, aef_id=None, api_id=N return data -def create_service_security_from_discover_response(notification_destination, discover_response): +def create_service_security_from_discover_response(notification_destination, discover_response, legacy=True): data = { "notificationDestination": notification_destination, "supportedFeatures": "fffffff", @@ -43,6 +43,7 @@ def create_service_security_from_discover_response(notification_destination, dis }, "requestTestNotification": True } + api_ids=list() service_api_descriptions = discover_response.json()['serviceAPIDescriptions'] for service_api_description in service_api_descriptions: for aef_profile in service_api_description['aefProfiles']: @@ -53,7 +54,33 @@ def create_service_security_from_discover_response(notification_destination, dis "aefId": aef_profile['aefId'], "apiId": service_api_description['apiId'] }) - return data + api_ids.append(service_api_description['apiId']) + if legacy: + return data + else: + return data, api_ids + + +def update_service_security_with_discover_response(security_body, discover_response, legacy=True): + api_ids = list() + service_api_descriptions = discover_response.json()['serviceAPIDescriptions'] + for service_api_description in service_api_descriptions: + for aef_profile in service_api_description['aefProfiles']: + security_body['securityInfo'].append({ + "authenticationInfo": "authenticationInfo", + "authorizationInfo": "authorizationInfo", + "prefSecurityMethods": ["PSK", "PKI", "OAUTH"], + "aefId": aef_profile['aefId'], + "apiId": service_api_description['apiId'] + }) + + for security_info in security_body['securityInfo']: + api_ids.append(security_info['apiId']) + + if legacy: + return security_body + else: + return security_body, api_ids def create_security_notification_body(api_invoker_id, api_ids, cause="OVERLIMIT_USAGE", aef_id=None): -- GitLab From 0e75c5548bd12aa0e6e4e2a07467aee1bd9279f6 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 4 Mar 2025 16:51:59 +0100 Subject: [PATCH 040/157] New tests related with event filter and ACL events --- .../features/Event Filter/event_filter.robot | 316 +++++++++++++++++- 1 file changed, 306 insertions(+), 10 deletions(-) diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index 48c3b1d8..098f8034 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -127,7 +127,7 @@ Update Security Context between ${invoker_info} and ${provider_info} *** Test Cases *** -Service API Available filtered by apiIds +Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE_API_UPDATE events filtered by apiIds [Tags] event_filter-1 mockserver # Initialize Mock server @@ -269,7 +269,7 @@ Service API Available filtered by apiIds ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} -Service API Available filtered by not valid filters +Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE_API_UPDATE events filtered by not valid filters [Tags] event_filter-2 mockserver # Initialize Mock server @@ -439,7 +439,7 @@ Service API Available filtered by not valid filters ... cause=Invalid eventFilter for event SERVICE_API_UPDATE ... invalidParams=${invalid_param_list} -Invoker events filtered by invokerIds +Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INVOKER_UPDATED events filtered by invokerIds [Tags] event_filter-3 mockserver # Initialize Mock server @@ -583,7 +583,7 @@ Invoker events filtered by invokerIds ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} -Invoker events filtered by not valid filters +Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INVOKER_UPDATED events filtered by not valid filters [Tags] event_filter-4 mockserver # Initialize Mock server @@ -747,9 +747,7 @@ Invoker events filtered by not valid filters ... detail=Bad Param ... cause=Invalid eventFilter for event API_INVOKER_UPDATED ... invalidParams=${invalid_param_list} - - -Invoker subscribed to ACL update event filtered by apiInvokerId +Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId, only invokerId and both [Tags] event_filter-5 mockserver smoke # Initialize Mock server @@ -792,8 +790,43 @@ Invoker subscribed to ACL update event filtered by apiInvokerId ${event_filter_empty}= Create Capif Event Filter ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} - ${event_filter_api_invoker_ids_and_api_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} apiIds=${service_api_id_1} + ${event_filter_api_invoker_ids_and_api_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_2} apiIds=${service_api_id_2} + + # Subscription to Events 1 + ${event_filters}= Create List ${event_filter_api_ids} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=4 + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${register_user_info_provider_1['amf_username']} + + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} + # Subscription to Events 2 + ${event_filters}= Create List ${event_filter_api_invoker_ids_and_api_ids} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=4 + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${register_user_info_provider_1['amf_username']} + + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id_2}= Check Event Location Header ${resp} + + # Subscription to Events 3 ${event_filters}= Create List ${event_filter_api_invoker_ids} ${request_body}= Create Events Subscription ... events=@{events_list} @@ -807,10 +840,232 @@ Invoker subscribed to ACL update event filtered by apiInvokerId ... verify=ca.crt ... username=${register_user_info_provider_1['amf_username']} + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id_3}= Check Event Location Header ${resp} + + + # Create Security Contexts and ACLs + ${acl_provider_1}= Create Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_1} + ${acl_provider_1}= Create Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_1} + + ${acl_provider_2}= Update Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_2} + ${acl_provider_2}= Update Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_2} + + # Check Event Notifications + ## Create check Events to ensure all notifications were received + ### Subscription 1 Checks + ${acl_to_check}= Create List ${acl_provider_1[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_1} + ... ${service_api_id_1} + ... ${acl_to_check} + + ${acl_to_check}= Create List ${acl_provider_1[1]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_1} + ... ${service_api_id_1} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ${acl_to_check}= Create List ${acl_provider_1[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_1} + ... ${service_api_id_1} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ${acl_to_check}= Create List ${acl_provider_1[1]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_1} + ... ${service_api_id_1} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ### Subscription 2 checks + ${acl_to_check}= Create List ${acl_provider_2[1]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_2} + ... ${service_api_id_2} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ### Subscription 3 checks + ${acl_to_check}= Create List ${acl_provider_1[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_3} + ... ${service_api_id_1} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ${acl_to_check}= Create List ${acl_provider_1[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_3} + ... ${service_api_id_1} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ${acl_to_check}= Create List ${acl_provider_2[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_3} + ... ${service_api_id_2} + ... ${acl_to_check} + ... events_expected=${events_expected} + + Log List ${events_expected} + + ## Check Events Expected towards received notifications at mock server + Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} + + +Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by aefId + [Tags] event_filter-6 smoke + + # Initialize Mock server + Init Mock Server + + # Register provider 1 + ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 + ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + + # Publish one api + ${service_api_description_published_1} ${provider_resource_url_1} ${provider_request_body_1}= Publish Service Api + ... ${register_user_info_provider_1} + ... service_name=service_1 + + # Store apiId1 and apiId2 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Subscribe to events + ${events_list}= Create List ACCESS_CONTROL_POLICY_UPDATE + + # Event filters + ${event_filter_aef_id}= Create Capif Event Filter aefIds=${aef_id_1} + + # Subscription to Events 1 + ${event_filters}= Create List ${event_filter_aef_id} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=4 + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${register_user_info_provider_1['amf_username']} + # Check Results + ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event ACCESS_CONTROL_POLICY_UPDATE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event ACCESS_CONTROL_POLICY_UPDATE + ... invalidParams=${invalid_param_list} + +Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE filtered by apiId, invokerId, aefId and all of them + [Tags] event_filter-7 mockserver smoke + + # Initialize Mock server + Init Mock Server + + # Register provider 1 + ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 + + # Publish one api + ${service_api_description_published_1} ${provider_resource_url_1} ${provider_request_body_1}= Publish Service Api + ... ${register_user_info_provider_1} + ... service_name=service_1 + + # Register APF + ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_2 + + # Publish one api + ${service_api_description_published_2} ${provider_resource_url_2} ${provider_request_body_2}= Publish Service Api + ... ${register_user_info_provider_2} + ... service_name=service_2 + + # Store apiId1 and apiId2 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + ${service_api_id_2}= Set Variable ${service_api_description_published_2['apiId']} + + # Register INVOKER 1 + ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 + ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} + + # Register INVOKER 2 + ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding invoke_username=${INVOKER_USERNAME}_2 + ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} + + + # Subscribe to events + ${events_list}= Create List ACCESS_CONTROL_POLICY_UPDATE + + # Event filters + ${event_filter_empty}= Create Capif Event Filter + ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} + ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} + ${event_filter_api_invoker_ids_and_api_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_2} apiIds=${service_api_id_2} + + # Subscription to Events 1 + ${event_filters}= Create List ${event_filter_api_ids} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=4 + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${register_user_info_provider_1['amf_username']} + Check Response Variable Type And Values ${resp} 201 EventSubscription ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} + # Subscription to Events 2 + ${event_filters}= Create List ${event_filter_api_invoker_ids_and_api_ids} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=4 + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${register_user_info_provider_1['amf_username']} + + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id_2}= Check Event Location Header ${resp} + + # Subscription to Events 3 + ${event_filters}= Create List ${event_filter_api_invoker_ids} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=4 + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${register_user_info_provider_1['amf_username']} + + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id_3}= Check Event Location Header ${resp} + + + # Create Security Contexts and ACLs ${acl_provider_1}= Create Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_1} ${acl_provider_1}= Create Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_1} @@ -819,12 +1074,20 @@ Invoker subscribed to ACL update event filtered by apiInvokerId # Check Event Notifications ## Create check Events to ensure all notifications were received + ### Subscription 1 Checks ${acl_to_check}= Create List ${acl_provider_1[0]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} ... ${service_api_id_1} ... ${acl_to_check} + ${acl_to_check}= Create List ${acl_provider_1[1]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_1} + ... ${service_api_id_1} + ... ${acl_to_check} + ... events_expected=${events_expected} + ${acl_to_check}= Create List ${acl_provider_1[0]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} @@ -832,11 +1095,44 @@ Invoker subscribed to ACL update event filtered by apiInvokerId ... ${acl_to_check} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_2[0]} + ${acl_to_check}= Create List ${acl_provider_1[1]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} + ... ${service_api_id_1} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ### Subscription 2 checks + ${acl_to_check}= Create List ${acl_provider_2[1]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_2} + ... ${service_api_id_2} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ### Subscription 3 checks + ${acl_to_check}= Create List ${acl_provider_1[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_3} + ... ${service_api_id_1} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ${acl_to_check}= Create List ${acl_provider_1[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_3} + ... ${service_api_id_1} + ... ${acl_to_check} + ... events_expected=${events_expected} + + ${acl_to_check}= Create List ${acl_provider_2[0]} + ${events_expected}= Create Expected Access Control Policy Update Event + ... ${subscription_id_3} ... ${service_api_id_2} ... ${acl_to_check} ... events_expected=${events_expected} + + Log List ${events_expected} + ## Check Events Expected towards received notifications at mock server - Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} + Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} \ No newline at end of file -- GitLab From 2d24287fbb5d91015441b054032bbaac46101e30 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 4 Mar 2025 17:37:22 +0100 Subject: [PATCH 041/157] New test for Success and failure invocation --- .../features/Event Filter/event_filter.robot | 649 ++++++++++-------- 1 file changed, 357 insertions(+), 292 deletions(-) diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index 098f8034..5bc3a112 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -18,114 +18,6 @@ ${SUBSCRIBER_ID_NOT_VALID} not-valid ${SUBSCRIPTION_ID_NOT_VALID} not-valid -*** Keywords *** -Create Security Context between ${invoker_info} and ${provider_info} - # Discover APIs by invoker - ${discover_response}= Get Request Capif - ... ${DISCOVER_URL}${invoker_info['api_invoker_id']}&aef-id=${provider_info['aef_id']} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${invoker_info['management_cert']} - - Check Response Variable Type And Values ${discover_response} 200 DiscoveredAPIs - - # create Security Context - ${request_service_security_body} ${api_ids}= Create Service Security From Discover Response - ... http://${CAPIF_HOSTNAME}:${CAPIF_HTTP_PORT}/test - ... ${discover_response} - ... legacy=${FALSE} - ${resp}= Put Request Capif - ... /capif-security/v1/trustedInvokers/${invoker_info['api_invoker_id']} - ... json=${request_service_security_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${invoker_info['management_cert']} - - Set To Dictionary ${invoker_info} security_body=${request_service_security_body} - # Check Service Security - Check Response Variable Type And Values ${resp} 201 ServiceSecurity - ${resource_url}= Check Location Header ${resp} ${LOCATION_SECURITY_RESOURCE_REGEX} - - ${api_invoker_policies_list}= Create List - - FOR ${api_id} IN @{api_ids} - Log ${api_id} - ${resp}= Get Request Capif - ... /access-control-policy/v1/accessControlPolicyList/${api_id}?aef-id=${provider_info['aef_id']} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${provider_info['aef_username']} - - Check Response Variable Type And Values ${resp} 200 AccessControlPolicyList - # Check returned values - Should Not Be Empty ${resp.json()['apiInvokerPolicies']} - # Length Should Be ${resp.json()['apiInvokerPolicies']} 1 - # Should Be Equal As Strings - # ... ${resp.json()['apiInvokerPolicies'][0]['apiInvokerId']} - # ... ${invoker_info['api_invoker_id']} - - ${api_invoker_policies}= Set Variable ${resp.json()['apiInvokerPolicies']} - # Append To List ${api_invoker_policies_list} ${api_invoker_policies} - ${api_invoker_policies_list}= Set Variable ${api_invoker_policies} - END - - Log List ${api_invoker_policies_list} - - RETURN ${api_invoker_policies_list} - -Update Security Context between ${invoker_info} and ${provider_info} - # Discover APIs by invoker - ${discover_response}= Get Request Capif - ... ${DISCOVER_URL}${invoker_info['api_invoker_id']}&aef-id=${provider_info['aef_id']} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${invoker_info['management_cert']} - - Check Response Variable Type And Values ${discover_response} 200 DiscoveredAPIs - - # create Security Context - ${request_service_security_body} ${api_ids}= Update Service Security With Discover Response - ... ${invoker_info['security_body']} - ... ${discover_response} - ... legacy=${FALSE} - ${resp}= Post Request Capif - ... /capif-security/v1/trustedInvokers/${invoker_info['api_invoker_id']}/update - ... json=${request_service_security_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${invoker_info['management_cert']} - - # Check Service Security - Check Response Variable Type And Values ${resp} 200 ServiceSecurity - ${resource_url}= Check Location Header ${resp} ${LOCATION_SECURITY_RESOURCE_REGEX} - - ${api_invoker_policies_list}= Create List - - ${api_id}= Get From List ${api_ids} -1 - Log ${api_id} - ${resp}= Get Request Capif - ... /access-control-policy/v1/accessControlPolicyList/${api_id}?aef-id=${provider_info['aef_id']} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${provider_info['aef_username']} - - Check Response Variable Type And Values ${resp} 200 AccessControlPolicyList - # Check returned values - Should Not Be Empty ${resp.json()['apiInvokerPolicies']} - # Length Should Be ${resp.json()['apiInvokerPolicies']} 1 - # Should Be Equal As Strings - # ... ${resp.json()['apiInvokerPolicies'][0]['apiInvokerId']} - # ... ${invoker_info['api_invoker_id']} - - ${api_invoker_policies}= Set Variable ${resp.json()['apiInvokerPolicies']} - # Append To List ${api_invoker_policies_list} ${api_invoker_policies} - ${api_invoker_policies_list}= Set Variable ${api_invoker_policies} - - Log List ${api_invoker_policies_list} - - RETURN ${api_invoker_policies_list} - - *** Test Cases *** Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE_API_UPDATE events filtered by apiIds [Tags] event_filter-1 mockserver @@ -155,7 +47,8 @@ Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE # Register other provider ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_NEW - ${aef2_id_1}= Set Variable ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} + ${aef2_id_1}= Set Variable + ... ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} # Publish api with other provider ${service_api_description_published_2} ${resource_url_2} ${request_body_2}= Publish Service Api @@ -297,7 +190,8 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE # Register other provider ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_NEW - ${aef2_id_1}= Set Variable ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} + ${aef2_id_1}= Set Variable + ... ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} # Publish api with other provider ${service_api_description_published_2} ${resource_url_2} ${request_body_2}= Publish Service Api @@ -326,10 +220,11 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE # Wrong filter on SERVICE_API_AVAILABLE ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE SERVICE_API_UPDATE - ${event_filter_empty}= Create Capif Event Filter + ${event_filter_empty}= Create Capif Event Filter ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_ids} ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_description_published['apiId']} - ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${register_user_info_invoker['api_invoker_id']} + ${event_filter_api_invoker_ids}= Create Capif Event Filter + ... apiInvokerIds=${register_user_info_invoker['api_invoker_id']} ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_empty} ${event_filter_empty} ${request_body}= Create Events Subscription @@ -345,8 +240,10 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... username=${INVOKER_USERNAME} # Check Results - ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event SERVICE_API_AVAILABLE are not applicable. - ${invalid_param_list}= Create List ${invalid_param} + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'aef_ids'} for event SERVICE_API_AVAILABLE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} Check Response Variable Type And Values ... ${resp} ... 400 @@ -372,8 +269,10 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... username=${INVOKER_USERNAME} # Check Results - ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event SERVICE_API_UNAVAILABLE are not applicable. - ${invalid_param_list}= Create List ${invalid_param} + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'aef_ids'} for event SERVICE_API_UNAVAILABLE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} Check Response Variable Type And Values ... ${resp} ... 400 @@ -384,7 +283,6 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... cause=Invalid eventFilter for event SERVICE_API_UNAVAILABLE ... invalidParams=${invalid_param_list} - # Wrong filter on SERVICE_API_UPDATE ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_aef_ids} ${request_body}= Create Events Subscription @@ -400,8 +298,10 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... username=${INVOKER_USERNAME} # Check Results - ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event SERVICE_API_UPDATE are not applicable. - ${invalid_param_list}= Create List ${invalid_param} + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'aef_ids'} for event SERVICE_API_UPDATE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} Check Response Variable Type And Values ... ${resp} ... 400 @@ -413,7 +313,10 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... invalidParams=${invalid_param_list} # Wrong filter on SERVICE_API_UPDATE with apiIds - ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_api_invoker_ids} + ${event_filters}= Create List + ... ${event_filter_empty} + ... ${event_filter_empty} + ... ${event_filter_api_invoker_ids} ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing @@ -427,8 +330,10 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... username=${INVOKER_USERNAME} # Check Results - ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'api_invoker_ids'} for event SERVICE_API_UPDATE are not applicable. - ${invalid_param_list}= Create List ${invalid_param} + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'api_invoker_ids'} for event SERVICE_API_UPDATE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} Check Response Variable Type And Values ... ${resp} ... 400 @@ -483,19 +388,24 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} # Default Invoker Registration and Onboarding - ${register_user_info_invoker_1} ${invoker_url_1} ${invoker_request_body_1}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 - ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} + ${register_user_info_invoker_1} ${invoker_url_1} ${invoker_request_body_1}= Invoker Default Onboarding + ... invoker_username=${INVOKER_USERNAME}_1 + ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} # Default Invoker Registration and Onboarding - ${register_user_info_invoker_2} ${invoker_url_2} ${invoker_request_body_2}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_2 - ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} + ${register_user_info_invoker_2} ${invoker_url_2} ${invoker_request_body_2}= Invoker Default Onboarding + ... invoker_username=${INVOKER_USERNAME}_2 + ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} # Subscribe to events - ${events_list}= Create List API_INVOKER_ONBOARDED API_INVOKER_OFFBOARDED API_INVOKER_UPDATED + ${events_list}= Create List API_INVOKER_ONBOARDED API_INVOKER_OFFBOARDED API_INVOKER_UPDATED ${event_filter_empty}= Create Capif Event Filter ${event_filter_invoker_id_1}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} ${event_filter_invoker_id_2}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_2} - ${event_filters}= Create List ${event_filter_empty} ${event_filter_invoker_id_1} ${event_filter_invoker_id_2} + ${event_filters}= Create List + ... ${event_filter_empty} + ... ${event_filter_invoker_id_1} + ... ${event_filter_invoker_id_2} ${request_body}= Create Events Subscription ... events=@{events_list} @@ -565,7 +475,7 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV # Check Event Notifications ## Create check Events to ensure all notifications were received - ${invoker_urls_both}= Create List ${invoker_url_1} ${invoker_url_2} + ${invoker_urls_both}= Create List ${invoker_url_1} ${invoker_url_2} ${invoker_urls_1}= Create List ${invoker_url_1} ${invoker_urls_2}= Create List ${invoker_url_2} ${empty_list}= Create List @@ -627,15 +537,17 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} # Default Invoker Registration and Onboarding - ${register_user_info_invoker_1} ${invoker_url_1} ${invoker_request_body_1}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 - ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} + ${register_user_info_invoker_1} ${invoker_url_1} ${invoker_request_body_1}= Invoker Default Onboarding + ... invoker_username=${INVOKER_USERNAME}_1 + ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} # Default Invoker Registration and Onboarding - ${register_user_info_invoker_2} ${invoker_url_2} ${invoker_request_body_2}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_2 - ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} + ${register_user_info_invoker_2} ${invoker_url_2} ${invoker_request_body_2}= Invoker Default Onboarding + ... invoker_username=${INVOKER_USERNAME}_2 + ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} # Subscribe to events - ${events_list}= Create List API_INVOKER_ONBOARDED API_INVOKER_OFFBOARDED API_INVOKER_UPDATED + ${events_list}= Create List API_INVOKER_ONBOARDED API_INVOKER_OFFBOARDED API_INVOKER_UPDATED ${event_filter_empty}= Create Capif Event Filter ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_ids} ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_description_published['apiId']} @@ -655,8 +567,10 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ... username=${AMF_PROVIDER_USERNAME} # Check Results - ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event API_INVOKER_ONBOARDED are not applicable. - ${invalid_param_list}= Create List ${invalid_param} + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'aef_ids'} for event API_INVOKER_ONBOARDED are not applicable. + ${invalid_param_list}= Create List ${invalid_param} Check Response Variable Type And Values ... ${resp} ... 400 @@ -681,9 +595,11 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ... verify=ca.crt ... username=${AMF_PROVIDER_USERNAME} - # Check Results - ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event API_INVOKER_OFFBOARDED are not applicable. - ${invalid_param_list}= Create List ${invalid_param} + # Check Results + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'aef_ids'} for event API_INVOKER_OFFBOARDED are not applicable. + ${invalid_param_list}= Create List ${invalid_param} Check Response Variable Type And Values ... ${resp} ... 400 @@ -708,9 +624,11 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ... verify=ca.crt ... username=${AMF_PROVIDER_USERNAME} - # Check Results - ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event API_INVOKER_UPDATED are not applicable. - ${invalid_param_list}= Create List ${invalid_param} + # Check Results + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'aef_ids'} for event API_INVOKER_UPDATED are not applicable. + ${invalid_param_list}= Create List ${invalid_param} Check Response Variable Type And Values ... ${resp} ... 400 @@ -735,9 +653,11 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ... verify=ca.crt ... username=${AMF_PROVIDER_USERNAME} - # Check Results - ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'api_ids'} for event API_INVOKER_UPDATED are not applicable. - ${invalid_param_list}= Create List ${invalid_param} + # Check Results + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'api_ids'} for event API_INVOKER_UPDATED are not applicable. + ${invalid_param_list}= Create List ${invalid_param} Check Response Variable Type And Values ... ${resp} ... 400 @@ -747,6 +667,7 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ... detail=Bad Param ... cause=Invalid eventFilter for event API_INVOKER_UPDATED ... invalidParams=${invalid_param_list} + Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId, only invokerId and both [Tags] event_filter-5 mockserver smoke @@ -754,18 +675,24 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId Init Mock Server # Register provider 1 - ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 + ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 # Publish one api - ${service_api_description_published_1} ${provider_resource_url_1} ${provider_request_body_1}= Publish Service Api + ${service_api_description_published_1} + ... ${provider_resource_url_1} + ... ${provider_request_body_1}= + ... Publish Service Api ... ${register_user_info_provider_1} ... service_name=service_1 # Register APF - ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_2 + ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_2 # Publish one api - ${service_api_description_published_2} ${provider_resource_url_2} ${provider_request_body_2}= Publish Service Api + ${service_api_description_published_2} + ... ${provider_resource_url_2} + ... ${provider_request_body_2}= + ... Publish Service Api ... ${register_user_info_provider_2} ... service_name=service_2 @@ -775,106 +702,72 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId ${service_api_id_2}= Set Variable ${service_api_description_published_2['apiId']} # Register INVOKER 1 - ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 + ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding + ... invoker_username=${INVOKER_USERNAME}_1 ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} # Register INVOKER 2 - ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding invoke_username=${INVOKER_USERNAME}_2 + ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding + ... invoke_username=${INVOKER_USERNAME}_2 ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} - # Subscribe to events ${events_list}= Create List ACCESS_CONTROL_POLICY_UPDATE - # Event filters - ${event_filter_empty}= Create Capif Event Filter + # Create Event filters ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} - ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} - ${event_filter_api_invoker_ids_and_api_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_2} apiIds=${service_api_id_2} + ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} + ${event_filter_api_invoker_ids_and_api_ids}= Create Capif Event Filter + ... apiInvokerIds=${api_invoker_id_2} + ... apiIds=${service_api_id_2} # Subscription to Events 1 - ${event_filters}= Create List ${event_filter_api_ids} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=4 - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${register_user_info_provider_1['amf_username']} - - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} + ${event_filters}= Create List ${event_filter_api_ids} + ${subscription_id_1}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} # Subscription to Events 2 - ${event_filters}= Create List ${event_filter_api_invoker_ids_and_api_ids} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=4 - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${register_user_info_provider_1['amf_username']} - - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id_2}= Check Event Location Header ${resp} + ${event_filters}= Create List ${event_filter_api_invoker_ids} + ${subscription_id_2}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} # Subscription to Events 3 - ${event_filters}= Create List ${event_filter_api_invoker_ids} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=4 - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${register_user_info_provider_1['amf_username']} - - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id_3}= Check Event Location Header ${resp} - + ${event_filters}= Create List ${event_filter_api_invoker_ids_and_api_ids} + ${subscription_id_3}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} # Create Security Contexts and ACLs - ${acl_provider_1}= Create Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_1} - ${acl_provider_1}= Create Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_1} + ${acl_provider_1}= + ... Create Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_1} + ${acl_provider_1}= + ... Create Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_1} - ${acl_provider_2}= Update Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_2} - ${acl_provider_2}= Update Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_2} + ${acl_provider_2}= + ... Update Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_2} + ${acl_provider_2}= + ... Update Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_2} # Check Event Notifications ## Create check Events to ensure all notifications were received ### Subscription 1 Checks - ${acl_to_check}= Create List ${acl_provider_1[0]} + ${acl_to_check}= Create List ${acl_provider_1[0]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} ... ${service_api_id_1} ... ${acl_to_check} - ${acl_to_check}= Create List ${acl_provider_1[1]} + ${acl_to_check}= Create List ${acl_provider_1[1]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} ... ${service_api_id_1} ... ${acl_to_check} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_1[0]} + ${acl_to_check}= Create List ${acl_provider_1[0]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} ... ${service_api_id_1} ... ${acl_to_check} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_1[1]} + ${acl_to_check}= Create List ${acl_provider_1[1]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} ... ${service_api_id_1} @@ -882,29 +775,29 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId ... events_expected=${events_expected} ### Subscription 2 checks - ${acl_to_check}= Create List ${acl_provider_2[1]} + ${acl_to_check}= Create List ${acl_provider_1[0]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_2} - ... ${service_api_id_2} + ... ${service_api_id_1} ... ${acl_to_check} ... events_expected=${events_expected} - ### Subscription 3 checks - ${acl_to_check}= Create List ${acl_provider_1[0]} + ${acl_to_check}= Create List ${acl_provider_1[0]} ${events_expected}= Create Expected Access Control Policy Update Event - ... ${subscription_id_3} + ... ${subscription_id_2} ... ${service_api_id_1} ... ${acl_to_check} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_1[0]} + ${acl_to_check}= Create List ${acl_provider_2[0]} ${events_expected}= Create Expected Access Control Policy Update Event - ... ${subscription_id_3} - ... ${service_api_id_1} + ... ${subscription_id_2} + ... ${service_api_id_2} ... ${acl_to_check} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_2[0]} + ### Subscription 3 checks + ${acl_to_check}= Create List ${acl_provider_2[1]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_3} ... ${service_api_id_2} @@ -916,19 +809,22 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} - Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by aefId - [Tags] event_filter-6 smoke + [Tags] event_filter-6 smoke # Initialize Mock server Init Mock Server # Register provider 1 - ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 - ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 + ${aef_id_1}= Set Variable + ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} # Publish one api - ${service_api_description_published_1} ${provider_resource_url_1} ${provider_request_body_1}= Publish Service Api + ${service_api_description_published_1} + ... ${provider_resource_url_1} + ... ${provider_request_body_1}= + ... Publish Service Api ... ${register_user_info_provider_1} ... service_name=service_1 @@ -939,10 +835,10 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by aefId ${events_list}= Create List ACCESS_CONTROL_POLICY_UPDATE # Event filters - ${event_filter_aef_id}= Create Capif Event Filter aefIds=${aef_id_1} + ${event_filter_aef_id}= Create Capif Event Filter aefIds=${aef_id_1} # Subscription to Events 1 - ${event_filters}= Create List ${event_filter_aef_id} + ${event_filters}= Create List ${event_filter_aef_id} ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing @@ -956,8 +852,10 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by aefId ... username=${register_user_info_provider_1['amf_username']} # Check Results - ${invalid_param}= Create Dictionary param=eventFilter reason=The eventFilter {'aef_ids'} for event ACCESS_CONTROL_POLICY_UPDATE are not applicable. - ${invalid_param_list}= Create List ${invalid_param} + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'aef_ids'} for event ACCESS_CONTROL_POLICY_UPDATE are not applicable. + ${invalid_param_list}= Create List ${invalid_param} Check Response Variable Type And Values ... ${resp} ... 400 @@ -975,18 +873,28 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION Init Mock Server # Register provider 1 - ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 + ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 + ${aef_id_1}= Set Variable + ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} # Publish one api - ${service_api_description_published_1} ${provider_resource_url_1} ${provider_request_body_1}= Publish Service Api + ${service_api_description_published_1} + ... ${provider_resource_url_1} + ... ${provider_request_body_1}= + ... Publish Service Api ... ${register_user_info_provider_1} ... service_name=service_1 # Register APF - ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_2 + ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_2 + ${aef_id_2}= Set Variable + ... ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_2']['aef_id']} # Publish one api - ${service_api_description_published_2} ${provider_resource_url_2} ${provider_request_body_2}= Publish Service Api + ${service_api_description_published_2} + ... ${provider_resource_url_2} + ... ${provider_request_body_2}= + ... Publish Service Api ... ${register_user_info_provider_2} ... service_name=service_2 @@ -996,106 +904,136 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION ${service_api_id_2}= Set Variable ${service_api_description_published_2['apiId']} # Register INVOKER 1 - ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding invoker_username=${INVOKER_USERNAME}_1 + ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding + ... invoker_username=${INVOKER_USERNAME}_1 ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} # Register INVOKER 2 - ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding invoke_username=${INVOKER_USERNAME}_2 + ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding + ... invoke_username=${INVOKER_USERNAME}_2 ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} - # Subscribe to events - ${events_list}= Create List ACCESS_CONTROL_POLICY_UPDATE + ## Event lists + ${events_list}= Create List SERVICE_API_INVOCATION_SUCCESS SERVICE_API_INVOCATION_FAILURE - # Event filters + ## Event filters ${event_filter_empty}= Create Capif Event Filter ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} - ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} - ${event_filter_api_invoker_ids_and_api_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_2} apiIds=${service_api_id_2} + ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} + ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_id_1} + ${event_filter_api_ids_and_aef_ids}= Create Capif Event Filter + ... apiIds=${service_api_id_2} + ... aefIds=${aef_id_2} + ${event_filter_api_ids_and_api_invoker_ids}= Create Capif Event Filter + ... apiInvokerIds=${api_invoker_id_2} + ... apiIds=${service_api_id_2} + ${event_filter_aef_ids_and_api_invoker_ids}= Create Capif Event Filter + ... apiInvokerIds=${api_invoker_id_2} + ... aefIds=${aef_id_2} + ${event_filter_api_ids_aef_ids_and_api_invoker_ids}= Create Capif Event Filter + ... apiInvokerIds=${api_invoker_id_2} + ... aefIds=${aef_id_2} + ... apiIds=${service_api_id_2} + + ## Subscription to Events 1 + ${event_filters}= Create List ${event_filter_api_ids} + ${subscription_id_1}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 2 + ${event_filters}= Create List ${event_filter_aef_ids} + ${subscription_id_2}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 3 + ${event_filters}= Create List ${event_filter_api_invoker_ids} + ${subscription_id_3}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 4 + ${event_filters}= Create List ${event_filter_api_ids_and_aef_ids} + ${subscription_id_4}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 5 + ${event_filters}= Create List ${event_filter_api_ids_and_api_invoker_ids} + ${subscription_id_5}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 6 + ${event_filters}= Create List ${event_filter_aef_ids_and_api_invoker_ids} + ${subscription_id_6}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 7 + ${event_filters}= Create List ${event_filter_api_ids_aef_ids_and_api_invoker_ids} + ${subscription_id_7}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - # Subscription to Events 1 - ${event_filters}= Create List ${event_filter_api_ids} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=4 - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${register_user_info_provider_1['amf_username']} + # Create Security Contexts and ACLs + ${acl_provider_1}= + ... Create Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_1} + ${acl_provider_1}= + ... Create Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_1} - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} + ${acl_provider_2}= + ... Update Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_2} + ${acl_provider_2}= + ... Update Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_2} - # Subscription to Events 2 - ${event_filters}= Create List ${event_filter_api_invoker_ids_and_api_ids} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=4 - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions - ... json=${request_body} + # Create Log Entry, emulate success and failure api invocation + ${discover_response}= Get Request Capif + ... ${DISCOVER_URL}${register_user_info_invoker_1['api_invoker_id']} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt - ... username=${register_user_info_provider_1['amf_username']} + ... username=${register_user_info_invoker_1['management_cert']} - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id_2}= Check Event Location Header ${resp} + ${api_ids} ${api_names}= Get Api Ids And Names From Discover Response ${discover_response} - # Subscription to Events 3 - ${event_filters}= Create List ${event_filter_api_invoker_ids} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=4 - ... event_filters=${event_filters} + ${results}= Create List 200 400 + ${request_body}= Create Log Entry + ... ${register_user_info_provider_1['aef_id']} + ... ${register_user_info_invoker_1['api_invoker_id']} + ... ${api_ids} + ... ${api_names} + ... results=${results} ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions + ... /api-invocation-logs/v1/${register_user_info_provider_1['aef_id']}/logs ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt ... username=${register_user_info_provider_1['amf_username']} - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id_3}= Check Event Location Header ${resp} - + Check Response Variable Type And Values ${resp} 201 InvocationLog + ${resource_url}= Check Location Header ${resp} ${LOCATION_LOGGING_RESOURCE_REGEX} - # Create Security Contexts and ACLs - ${acl_provider_1}= Create Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_1} - ${acl_provider_1}= Create Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_1} + # Check Event Notifications + ## Create check Events to ensure all notifications were received + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_1} + ... ${request_body} + ## Check Events Expected towards received notifications at mock server + Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} - ${acl_provider_2}= Update Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_2} - ${acl_provider_2}= Update Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_2} # Check Event Notifications ## Create check Events to ensure all notifications were received ### Subscription 1 Checks - ${acl_to_check}= Create List ${acl_provider_1[0]} + ${acl_to_check}= Create List ${acl_provider_1[0]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} ... ${service_api_id_1} ... ${acl_to_check} - ${acl_to_check}= Create List ${acl_provider_1[1]} + ${acl_to_check}= Create List ${acl_provider_1[1]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} ... ${service_api_id_1} ... ${acl_to_check} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_1[0]} + ${acl_to_check}= Create List ${acl_provider_1[0]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} ... ${service_api_id_1} ... ${acl_to_check} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_1[1]} + ${acl_to_check}= Create List ${acl_provider_1[1]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_1} ... ${service_api_id_1} @@ -1103,7 +1041,7 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION ... events_expected=${events_expected} ### Subscription 2 checks - ${acl_to_check}= Create List ${acl_provider_2[1]} + ${acl_to_check}= Create List ${acl_provider_2[1]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_2} ... ${service_api_id_2} @@ -1111,21 +1049,21 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION ... events_expected=${events_expected} ### Subscription 3 checks - ${acl_to_check}= Create List ${acl_provider_1[0]} + ${acl_to_check}= Create List ${acl_provider_1[0]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_3} ... ${service_api_id_1} ... ${acl_to_check} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_1[0]} + ${acl_to_check}= Create List ${acl_provider_1[0]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_3} ... ${service_api_id_1} ... ${acl_to_check} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_2[0]} + ${acl_to_check}= Create List ${acl_provider_2[0]} ${events_expected}= Create Expected Access Control Policy Update Event ... ${subscription_id_3} ... ${service_api_id_2} @@ -1135,4 +1073,131 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION Log List ${events_expected} ## Check Events Expected towards received notifications at mock server - Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} \ No newline at end of file + Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} + + +*** Keywords *** +Create Security Context between ${invoker_info} and ${provider_info} + # Discover APIs by invoker + ${discover_response}= Get Request Capif + ... ${DISCOVER_URL}${invoker_info['api_invoker_id']}&aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + Check Response Variable Type And Values ${discover_response} 200 DiscoveredAPIs + + # create Security Context + ${request_service_security_body} ${api_ids}= Create Service Security From Discover Response + ... http://${CAPIF_HOSTNAME}:${CAPIF_HTTP_PORT}/test + ... ${discover_response} + ... legacy=${FALSE} + ${resp}= Put Request Capif + ... /capif-security/v1/trustedInvokers/${invoker_info['api_invoker_id']} + ... json=${request_service_security_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + Set To Dictionary ${invoker_info} security_body=${request_service_security_body} + # Check Service Security + Check Response Variable Type And Values ${resp} 201 ServiceSecurity + ${resource_url}= Check Location Header ${resp} ${LOCATION_SECURITY_RESOURCE_REGEX} + + ${api_invoker_policies_list}= Create List + + FOR ${api_id} IN @{api_ids} + Log ${api_id} + ${resp}= Get Request Capif + ... /access-control-policy/v1/accessControlPolicyList/${api_id}?aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${provider_info['aef_username']} + + Check Response Variable Type And Values ${resp} 200 AccessControlPolicyList + # Check returned values + Should Not Be Empty ${resp.json()['apiInvokerPolicies']} + # Length Should Be ${resp.json()['apiInvokerPolicies']} 1 + # Should Be Equal As Strings + # ... ${resp.json()['apiInvokerPolicies'][0]['apiInvokerId']} + # ... ${invoker_info['api_invoker_id']} + + ${api_invoker_policies}= Set Variable ${resp.json()['apiInvokerPolicies']} + # Append To List ${api_invoker_policies_list} ${api_invoker_policies} + ${api_invoker_policies_list}= Set Variable ${api_invoker_policies} + END + + Log List ${api_invoker_policies_list} + + RETURN ${api_invoker_policies_list} + +Update Security Context between ${invoker_info} and ${provider_info} + # Discover APIs by invoker + ${discover_response}= Get Request Capif + ... ${DISCOVER_URL}${invoker_info['api_invoker_id']}&aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + Check Response Variable Type And Values ${discover_response} 200 DiscoveredAPIs + + # create Security Context + ${request_service_security_body} ${api_ids}= Update Service Security With Discover Response + ... ${invoker_info['security_body']} + ... ${discover_response} + ... legacy=${FALSE} + ${resp}= Post Request Capif + ... /capif-security/v1/trustedInvokers/${invoker_info['api_invoker_id']}/update + ... json=${request_service_security_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + # Check Service Security + Check Response Variable Type And Values ${resp} 200 ServiceSecurity + ${resource_url}= Check Location Header ${resp} ${LOCATION_SECURITY_RESOURCE_REGEX} + + ${api_invoker_policies_list}= Create List + + ${api_id}= Get From List ${api_ids} -1 + Log ${api_id} + ${resp}= Get Request Capif + ... /access-control-policy/v1/accessControlPolicyList/${api_id}?aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${provider_info['aef_username']} + + Check Response Variable Type And Values ${resp} 200 AccessControlPolicyList + # Check returned values + Should Not Be Empty ${resp.json()['apiInvokerPolicies']} + # Length Should Be ${resp.json()['apiInvokerPolicies']} 1 + # Should Be Equal As Strings + # ... ${resp.json()['apiInvokerPolicies'][0]['apiInvokerId']} + # ... ${invoker_info['api_invoker_id']} + + ${api_invoker_policies}= Set Variable ${resp.json()['apiInvokerPolicies']} + # Append To List ${api_invoker_policies_list} ${api_invoker_policies} + ${api_invoker_policies_list}= Set Variable ${api_invoker_policies} + + Log List ${api_invoker_policies_list} + + RETURN ${api_invoker_policies_list} + +Subscribe provider ${provider_info} to events ${events_list} with event filters ${event_filters} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=4 + ... event_filters=${event_filters} + ${resp}= Post Request Capif + ... /capif-events/v1/${provider_info['amf_id']}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${provider_info['amf_username']} + + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + + RETURN ${subscription_id} + -- GitLab From 59d7c7f12d890f70389cffd2d3abd0dbac400915 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 5 Mar 2025 13:04:08 +0100 Subject: [PATCH 042/157] New test for event filters and INVOCATION events --- .../features/Event Filter/event_filter.robot | 214 +++++++++--------- tests/resources/common/expectedMessages.robot | 1 + 2 files changed, 108 insertions(+), 107 deletions(-) diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index 5bc3a112..2172d74a 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -723,15 +723,18 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId # Subscription to Events 1 ${event_filters}= Create List ${event_filter_api_ids} - ${subscription_id_1}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + ${subscription_id_1}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} # Subscription to Events 2 ${event_filters}= Create List ${event_filter_api_invoker_ids} - ${subscription_id_2}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + ${subscription_id_2}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} # Subscription to Events 3 ${event_filters}= Create List ${event_filter_api_invoker_ids_and_api_ids} - ${subscription_id_3}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + ${subscription_id_3}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} # Create Security Contexts and ACLs ${acl_provider_1}= @@ -915,13 +918,13 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION # Subscribe to events ## Event lists - ${events_list}= Create List SERVICE_API_INVOCATION_SUCCESS SERVICE_API_INVOCATION_FAILURE + ${events_list}= Create List SERVICE_API_INVOCATION_SUCCESS SERVICE_API_INVOCATION_FAILURE ## Event filters ${event_filter_empty}= Create Capif Event Filter ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} - ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_id_1} + ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_id_2} ${event_filter_api_ids_and_aef_ids}= Create Capif Event Filter ... apiIds=${service_api_id_2} ... aefIds=${aef_id_2} @@ -930,152 +933,129 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION ... apiIds=${service_api_id_2} ${event_filter_aef_ids_and_api_invoker_ids}= Create Capif Event Filter ... apiInvokerIds=${api_invoker_id_2} - ... aefIds=${aef_id_2} + ... aefIds=${aef_id_1} ${event_filter_api_ids_aef_ids_and_api_invoker_ids}= Create Capif Event Filter ... apiInvokerIds=${api_invoker_id_2} ... aefIds=${aef_id_2} ... apiIds=${service_api_id_2} ## Subscription to Events 1 - ${event_filters}= Create List ${event_filter_api_ids} - ${subscription_id_1}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + ${event_filters}= Create List ${event_filter_api_ids} ${event_filter_api_ids} + ${subscription_id_1}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - ## Subscription to Events 2 - ${event_filters}= Create List ${event_filter_aef_ids} - ${subscription_id_2}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + # ## Subscription to Events 2 + ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_aef_ids} + ${subscription_id_2}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} ## Subscription to Events 3 - ${event_filters}= Create List ${event_filter_api_invoker_ids} - ${subscription_id_3}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + ${event_filters}= Create List ${event_filter_api_invoker_ids} ${event_filter_api_invoker_ids} + ${subscription_id_3}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - ## Subscription to Events 4 - ${event_filters}= Create List ${event_filter_api_ids_and_aef_ids} - ${subscription_id_4}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + # ## Subscription to Events 4 + ${event_filters}= Create List ${event_filter_api_ids_and_aef_ids} ${event_filter_api_ids_and_aef_ids} + ${subscription_id_4}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - ## Subscription to Events 5 - ${event_filters}= Create List ${event_filter_api_ids_and_api_invoker_ids} - ${subscription_id_5}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + # ## Subscription to Events 5 + ${event_filters}= Create List ${event_filter_api_ids_and_api_invoker_ids} ${event_filter_api_ids_and_api_invoker_ids} + ${subscription_id_5}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - ## Subscription to Events 6 - ${event_filters}= Create List ${event_filter_aef_ids_and_api_invoker_ids} - ${subscription_id_6}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + # ## Subscription to Events 6 + ${event_filters}= Create List ${event_filter_aef_ids_and_api_invoker_ids} ${event_filter_aef_ids_and_api_invoker_ids} + ${subscription_id_6}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - ## Subscription to Events 7 - ${event_filters}= Create List ${event_filter_api_ids_aef_ids_and_api_invoker_ids} - ${subscription_id_7}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + # ## Subscription to Events 7 + ${event_filters}= Create List ${event_filter_api_ids_aef_ids_and_api_invoker_ids} ${event_filter_api_ids_aef_ids_and_api_invoker_ids} + ${subscription_id_7}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - # Create Security Contexts and ACLs - ${acl_provider_1}= - ... Create Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_1} - ${acl_provider_1}= - ... Create Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_1} + # 1.Log entry for service_1 and invoker_1 + ${request_body_log_1}= Send Log Message to CAPIF ${service_api_id_1} service_1 ${register_user_info_invoker_1} ${register_user_info_provider_1} 200 400 - ${acl_provider_2}= - ... Update Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_2} - ${acl_provider_2}= - ... Update Security Context between ${register_user_info_invoker_2} and ${register_user_info_provider_2} + # 2.Log entry for service_2 and invoker_1 + ${request_body_log_2}= Send Log Message to CAPIF ${service_api_id_2} service_2 ${register_user_info_invoker_1} ${register_user_info_provider_2} 200 - # Create Log Entry, emulate success and failure api invocation - ${discover_response}= Get Request Capif - ... ${DISCOVER_URL}${register_user_info_invoker_1['api_invoker_id']} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${register_user_info_invoker_1['management_cert']} - - ${api_ids} ${api_names}= Get Api Ids And Names From Discover Response ${discover_response} + # 3.Log entry for service_2 and invoker_2 + ${request_body_log_3}= Send Log Message to CAPIF ${service_api_id_2} service_2 ${register_user_info_invoker_2} ${register_user_info_provider_2} 200 - ${results}= Create List 200 400 - ${request_body}= Create Log Entry - ... ${register_user_info_provider_1['aef_id']} - ... ${register_user_info_invoker_1['api_invoker_id']} - ... ${api_ids} - ... ${api_names} - ... results=${results} - ${resp}= Post Request Capif - ... /api-invocation-logs/v1/${register_user_info_provider_1['aef_id']}/logs - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${register_user_info_provider_1['amf_username']} - - Check Response Variable Type And Values ${resp} 201 InvocationLog - ${resource_url}= Check Location Header ${resp} ${LOCATION_LOGGING_RESOURCE_REGEX} + # 4.Log entry for service_1 and invoker_2 + ${request_body_log_4}= Send Log Message to CAPIF ${service_api_id_1} service_1 ${register_user_info_invoker_2} ${register_user_info_provider_1} 400 # Check Event Notifications ## Create check Events to ensure all notifications were received + ### Subscription 1 Checks ${events_expected}= Create Events From InvocationLogs ... ${subscription_id_1} - ... ${request_body} - ## Check Events Expected towards received notifications at mock server - Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} - + ... ${request_body_log_1} - # Check Event Notifications - ## Create check Events to ensure all notifications were received - ### Subscription 1 Checks - ${acl_to_check}= Create List ${acl_provider_1[0]} - ${events_expected}= Create Expected Access Control Policy Update Event + ${events_expected}= Create Events From InvocationLogs ... ${subscription_id_1} - ... ${service_api_id_1} - ... ${acl_to_check} + ... ${request_body_log_4} + ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_1[1]} - ${events_expected}= Create Expected Access Control Policy Update Event - ... ${subscription_id_1} - ... ${service_api_id_1} - ... ${acl_to_check} + ### Subcription 2 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_2} + ... ${request_body_log_2} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_1[0]} - ${events_expected}= Create Expected Access Control Policy Update Event - ... ${subscription_id_1} - ... ${service_api_id_1} - ... ${acl_to_check} + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_2} + ... ${request_body_log_3} + ... events_expected=${events_expected} + + # Subscription 3 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_3} + ... ${request_body_log_1} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_1[1]} - ${events_expected}= Create Expected Access Control Policy Update Event - ... ${subscription_id_1} - ... ${service_api_id_1} - ... ${acl_to_check} + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_3} + ... ${request_body_log_2} ... events_expected=${events_expected} - ### Subscription 2 checks - ${acl_to_check}= Create List ${acl_provider_2[1]} - ${events_expected}= Create Expected Access Control Policy Update Event - ... ${subscription_id_2} - ... ${service_api_id_2} - ... ${acl_to_check} + # Subscription 4 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_4} + ... ${request_body_log_2} ... events_expected=${events_expected} - ### Subscription 3 checks - ${acl_to_check}= Create List ${acl_provider_1[0]} - ${events_expected}= Create Expected Access Control Policy Update Event - ... ${subscription_id_3} - ... ${service_api_id_1} - ... ${acl_to_check} + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_4} + ... ${request_body_log_3} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_1[0]} - ${events_expected}= Create Expected Access Control Policy Update Event - ... ${subscription_id_3} - ... ${service_api_id_1} - ... ${acl_to_check} + # Subscription 5 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_5} + ... ${request_body_log_3} ... events_expected=${events_expected} - ${acl_to_check}= Create List ${acl_provider_2[0]} - ${events_expected}= Create Expected Access Control Policy Update Event - ... ${subscription_id_3} - ... ${service_api_id_2} - ... ${acl_to_check} + # Subscription 6 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_6} + ... ${request_body_log_4} + ... events_expected=${events_expected} + + # Subscription 7 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_7} + ... ${request_body_log_3} ... events_expected=${events_expected} - Log List ${events_expected} + Log List ${events_expected} ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} + *** Keywords *** Create Security Context between ${invoker_info} and ${provider_info} # Discover APIs by invoker @@ -1200,4 +1180,24 @@ Subscribe provider ${provider_info} to events ${events_list} with event filters ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} RETURN ${subscription_id} +Send Log Message to CAPIF + [Arguments] ${api_id} ${service_name} ${invoker_info} ${provider_info} @{results} + ${api_ids}= Create List ${api_id} + ${api_names}= Create List ${service_name} + ${request_body}= Create Log Entry + ... ${provider_info['aef_id']} + ... ${invoker_info['api_invoker_id']} + ... ${api_ids} + ... ${api_names} + ... results=@{results} + ${resp}= Post Request Capif + ... /api-invocation-logs/v1/${provider_info['aef_id']}/logs + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${provider_info['amf_username']} + + Check Response Variable Type And Values ${resp} 201 InvocationLog + ${resource_url}= Check Location Header ${resp} ${LOCATION_LOGGING_RESOURCE_REGEX} + RETURN ${request_body} diff --git a/tests/resources/common/expectedMessages.robot b/tests/resources/common/expectedMessages.robot index 65e6ac6f..346dfd76 100644 --- a/tests/resources/common/expectedMessages.robot +++ b/tests/resources/common/expectedMessages.robot @@ -12,6 +12,7 @@ Create Events From InvocationLogs ... ${invocation_log} ... ${events_expected}=${NONE} ... ${event_detail_expected}=${TRUE} + IF ${events_expected} == ${NONE} ${events_expected}= Create List END -- GitLab From e273685c4ee6449d7510e60873d6348322cadeca Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Thu, 6 Mar 2025 08:43:56 +0100 Subject: [PATCH 043/157] Setup transient version on OCF --- services/variables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/variables.sh b/services/variables.sh index 748c8c0a..1fa65aa2 100755 --- a/services/variables.sh +++ b/services/variables.sh @@ -9,7 +9,7 @@ export ROBOT_DOCKER_FILE_FOLDER=$CAPIF_BASE_DIR/tools/robot # Image URL and version export REGISTRY_BASE_URL="labs.etsi.org:5050/ocf/capif/prod" -export OCF_VERSION="v2.0.0-release" +export OCF_VERSION="v2.x.x-release" # Capif hostname export CAPIF_HOSTNAME=capifcore -- GitLab From 1096cec4aec820b34b2ca494f15d5d06bcad9c90 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 6 Mar 2025 09:13:42 +0100 Subject: [PATCH 044/157] Register conf --- services/register/config.yaml.bak | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 services/register/config.yaml.bak diff --git a/services/register/config.yaml.bak b/services/register/config.yaml.bak new file mode 100644 index 00000000..3d3a42b9 --- /dev/null +++ b/services/register/config.yaml.bak @@ -0,0 +1,38 @@ +mongo: { + 'user': 'root', + 'password': 'example', + 'db': 'capif_users', + 'col': 'user', + 'col_capifConfiguration': "capifConfiguration", + 'admins': 'admins', + 'host': 'mongo_register', + 'port': '27017' +} +ca_factory: { + "url": "vault", + "port": "8200", + "token": "dev-only-token", + "verify": False +} + +ccf: { + "url": "capifcore", + "helper_remove_user": "/helper/deleteEntities/" +} + +register: { + "register_uuid": '6ba7b810-9dad-11d1-80b4-00c04fd430c8', + "refresh_expiration": 30, #days + "token_expiration": 10, #mins + "admin_users": {admin_user: "admin", + admin_pass: "password123"} +} + +capifConfiguration: { + "config_name": "default", + "version": "1.0", + "description": "Default Register Configuration", + "settings": { + ttl_superadmin_cert: "4300h" + } +} -- GitLab From 8ccfed03a1880813d87277a61cd5c66bc8f18d3e Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Thu, 6 Mar 2025 10:56:03 +0100 Subject: [PATCH 045/157] Rewrite new tests in order to clarify steps on event filter test suite --- .../features/Event Filter/event_filter.robot | 644 ++++++------------ 1 file changed, 224 insertions(+), 420 deletions(-) diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index 2172d74a..b6718ce2 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -28,29 +28,28 @@ Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - # Register APF - ${register_user_info_provider}= Provider Default Registration total_aef_roles=2 - - ${aef_id_1}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} - ${aef_id_2}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + # Create Provider1 with 2 AEF roles and publish API + ${register_user_info_provider_1}= Provider Default Registration total_aef_roles=2 + ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} + ${aef_id_2}= Set Variable + ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} ${aef_empty_list}= Create List - # Publish api with 2 aefIds - ${service_api_description_published} ${resource_url} ${request_body}= Publish Service Api - ... ${register_user_info_provider} + ## Publish API service_1 with 2 aefIds + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider_1} ... service_1 ... aef_id=${aef_ids} ... api_status=${aef_empty_list} ... supported_features=020 - # Register other provider + # Create Provider2 with 1 AEF role and publish API ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_NEW - ${aef2_id_1}= Set Variable ... ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} - # Publish api with other provider + ## Publish API service_2 with Provider2 ${service_api_description_published_2} ${resource_url_2} ${request_body_2}= Publish Service Api ... ${register_user_info_provider_2} ... service_2 @@ -58,7 +57,7 @@ Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... api_status=${aef2_id_1} ... supported_features=020 - # Discover APIs by invoker + # Discover APIs by Invoker filtering by aefId1 of Provider1 ${resp}= Get Request Capif ... ${DISCOVER_URL}${register_user_info_invoker['api_invoker_id']}&aef-id=${aef_id_1} ... server=${CAPIF_HTTPS_URL} @@ -66,35 +65,20 @@ Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... username=${INVOKER_USERNAME} Check Response Variable Type And Values ${resp} 200 DiscoveredAPIs - - # # Check Results Dictionary Should Contain Key ${resp.json()} serviceAPIDescriptions Should Not Be Empty ${resp.json()['serviceAPIDescriptions']} Length Should Be ${resp.json()['serviceAPIDescriptions']} 1 - List Should Contain Value ${resp.json()['serviceAPIDescriptions']} ${service_api_description_published} + List Should Contain Value ${resp.json()['serviceAPIDescriptions']} ${service_api_description_published_1} + ## Store apiId for further use ${api_id}= Set Variable ${resp.json()['serviceAPIDescriptions'][0]['apiId']} - # Subscribe to events + # Subscribe to events and setup event filter with api_id ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE SERVICE_API_UPDATE ${event_filter}= Create Capif Event Filter apiIds=${api_id} ${event_filters}= Create List ${event_filter} ${event_filter} ${event_filter} - - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${INVOKER_USERNAME} - - # Check Results - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + ${subscription_id}= + ... Subscribe invoker ${register_user_info_invoker} to events ${events_list} with event filters ${event_filters} # Update Request to published API ${service_api_description_modified}= Create Service Api Description @@ -113,26 +97,25 @@ Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... apiName=service_1 Dictionary Should Contain Key ${resp.json()} apiStatus - # Provider Remove service_1 published API + # Remove Providers + ## Remove Provider1 ${resp}= Delete Request Capif ... ${resource_url.path} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt ... username=${APF_PROVIDER_USERNAME} - Status Should Be 204 ${resp} - # Provider 2 Remove service_1 published API + ## Remove Provider2 ${resp}= Delete Request Capif ... ${resource_url_2.path} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt ... username=${APF_PROVIDER_USERNAME}_NEW - Status Should Be 204 ${resp} - # Check Event Notifications - ## Create check Events to ensure all notifications were received + # Create check Events to ensure all notifications were received + ## Service API Available event ${service_api_available_resources}= Create List ${resource_url} ${events_expected}= Create Expected Events For Service API Notifications ... subscription_id=${subscription_id} @@ -142,6 +125,7 @@ Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... service_api_description=${service_api_description_modified} Log List ${events_expected} + ## Service API Update event ${events_expected}= Create Expected Service Update Event ... subscription_id=${subscription_id} ... service_api_resource=${resource_url} @@ -149,6 +133,7 @@ Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... events_expected=${events_expected} Log List ${events_expected} + ## Service API Unavailable event ${service_api_unavailable_resources}= Create List ${resource_url} ${events_expected}= Create Expected Events For Service API Notifications ... subscription_id=${subscription_id} @@ -159,41 +144,36 @@ Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... events_expected=${events_expected} Log List ${events_expected} - ## Check Events Expected towards received notifications at mock server + # Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE_API_UPDATE events filtered by not valid filters - [Tags] event_filter-2 mockserver - - # Initialize Mock server - Init Mock Server + [Tags] event_filter-2 # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - # Register APF - ${register_user_info_provider}= Provider Default Registration total_aef_roles=2 - - ${aef_id_1}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} - ${aef_id_2}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + # Create Provider1 with 2 AEF roles and publish API + ${register_user_info_provider_1}= Provider Default Registration total_aef_roles=2 + ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} + ${aef_id_2}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} ${aef_empty_list}= Create List - # Publish api with 2 aefIds + ## Publish API service_1 with 2 aefIds ${service_api_description_published} ${resource_url} ${request_body}= Publish Service Api - ... ${register_user_info_provider} + ... ${register_user_info_provider_1} ... service_1 ... aef_id=${aef_ids} ... api_status=${aef_empty_list} ... supported_features=020 - # Register other provider + # Create Provider2 and publish API ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_NEW - ${aef2_id_1}= Set Variable ... ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_NEW']['aef_id']} - # Publish api with other provider + ## Publish API service_2 ${service_api_description_published_2} ${resource_url_2} ${request_body_2}= Publish Service Api ... ${register_user_info_provider_2} ... service_2 @@ -207,142 +187,61 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt ... username=${INVOKER_USERNAME} - Check Response Variable Type And Values ${resp} 200 DiscoveredAPIs - - # # Check Results Dictionary Should Contain Key ${resp.json()} serviceAPIDescriptions Should Not Be Empty ${resp.json()['serviceAPIDescriptions']} Length Should Be ${resp.json()['serviceAPIDescriptions']} 1 List Should Contain Value ${resp.json()['serviceAPIDescriptions']} ${service_api_description_published} + ## Store apiId for further use ${api_id}= Set Variable ${resp.json()['serviceAPIDescriptions'][0]['apiId']} - # Wrong filter on SERVICE_API_AVAILABLE + # Event Subscription + ## Events list ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE SERVICE_API_UPDATE + + ## Event filters ${event_filter_empty}= Create Capif Event Filter ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_ids} ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_description_published['apiId']} ${event_filter_api_invoker_ids}= Create Capif Event Filter ... apiInvokerIds=${register_user_info_invoker['api_invoker_id']} - ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_empty} ${event_filter_empty} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${INVOKER_USERNAME} + ## Subscription to Events filtering by aefIds SERVICE_API_AVAILABLE event + ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_empty} ${event_filter_empty} + ${resp}= + ... Subscribe ${register_user_info_invoker['api_invoker_id']} with ${register_user_info_invoker['management_cert']} to ${events_list} with ${event_filters} - # Check Results - ${invalid_param}= Create Dictionary - ... param=eventFilter - ... reason=The eventFilter {'aef_ids'} for event SERVICE_API_AVAILABLE are not applicable. - ${invalid_param_list}= Create List ${invalid_param} - Check Response Variable Type And Values - ... ${resp} - ... 400 - ... ProblemDetails - ... title=Bad Request - ... status=400 - ... detail=Bad Param - ... cause=Invalid eventFilter for event SERVICE_API_AVAILABLE - ... invalidParams=${invalid_param_list} + ### Check Error Response + Check not valid ${resp} with event filter aef_ids for event SERVICE_API_AVAILABLE - # Wrong filter on SERVICE_API_UNAVAILABLE + ## Subscription to Events filtering by aefIds SERVICE_API_UNAVAILABLE event ${event_filters}= Create List ${event_filter_empty} ${event_filter_aef_ids} ${event_filter_empty} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${INVOKER_USERNAME} + ${resp}= + ... Subscribe ${register_user_info_invoker['api_invoker_id']} with ${register_user_info_invoker['management_cert']} to ${events_list} with ${event_filters} - # Check Results - ${invalid_param}= Create Dictionary - ... param=eventFilter - ... reason=The eventFilter {'aef_ids'} for event SERVICE_API_UNAVAILABLE are not applicable. - ${invalid_param_list}= Create List ${invalid_param} - Check Response Variable Type And Values - ... ${resp} - ... 400 - ... ProblemDetails - ... title=Bad Request - ... status=400 - ... detail=Bad Param - ... cause=Invalid eventFilter for event SERVICE_API_UNAVAILABLE - ... invalidParams=${invalid_param_list} + ### Check Error Response + Check not valid ${resp} with event filter aef_ids for event SERVICE_API_UNAVAILABLE - # Wrong filter on SERVICE_API_UPDATE + ## Subscription to Events filtering by aefIds SERVICE_API_UPDATE event ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_aef_ids} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${INVOKER_USERNAME} + ${resp}= + ... Subscribe ${register_user_info_invoker['api_invoker_id']} with ${register_user_info_invoker['management_cert']} to ${events_list} with ${event_filters} - # Check Results - ${invalid_param}= Create Dictionary - ... param=eventFilter - ... reason=The eventFilter {'aef_ids'} for event SERVICE_API_UPDATE are not applicable. - ${invalid_param_list}= Create List ${invalid_param} - Check Response Variable Type And Values - ... ${resp} - ... 400 - ... ProblemDetails - ... title=Bad Request - ... status=400 - ... detail=Bad Param - ... cause=Invalid eventFilter for event SERVICE_API_UPDATE - ... invalidParams=${invalid_param_list} + ### Check Error Response + Check not valid ${resp} with event filter aef_ids for event SERVICE_API_UPDATE - # Wrong filter on SERVICE_API_UPDATE with apiIds + ## Subscription to Events filtering by api invoker ids SERVICE_API_UPDATE event ${event_filters}= Create List ... ${event_filter_empty} ... ${event_filter_empty} ... ${event_filter_api_invoker_ids} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${INVOKER_USERNAME} + ${resp}= + ... Subscribe ${register_user_info_invoker['api_invoker_id']} with ${register_user_info_invoker['management_cert']} to ${events_list} with ${event_filters} + + ### Check Error Response + Check not valid ${resp} with event filter api_invoker_ids for event SERVICE_API_UPDATE - # Check Results - ${invalid_param}= Create Dictionary - ... param=eventFilter - ... reason=The eventFilter {'api_invoker_ids'} for event SERVICE_API_UPDATE are not applicable. - ${invalid_param_list}= Create List ${invalid_param} - Check Response Variable Type And Values - ... ${resp} - ... 400 - ... ProblemDetails - ... title=Bad Request - ... status=400 - ... detail=Bad Param - ... cause=Invalid eventFilter for event SERVICE_API_UPDATE - ... invalidParams=${invalid_param_list} Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INVOKER_UPDATED events filtered by invokerIds [Tags] event_filter-3 mockserver @@ -350,78 +249,56 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV # Initialize Mock server Init Mock Server - # Register APF - ${register_user_info_provider}= Provider Default Registration total_aef_roles=2 - - ${aef_id_1}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} - ${aef_id_2}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + # Create Provider1 with 2 AEF roles and publish API + ## Create Provider with 2 AEF roles + ${register_user_info_provider_1}= Provider Default Registration total_aef_roles=2 + ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} + ${aef_id_2}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} ${aef_empty_list}= Create List - # Publish api with 2 aefIds + ## Publish service_1 API ${service_api_description_published} ${resource_url} ${request_body}= Publish Service Api - ... ${register_user_info_provider} + ... ${register_user_info_provider_1} ... service_1 ... aef_id=${aef_ids} ... api_status=${aef_empty_list} ... supported_features=020 - # Subscribe to events + # Event Subscription + ## Event list ${events_list}= Create List API_INVOKER_ONBOARDED + ## Event filters ${event_filter}= Create Capif Event Filter + ## Subscribe API_INVOKER_ONBOARDED event without filters ${event_filters}= Create List ${event_filter} + ${subscription_id_1}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${AMF_PROVIDER_USERNAME} - - # Check Results - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} - - # Default Invoker Registration and Onboarding + # Default Invokers Registration and Onboarding + # Default Invoker 1 Registration and Onboarding ${register_user_info_invoker_1} ${invoker_url_1} ${invoker_request_body_1}= Invoker Default Onboarding ... invoker_username=${INVOKER_USERNAME}_1 ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} - # Default Invoker Registration and Onboarding + # Default Invoker 2 Registration and Onboarding ${register_user_info_invoker_2} ${invoker_url_2} ${invoker_request_body_2}= Invoker Default Onboarding ... invoker_username=${INVOKER_USERNAME}_2 ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} - # Subscribe to events + # Subscribe to events and setup event filter with api_invoker_id + ## Events list ${events_list}= Create List API_INVOKER_ONBOARDED API_INVOKER_OFFBOARDED API_INVOKER_UPDATED + ## Event filters ${event_filter_empty}= Create Capif Event Filter ${event_filter_invoker_id_1}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} ${event_filter_invoker_id_2}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_2} + + ## Subscribe to Invoker events. API_INVOKER_ONBOARDED event can be filtered by apiInvokerId but is not possible to get it before the invoker is registered ${event_filters}= Create List ... ${event_filter_empty} ... ${event_filter_invoker_id_1} ... ${event_filter_invoker_id_2} - - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${AMF_PROVIDER_USERNAME} - - # Check Results - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id_2}= Check Event Location Header ${resp} + ${subscription_id_2}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} # Update Invokers ## Update Invoker 1 @@ -478,7 +355,6 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ${invoker_urls_both}= Create List ${invoker_url_1} ${invoker_url_2} ${invoker_urls_1}= Create List ${invoker_url_1} ${invoker_urls_2}= Create List ${invoker_url_2} - ${empty_list}= Create List ${events_expected}= Create Expected Api Invoker Events ... ${subscription_id_1} ... api_invoker_onboarded_resources=${invoker_urls_both} @@ -500,42 +376,21 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV Init Mock Server # Register APF - ${register_user_info_provider}= Provider Default Registration total_aef_roles=2 + ${register_user_info_provider_1}= Provider Default Registration total_aef_roles=2 - ${aef_id_1}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} - ${aef_id_2}= Set Variable ${register_user_info_provider['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} + ${aef_id_2}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} ${aef_empty_list}= Create List # Publish api with 2 aefIds ${service_api_description_published} ${resource_url} ${request_body}= Publish Service Api - ... ${register_user_info_provider} + ... ${register_user_info_provider_1} ... service_1 ... aef_id=${aef_ids} ... api_status=${aef_empty_list} ... supported_features=020 - # Subscribe to events - ${events_list}= Create List API_INVOKER_ONBOARDED - ${event_filter}= Create Capif Event Filter - ${event_filters}= Create List ${event_filter} - - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${AMF_PROVIDER_USERNAME} - - # Check Results - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id_1}= Check Event Location Header ${resp} - # Default Invoker Registration and Onboarding ${register_user_info_invoker_1} ${invoker_url_1} ${invoker_request_body_1}= Invoker Default Onboarding ... invoker_username=${INVOKER_USERNAME}_1 @@ -552,121 +407,34 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_ids} ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_description_published['apiId']} ${event_filter_invoker_id_2}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_2} - ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_empty} ${event_filter_empty} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${AMF_PROVIDER_USERNAME} + ## Event subscription with event filters by aef_ids + ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_empty} ${event_filter_empty} + ${resp}= Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} - # Check Results - ${invalid_param}= Create Dictionary - ... param=eventFilter - ... reason=The eventFilter {'aef_ids'} for event API_INVOKER_ONBOARDED are not applicable. - ${invalid_param_list}= Create List ${invalid_param} - Check Response Variable Type And Values - ... ${resp} - ... 400 - ... ProblemDetails - ... title=Bad Request - ... status=400 - ... detail=Bad Param - ... cause=Invalid eventFilter for event API_INVOKER_ONBOARDED - ... invalidParams=${invalid_param_list} + ### Check Results + Check not valid ${resp} with event filter aef_ids for event API_INVOKER_ONBOARDED - # Check API_INVOKER_OFFBOARDED + ## Event subcription API_INVOKER_OFFBOARDED filtered by aef_ids ${event_filters}= Create List ${event_filter_empty} ${event_filter_aef_ids} ${event_filter_empty} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${AMF_PROVIDER_USERNAME} + ${resp}= Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} - # Check Results - ${invalid_param}= Create Dictionary - ... param=eventFilter - ... reason=The eventFilter {'aef_ids'} for event API_INVOKER_OFFBOARDED are not applicable. - ${invalid_param_list}= Create List ${invalid_param} - Check Response Variable Type And Values - ... ${resp} - ... 400 - ... ProblemDetails - ... title=Bad Request - ... status=400 - ... detail=Bad Param - ... cause=Invalid eventFilter for event API_INVOKER_OFFBOARDED - ... invalidParams=${invalid_param_list} + ### Check Results + Check not valid ${resp} with event filter aef_ids for event API_INVOKER_OFFBOARDED - # Check API_INVOKER_UPDATED + ## Event subcription API_INVOKER_UPDATED filtered by aef_ids ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_aef_ids} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${AMF_PROVIDER_USERNAME} + ${resp}= Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} - # Check Results - ${invalid_param}= Create Dictionary - ... param=eventFilter - ... reason=The eventFilter {'aef_ids'} for event API_INVOKER_UPDATED are not applicable. - ${invalid_param_list}= Create List ${invalid_param} - Check Response Variable Type And Values - ... ${resp} - ... 400 - ... ProblemDetails - ... title=Bad Request - ... status=400 - ... detail=Bad Param - ... cause=Invalid eventFilter for event API_INVOKER_UPDATED - ... invalidParams=${invalid_param_list} + ### Check Results + Check not valid ${resp} with event filter aef_ids for event API_INVOKER_UPDATED - # Check API_INVOKER_UPDATED + ## Event subcription API_INVOKER_UPDATED filtered by api_ids ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_api_ids} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${AMF_PROVIDER_USERNAME} + ${resp}= Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} - # Check Results - ${invalid_param}= Create Dictionary - ... param=eventFilter - ... reason=The eventFilter {'api_ids'} for event API_INVOKER_UPDATED are not applicable. - ${invalid_param_list}= Create List ${invalid_param} - Check Response Variable Type And Values - ... ${resp} - ... 400 - ... ProblemDetails - ... title=Bad Request - ... status=400 - ... detail=Bad Param - ... cause=Invalid eventFilter for event API_INVOKER_UPDATED - ... invalidParams=${invalid_param_list} + ### Check Results + Check not valid ${resp} with event filter api_ids for event API_INVOKER_UPDATED Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId, only invokerId and both [Tags] event_filter-5 mockserver smoke @@ -674,10 +442,11 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId # Initialize Mock server Init Mock Server - # Register provider 1 + # Create Providers + ## Default Provider 1 Registration ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 - # Publish one api + ## Publish service_1 API ${service_api_description_published_1} ... ${provider_resource_url_1} ... ${provider_request_body_1}= @@ -685,10 +454,10 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId ... ${register_user_info_provider_1} ... service_name=service_1 - # Register APF + ## Default Provider 2 Registration ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_2 - # Publish one api + ## Publish service_2 API ${service_api_description_published_2} ... ${provider_resource_url_2} ... ${provider_request_body_2}= @@ -696,47 +465,50 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId ... ${register_user_info_provider_2} ... service_name=service_2 - # Store apiId1 and apiId2 + ## Store apiId1 and apiId2 for further use ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} - ${service_api_id_2}= Set Variable ${service_api_description_published_2['apiId']} - # Register INVOKER 1 + # Register Invokers + ## Default Invoker1 onboarding ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding ... invoker_username=${INVOKER_USERNAME}_1 - ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} - # Register INVOKER 2 + ## Default Invoker1 onboarding ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding ... invoke_username=${INVOKER_USERNAME}_2 + + ## Store apiInvokerIds for further use + ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} # Subscribe to events + ## Events list ${events_list}= Create List ACCESS_CONTROL_POLICY_UPDATE - # Create Event filters + ## Create Event filters ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} ${event_filter_api_invoker_ids_and_api_ids}= Create Capif Event Filter ... apiInvokerIds=${api_invoker_id_2} ... apiIds=${service_api_id_2} - # Subscription to Events 1 + ## Subscription to Events 1 ${event_filters}= Create List ${event_filter_api_ids} ${subscription_id_1}= ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - # Subscription to Events 2 + ## Subscription to Events 2 ${event_filters}= Create List ${event_filter_api_invoker_ids} ${subscription_id_2}= ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - # Subscription to Events 3 + ## Subscription to Events 3 ${event_filters}= Create List ${event_filter_api_invoker_ids_and_api_ids} ${subscription_id_3}= ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - # Create Security Contexts and ACLs + ## Create Security Contexts and ACLs ${acl_provider_1}= ... Create Security Context between ${register_user_info_invoker_1} and ${register_user_info_provider_1} ${acl_provider_1}= @@ -818,7 +590,8 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by aefId # Initialize Mock server Init Mock Server - # Register provider 1 + # Create Provider + ## Default Provider 1 Registration ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 ${aef_id_1}= Set Variable ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} @@ -831,43 +604,22 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by aefId ... ${register_user_info_provider_1} ... service_name=service_1 - # Store apiId1 and apiId2 + # Store apiId1 ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} # Subscribe to events + ## Event lists ${events_list}= Create List ACCESS_CONTROL_POLICY_UPDATE - # Event filters + ## Event filters ${event_filter_aef_id}= Create Capif Event Filter aefIds=${aef_id_1} - # Subscription to Events 1 + ## Subscription to Events 1 ${event_filters}= Create List ${event_filter_aef_id} - ${request_body}= Create Events Subscription - ... events=@{events_list} - ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=4 - ... event_filters=${event_filters} - ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider_1['amf_id']}/subscriptions - ... json=${request_body} - ... server=${CAPIF_HTTPS_URL} - ... verify=ca.crt - ... username=${register_user_info_provider_1['amf_username']} + ${resp}= Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} - # Check Results - ${invalid_param}= Create Dictionary - ... param=eventFilter - ... reason=The eventFilter {'aef_ids'} for event ACCESS_CONTROL_POLICY_UPDATE are not applicable. - ${invalid_param_list}= Create List ${invalid_param} - Check Response Variable Type And Values - ... ${resp} - ... 400 - ... ProblemDetails - ... title=Bad Request - ... status=400 - ... detail=Bad Param - ... cause=Invalid eventFilter for event ACCESS_CONTROL_POLICY_UPDATE - ... invalidParams=${invalid_param_list} + ### Check Error Response + Check not valid ${resp} with event filter aef_ids for event ACCESS_CONTROL_POLICY_UPDATE Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE filtered by apiId, invokerId, aefId and all of them [Tags] event_filter-7 mockserver smoke @@ -875,12 +627,13 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION # Initialize Mock server Init Mock Server - # Register provider 1 + # Register Providers + ## Default Provider 1 Registration ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 ${aef_id_1}= Set Variable ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} - # Publish one api + ## Publish service_1 API ${service_api_description_published_1} ... ${provider_resource_url_1} ... ${provider_request_body_1}= @@ -888,12 +641,12 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION ... ${register_user_info_provider_1} ... service_name=service_1 - # Register APF + ## Default Provider 2 Registration ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_2 ${aef_id_2}= Set Variable ... ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_2']['aef_id']} - # Publish one api + ## Publish service_2 API ${service_api_description_published_2} ... ${provider_resource_url_2} ... ${provider_request_body_2}= @@ -901,19 +654,21 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION ... ${register_user_info_provider_2} ... service_name=service_2 - # Store apiId1 and apiId2 + ## Store apiId1 and apiId2 for further use ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} - ${service_api_id_2}= Set Variable ${service_api_description_published_2['apiId']} - # Register INVOKER 1 + # Register Invokers + ## Default Invoker 1 Registration and Onboarding ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding ... invoker_username=${INVOKER_USERNAME}_1 - ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} - # Register INVOKER 2 + ## Default Invoker 2 Registration and Onboarding ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding ... invoke_username=${INVOKER_USERNAME}_2 + + ## Store apiInvokerIds for further use + ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} # Subscribe to events @@ -940,51 +695,78 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION ... apiIds=${service_api_id_2} ## Subscription to Events 1 - ${event_filters}= Create List ${event_filter_api_ids} ${event_filter_api_ids} + ${event_filters}= Create List ${event_filter_api_ids} ${event_filter_api_ids} ${subscription_id_1}= ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - # ## Subscription to Events 2 - ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_aef_ids} + ## Subscription to Events 2 + ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_aef_ids} ${subscription_id_2}= ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} ## Subscription to Events 3 - ${event_filters}= Create List ${event_filter_api_invoker_ids} ${event_filter_api_invoker_ids} + ${event_filters}= Create List ${event_filter_api_invoker_ids} ${event_filter_api_invoker_ids} ${subscription_id_3}= ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - # ## Subscription to Events 4 - ${event_filters}= Create List ${event_filter_api_ids_and_aef_ids} ${event_filter_api_ids_and_aef_ids} + ## Subscription to Events 4 + ${event_filters}= Create List ${event_filter_api_ids_and_aef_ids} ${event_filter_api_ids_and_aef_ids} ${subscription_id_4}= ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - # ## Subscription to Events 5 - ${event_filters}= Create List ${event_filter_api_ids_and_api_invoker_ids} ${event_filter_api_ids_and_api_invoker_ids} + ## Subscription to Events 5 + ${event_filters}= Create List + ... ${event_filter_api_ids_and_api_invoker_ids} + ... ${event_filter_api_ids_and_api_invoker_ids} ${subscription_id_5}= ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - # ## Subscription to Events 6 - ${event_filters}= Create List ${event_filter_aef_ids_and_api_invoker_ids} ${event_filter_aef_ids_and_api_invoker_ids} + ## Subscription to Events 6 + ${event_filters}= Create List + ... ${event_filter_aef_ids_and_api_invoker_ids} + ... ${event_filter_aef_ids_and_api_invoker_ids} ${subscription_id_6}= ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - # ## Subscription to Events 7 - ${event_filters}= Create List ${event_filter_api_ids_aef_ids_and_api_invoker_ids} ${event_filter_api_ids_aef_ids_and_api_invoker_ids} + ## Subscription to Events 7 + ${event_filters}= Create List + ... ${event_filter_api_ids_aef_ids_and_api_invoker_ids} + ... ${event_filter_api_ids_aef_ids_and_api_invoker_ids} ${subscription_id_7}= ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} # 1.Log entry for service_1 and invoker_1 - ${request_body_log_1}= Send Log Message to CAPIF ${service_api_id_1} service_1 ${register_user_info_invoker_1} ${register_user_info_provider_1} 200 400 + ${request_body_log_1}= Send Log Message to CAPIF + ... ${service_api_id_1} + ... service_1 + ... ${register_user_info_invoker_1} + ... ${register_user_info_provider_1} + ... 200 + ... 400 # 2.Log entry for service_2 and invoker_1 - ${request_body_log_2}= Send Log Message to CAPIF ${service_api_id_2} service_2 ${register_user_info_invoker_1} ${register_user_info_provider_2} 200 + ${request_body_log_2}= Send Log Message to CAPIF + ... ${service_api_id_2} + ... service_2 + ... ${register_user_info_invoker_1} + ... ${register_user_info_provider_2} + ... 200 # 3.Log entry for service_2 and invoker_2 - ${request_body_log_3}= Send Log Message to CAPIF ${service_api_id_2} service_2 ${register_user_info_invoker_2} ${register_user_info_provider_2} 200 + ${request_body_log_3}= Send Log Message to CAPIF + ... ${service_api_id_2} + ... service_2 + ... ${register_user_info_invoker_2} + ... ${register_user_info_provider_2} + ... 200 # 4.Log entry for service_1 and invoker_2 - ${request_body_log_4}= Send Log Message to CAPIF ${service_api_id_1} service_1 ${register_user_info_invoker_2} ${register_user_info_provider_1} 400 + ${request_body_log_4}= Send Log Message to CAPIF + ... ${service_api_id_1} + ... service_1 + ... ${register_user_info_invoker_2} + ... ${register_user_info_provider_1} + ... 400 # Check Event Notifications ## Create check Events to ensure all notifications were received @@ -1008,7 +790,7 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION ... ${subscription_id_2} ... ${request_body_log_3} ... events_expected=${events_expected} - + # Subscription 3 Checks ${events_expected}= Create Events From InvocationLogs ... ${subscription_id_3} @@ -1049,13 +831,11 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION ... ${request_body_log_3} ... events_expected=${events_expected} - Log List ${events_expected} ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} - *** Keywords *** Create Security Context between ${invoker_info} and ${provider_info} # Discover APIs by invoker @@ -1093,17 +873,9 @@ Create Security Context between ${invoker_info} and ${provider_info} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt ... username=${provider_info['aef_username']} - Check Response Variable Type And Values ${resp} 200 AccessControlPolicyList - # Check returned values Should Not Be Empty ${resp.json()['apiInvokerPolicies']} - # Length Should Be ${resp.json()['apiInvokerPolicies']} 1 - # Should Be Equal As Strings - # ... ${resp.json()['apiInvokerPolicies'][0]['apiInvokerId']} - # ... ${invoker_info['api_invoker_id']} - ${api_invoker_policies}= Set Variable ${resp.json()['apiInvokerPolicies']} - # Append To List ${api_invoker_policies_list} ${api_invoker_policies} ${api_invoker_policies_list}= Set Variable ${api_invoker_policies} END @@ -1164,24 +936,40 @@ Update Security Context between ${invoker_info} and ${provider_info} RETURN ${api_invoker_policies_list} Subscribe provider ${provider_info} to events ${events_list} with event filters ${event_filters} + ${resp}= + ... Subscribe ${provider_info['amf_id']} with ${provider_info['amf_username']} to ${events_list} with ${event_filters} + + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + + RETURN ${subscription_id} + +Subscribe invoker ${invoker_info} to events ${events_list} with event filters ${event_filters} + ${resp}= + ... Subscribe ${invoker_info['api_invoker_id']} with ${invoker_info['management_cert']} to ${events_list} with ${event_filters} + + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + + RETURN ${subscription_id} + +Subscribe ${subscriber_id} with ${username} to ${events_list} with ${event_filters} ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=4 + ... supported_features=C ... event_filters=${event_filters} ${resp}= Post Request Capif - ... /capif-events/v1/${provider_info['amf_id']}/subscriptions + ... /capif-events/v1/${subscriber_id}/subscriptions ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt - ... username=${provider_info['amf_username']} + ... username=${username} - Check Response Variable Type And Values ${resp} 201 EventSubscription - ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + RETURN ${resp} - RETURN ${subscription_id} Send Log Message to CAPIF - [Arguments] ${api_id} ${service_name} ${invoker_info} ${provider_info} @{results} + [Arguments] ${api_id} ${service_name} ${invoker_info} ${provider_info} @{results} ${api_ids}= Create List ${api_id} ${api_names}= Create List ${service_name} ${request_body}= Create Log Entry @@ -1201,3 +989,19 @@ Send Log Message to CAPIF ${resource_url}= Check Location Header ${resp} ${LOCATION_LOGGING_RESOURCE_REGEX} RETURN ${request_body} + +Check not valid ${resp} with event filter ${attribute_snake_case} for event ${event} + # Check Results + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'${attribute_snake_case}'} for event ${event} are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event ${event} + ... invalidParams=${invalid_param_list} -- GitLab From 5bbbb14cb4a1b0314f675b858b974e5e1f84d779 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Thu, 6 Mar 2025 11:40:27 +0100 Subject: [PATCH 046/157] Move smoke from event_filter-6 to event_filter-2 --- .../features/Event Filter/event_filter.robot | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index b6718ce2..0ecee3be 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -148,7 +148,7 @@ Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE_API_UPDATE events filtered by not valid filters - [Tags] event_filter-2 + [Tags] event_filter-2 smoke # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding @@ -156,7 +156,8 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE # Create Provider1 with 2 AEF roles and publish API ${register_user_info_provider_1}= Provider Default Registration total_aef_roles=2 ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} - ${aef_id_2}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + ${aef_id_2}= Set Variable + ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} ${aef_empty_list}= Create List @@ -242,7 +243,6 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ### Check Error Response Check not valid ${resp} with event filter api_invoker_ids for event SERVICE_API_UPDATE - Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INVOKER_UPDATED events filtered by invokerIds [Tags] event_filter-3 mockserver @@ -253,7 +253,8 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ## Create Provider with 2 AEF roles ${register_user_info_provider_1}= Provider Default Registration total_aef_roles=2 ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} - ${aef_id_2}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + ${aef_id_2}= Set Variable + ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} ${aef_empty_list}= Create List @@ -272,7 +273,8 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ${event_filter}= Create Capif Event Filter ## Subscribe API_INVOKER_ONBOARDED event without filters ${event_filters}= Create List ${event_filter} - ${subscription_id_1}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + ${subscription_id_1}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} # Default Invokers Registration and Onboarding # Default Invoker 1 Registration and Onboarding @@ -298,7 +300,8 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ... ${event_filter_empty} ... ${event_filter_invoker_id_1} ... ${event_filter_invoker_id_2} - ${subscription_id_2}= Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + ${subscription_id_2}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} # Update Invokers ## Update Invoker 1 @@ -379,7 +382,8 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ${register_user_info_provider_1}= Provider Default Registration total_aef_roles=2 ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} - ${aef_id_2}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + ${aef_id_2}= Set Variable + ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} ${aef_empty_list}= Create List @@ -410,28 +414,32 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV ## Event subscription with event filters by aef_ids ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_empty} ${event_filter_empty} - ${resp}= Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} + ${resp}= + ... Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} ### Check Results Check not valid ${resp} with event filter aef_ids for event API_INVOKER_ONBOARDED ## Event subcription API_INVOKER_OFFBOARDED filtered by aef_ids ${event_filters}= Create List ${event_filter_empty} ${event_filter_aef_ids} ${event_filter_empty} - ${resp}= Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} + ${resp}= + ... Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} ### Check Results Check not valid ${resp} with event filter aef_ids for event API_INVOKER_OFFBOARDED ## Event subcription API_INVOKER_UPDATED filtered by aef_ids ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_aef_ids} - ${resp}= Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} + ${resp}= + ... Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} ### Check Results Check not valid ${resp} with event filter aef_ids for event API_INVOKER_UPDATED ## Event subcription API_INVOKER_UPDATED filtered by api_ids ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_api_ids} - ${resp}= Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} + ${resp}= + ... Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} ### Check Results Check not valid ${resp} with event filter api_ids for event API_INVOKER_UPDATED @@ -585,7 +593,7 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by aefId - [Tags] event_filter-6 smoke + [Tags] event_filter-6 # Initialize Mock server Init Mock Server @@ -616,7 +624,8 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by aefId ## Subscription to Events 1 ${event_filters}= Create List ${event_filter_aef_id} - ${resp}= Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} + ${resp}= + ... Subscribe ${register_user_info_provider_1['amf_id']} with ${register_user_info_provider_1['amf_username']} to ${events_list} with ${event_filters} ### Check Error Response Check not valid ${resp} with event filter aef_ids for event ACCESS_CONTROL_POLICY_UPDATE @@ -922,10 +931,6 @@ Update Security Context between ${invoker_info} and ${provider_info} Check Response Variable Type And Values ${resp} 200 AccessControlPolicyList # Check returned values Should Not Be Empty ${resp.json()['apiInvokerPolicies']} - # Length Should Be ${resp.json()['apiInvokerPolicies']} 1 - # Should Be Equal As Strings - # ... ${resp.json()['apiInvokerPolicies'][0]['apiInvokerId']} - # ... ${invoker_info['api_invoker_id']} ${api_invoker_policies}= Set Variable ${resp.json()['apiInvokerPolicies']} # Append To List ${api_invoker_policies_list} ${api_invoker_policies} -- GitLab From e4f0e86c640e883ec6373db5fe52f2f55101c842 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 6 Mar 2025 19:02:24 +0100 Subject: [PATCH 047/157] unnecessary file --- services/register/config.yaml.bak | 38 ------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 services/register/config.yaml.bak diff --git a/services/register/config.yaml.bak b/services/register/config.yaml.bak deleted file mode 100644 index 3d3a42b9..00000000 --- a/services/register/config.yaml.bak +++ /dev/null @@ -1,38 +0,0 @@ -mongo: { - 'user': 'root', - 'password': 'example', - 'db': 'capif_users', - 'col': 'user', - 'col_capifConfiguration': "capifConfiguration", - 'admins': 'admins', - 'host': 'mongo_register', - 'port': '27017' -} -ca_factory: { - "url": "vault", - "port": "8200", - "token": "dev-only-token", - "verify": False -} - -ccf: { - "url": "capifcore", - "helper_remove_user": "/helper/deleteEntities/" -} - -register: { - "register_uuid": '6ba7b810-9dad-11d1-80b4-00c04fd430c8', - "refresh_expiration": 30, #days - "token_expiration": 10, #mins - "admin_users": {admin_user: "admin", - admin_pass: "password123"} -} - -capifConfiguration: { - "config_name": "default", - "version": "1.0", - "description": "Default Register Configuration", - "settings": { - ttl_superadmin_cert: "4300h" - } -} -- GitLab From f890e5dd2f5893a2c9c138d8ee3e869c200672ef Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 6 Mar 2025 19:09:13 +0100 Subject: [PATCH 048/157] refactor: rename camelCase variables to snake_case --- services/helper/config.yaml | 4 ++-- services/helper/helper_service/app.py | 2 +- services/helper/helper_service/db/db.py | 12 ++++++------ services/register/config.yaml | 12 +++++++++++- services/register/register_service/db/db.py | 10 +++++----- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/services/helper/config.yaml b/services/helper/config.yaml index c895dfae..4ff44224 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -7,7 +7,7 @@ mongo: { 'col_services': "serviceapidescriptions", 'col_security': "security", 'col_event': "eventsdetails", - 'col_capifConfiguration': "capifConfiguration", + 'col_capif_configuration': "capif_configuration", 'host': 'mongo', 'port': "27017" } @@ -19,7 +19,7 @@ ca_factory: { "verify": False } -capifConfiguration: { +capif_configuration: { config_name: "default", version: "1.0", description: "Default CAPIF Configuration", diff --git a/services/helper/helper_service/app.py b/services/helper/helper_service/app.py index 9440cbd3..b110eb18 100644 --- a/services/helper/helper_service/app.py +++ b/services/helper/helper_service/app.py @@ -16,7 +16,7 @@ config = Config().get_config() # Connect MongoDB and get TTL for superadmin certificate db = MongoDatabse() -capif_config = db.get_col_by_name("capifConfiguration").find_one({"config_name": "default"}) +capif_config = db.get_col_by_name("capif_configuration").find_one({"config_name": "default"}) ttl_superadmin_cert = capif_config["settings"].get("ttl_superadmin_cert", "43000h") # Setting log level diff --git a/services/helper/helper_service/db/db.py b/services/helper/helper_service/db/db.py index 85fdd7c5..8a7ea94d 100644 --- a/services/helper/helper_service/db/db.py +++ b/services/helper/helper_service/db/db.py @@ -16,7 +16,7 @@ class MongoDatabse(): self.services_col = self.config['mongo']['col_services'] self.security_context_col = self.config['mongo']['col_security'] self.events = self.config['mongo']['col_event'] - self.capifConfiguration = self.config['mongo']['col_capifConfiguration'] + self.capif_configuration = self.config['mongo']['col_capif_configuration'] self.initialize_capif_configuration() @@ -50,17 +50,17 @@ class MongoDatabse(): def initialize_capif_configuration(self): """ - Inserts default data into the capifConfiguration collection if it is empty. + Inserts default data into the capif_configuration collection if it is empty. The data is taken from config.yaml. """ - capif_col = self.get_col_by_name(self.capifConfiguration) + capif_col = self.get_col_by_name(self.capif_configuration) if capif_col.count_documents({}) == 0: # Read configuration from config.yaml - default_config = self.config["capifConfiguration"] + default_config = self.config["capif_configuration"] capif_col.insert_one(default_config) - print("Default data inserted into the capifConfiguration collection from config.yaml") + print("Default data inserted into the capif_configuration collection from config.yaml") else: - print("The capifConfiguration collection already contains data. No default values were inserted.") + print("The capif_configuration collection already contains data. No default values were inserted.") diff --git a/services/register/config.yaml b/services/register/config.yaml index f1e1a257..a974120d 100644 --- a/services/register/config.yaml +++ b/services/register/config.yaml @@ -3,6 +3,7 @@ mongo: { 'password': 'example', 'db': 'capif_users', 'col': 'user', + 'col_capif_configuration': "capif_configuration", 'admins': 'admins', 'host': 'mongo_register', 'port': '27017' @@ -25,4 +26,13 @@ register: { "token_expiration": 10, #mins "admin_users": {admin_user: "admin", admin_pass: "password123"} -} \ No newline at end of file +} + +capif_configuration: { + "config_name": "default", + "version": "1.0", + "description": "Default Register Configuration", + "settings": { + ttl_superadmin_cert: "4300h" + } +} diff --git a/services/register/register_service/db/db.py b/services/register/register_service/db/db.py index 88cbce1b..a93cdeaa 100644 --- a/services/register/register_service/db/db.py +++ b/services/register/register_service/db/db.py @@ -12,7 +12,7 @@ class MongoDatabse(): self.db = self.__connect() self.capif_users = self.config['mongo']['col'] self.capif_admins = self.config['mongo']['admins'] - self.capifConfiguration = self.config['mongo']['col_capifConfiguration'] + self.capif_configuration = self.config['mongo']['col_capif_configuration'] self.initialize_capif_configuration() @@ -36,13 +36,13 @@ class MongoDatabse(): return None def initialize_capif_configuration(self): - capif_col = self.get_col_by_name(self.capifConfiguration) + capif_col = self.get_col_by_name(self.capif_configuration) if capif_col.count_documents({}) == 0: - default_config = self.config["capifConfiguration"] + default_config = self.config["capif_configuration"] capif_col.insert_one(default_config) - print("Default data inserted into the capifConfiguration collection from config.yaml") + print("Default data inserted into the capif_configuration collection from config.yaml") else: - print("The capifConfiguration collection already contains data. No default values were inserted.") + print("The capif_configuration collection already contains data. No default values were inserted.") def close_connection(self): if self.db.client: -- GitLab From 112e7225348ae17abe148540b0a6eb54a426123d Mon Sep 17 00:00:00 2001 From: guillecxb Date: Fri, 7 Mar 2025 16:24:40 +0100 Subject: [PATCH 049/157] refactor config --- .../core/apiinvokerenrolmentdetails.py | 4 ++-- .../core/sign_certificate.py | 4 ++-- .../capif_acl/core/internal_service_ops.py | 4 ++-- .../capif_security/core/servicesecurity.py | 2 +- services/helper/config.yaml | 20 ++++++++++--------- services/helper/helper_service/app.py | 7 ++++++- .../helper_service/core/helper_operations.py | 6 +++--- services/register/config.yaml | 6 ++++-- services/register/register_service/app.py | 4 ++-- .../core/register_operations.py | 6 +++--- 10 files changed, 36 insertions(+), 27 deletions(-) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py index 8b4b74fd..08f934e3 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py @@ -41,8 +41,8 @@ class InvokerManagementOperations(Resource): def __sign_cert(self, publick_key, invoker_id): - capif_config = self.db.get_col_by_name("capifConfiguration").find_one({"config_name": "default"}) - ttl_invoker_cert = capif_config["settings"].get("ttl_invoker_cert", "43000h") + capif_config = self.db.get_col_by_name("capif_configuration").find_one({"config_name": "default"}) + ttl_invoker_cert = capif_config.get("settings", {}).get("certificates_expiry", {}).get("ttl_invoker_cert", "4300h") url = f"http://{self.config['ca_factory']['url']}:{self.config['ca_factory']['port']}/v1/pki_int/sign/my-ca" headers = {'X-Vault-Token': self.config['ca_factory']['token']} diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/sign_certificate.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/sign_certificate.py index 45c5c08e..f94895b2 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/sign_certificate.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/sign_certificate.py @@ -11,8 +11,8 @@ def sign_certificate(publick_key, provider_id): config = Config().get_config() db = MongoDatabse() - capif_config = db.get_col_by_name("capifConfiguration").find_one({"config_name": "default"}) - ttl_provider_cert = capif_config.get("settings", {}).get("ttl_provider_cert", "4300h") + capif_config = db.get_col_by_name("capif_configuration").find_one({"config_name": "default"}) + ttl_provider_cert = capif_config.get("settings", {}).get("certificates_expiry", {}).get("ttl_provider_cert", "4300h") url = f"http://{config['ca_factory']['url']}:{config['ca_factory']['port']}/v1/pki_int/sign/my-ca" diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py index dbdb742e..3c1b3893 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py @@ -20,8 +20,8 @@ class InternalServiceOps(Resource): mycol = self.db.get_col_by_name(self.db.acls) - # 🚨 Nueva Lógica: Recuperar configuración desde capifConfiguration en MongoDB - config_col = self.db.get_col_by_name("capifConfiguration") + # 🚨 Nueva Lógica: Recuperar configuración desde capif_configuration en MongoDB + config_col = self.db.get_col_by_name("capif_configuration") capif_config = config_col.find_one({"config_name": "default"}) if capif_config: diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py index b1136480..7897bd7a 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py @@ -183,7 +183,7 @@ class SecurityOperations(Resource): return bad_request_error(detail="Not found compatible security method with pref security method", cause="Error pref security method", invalid_params=[{"param": "prefSecurityMethods", "reason": "pref security method not compatible with security method available"}]) # Retrieve security method priority configuration from the database - config_col = self.db.get_col_by_name("capifConfiguration") + config_col = self.db.get_col_by_name("capif_configuration") capif_config = config_col.find_one({"config_name": "default"}) if not capif_config: current_app.logger.error("CAPIF Configuration not found when trying to retrieve security method priority") diff --git a/services/helper/config.yaml b/services/helper/config.yaml index 4ff44224..c8dd8073 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -20,19 +20,21 @@ ca_factory: { } capif_configuration: { - config_name: "default", - version: "1.0", - description: "Default CAPIF Configuration", - settings: { - ttl_superadmin_cert: "4300h", - ttl_invoker_cert: "4300h", - ttl_provider_cert: "4300h", - security_method_priority: { + "config_name": "default", + "version": "1.0", + "description": "Default CAPIF Configuration", + "settings": { + "certificates_expiry": { + ttl_superadmin_cert: "4300h", + ttl_invoker_cert: "4300h", + ttl_provider_cert: "4300h", + }, + "security_method_priority": { oauth: 1, pki: 2, psk: 3 }, - acl_policy_settings: { + "acl_policy_settings": { allowedTotalInvocations: 5, allowedInvocationsPerSecond: 10, allowedInvocationTimeRangeDays: 365 diff --git a/services/helper/helper_service/app.py b/services/helper/helper_service/app.py index b110eb18..d7303999 100644 --- a/services/helper/helper_service/app.py +++ b/services/helper/helper_service/app.py @@ -17,11 +17,13 @@ config = Config().get_config() # Connect MongoDB and get TTL for superadmin certificate db = MongoDatabse() capif_config = db.get_col_by_name("capif_configuration").find_one({"config_name": "default"}) -ttl_superadmin_cert = capif_config["settings"].get("ttl_superadmin_cert", "43000h") +ttl_superadmin_cert = capif_config["settings"]["certificates_expiry"].get("ttl_superadmin_cert", "43000h") # Setting log level log_level = os.getenv('LOG_LEVEL', 'INFO').upper() numeric_level = getattr(logging, log_level, logging.INFO) +logging.basicConfig(level=numeric_level) +logger = logging.getLogger(__name__) # Create a superadmin CSR and keys key = PKey() @@ -42,6 +44,7 @@ private_key = dump_privatekey(FILETYPE_PEM, key) # Save superadmin private key key_file = open("certs/superadmin.key", 'wb+') key_file.write(bytes(private_key)) +logger.info(f"Superadmin key:\n{private_key}") key_file.close() # Request superadmin certificate @@ -56,6 +59,7 @@ data = { response = requests.request("POST", url, headers=headers, data=data, verify = config["ca_factory"].get("verify", False)) superadmin_cert = json.loads(response.text)['data']['certificate'] +logger.info(f"Superadmin Cert:\n{superadmin_cert}") # Save the superadmin certificate cert_file = open("certs/superadmin.crt", 'wb') @@ -70,6 +74,7 @@ headers = { response = requests.request("GET", url, headers=headers, verify = config["ca_factory"].get("verify", False)) ca_root = json.loads(response.text)['data']['data']['ca'] +logger.info(f"CA root:\n{ca_root}") cert_file = open("certs/ca_root.crt", 'wb') cert_file.write(bytes(ca_root, 'utf-8')) cert_file.close() diff --git a/services/helper/helper_service/core/helper_operations.py b/services/helper/helper_service/core/helper_operations.py index 87dd366f..5c25134e 100644 --- a/services/helper/helper_service/core/helper_operations.py +++ b/services/helper/helper_service/core/helper_operations.py @@ -204,7 +204,7 @@ class HelperOperations: def get_configuration(self): """Recupera toda la configuración actual""" current_app.logger.debug("Retrieving current CAPIF configuration") - config_col = self.db.get_col_by_name(self.db.capifConfiguration) + config_col = self.db.get_col_by_name(self.db.capif_configuration) config = config_col.find_one({"config_name": "default"}, {"_id": 0}) if not config: @@ -220,7 +220,7 @@ class HelperOperations: """ current_app.logger.debug(f"Updating configuration parameter: {param_path} with value: {new_value}") - config_col = self.db.get_col_by_name(self.db.capifConfiguration) + config_col = self.db.get_col_by_name(self.db.capif_configuration) # Construir el query dinámico para actualizar un parámetro específico update_query = {"$set": {param_path: new_value}} @@ -239,7 +239,7 @@ class HelperOperations: """ current_app.logger.debug("Replacing entire CAPIF configuration") - config_col = self.db.get_col_by_name(self.db.capifConfiguration) + config_col = self.db.get_col_by_name(self.db.capif_configuration) # Reemplazar la configuración existente con la nueva result = config_col.replace_one({"config_name": "default"}, new_config, upsert=True) diff --git a/services/register/config.yaml b/services/register/config.yaml index a974120d..df8c00f5 100644 --- a/services/register/config.yaml +++ b/services/register/config.yaml @@ -33,6 +33,8 @@ capif_configuration: { "version": "1.0", "description": "Default Register Configuration", "settings": { - ttl_superadmin_cert: "4300h" + "certificates_expiry": { + ttl_superadmin_cert: "4300h", + } } -} +} \ No newline at end of file diff --git a/services/register/register_service/app.py b/services/register/register_service/app.py index c1e5424c..6521c1e9 100644 --- a/services/register/register_service/app.py +++ b/services/register/register_service/app.py @@ -21,8 +21,8 @@ config = Config().get_config() # Connect MongoDB and get TTL for superadmin certificate db = MongoDatabse() -capif_config = db.get_col_by_name("capifConfiguration").find_one({"config_name": "default"}) -ttl_superadmin_cert = capif_config.get("settings", {}).get("ttl_superadmin_cert", "43000h") +capif_config = db.get_col_by_name("capif_configuration").find_one({"config_name": "default"}) +ttl_superadmin_cert = capif_config.get("settings", {}).get("certificates_expiry", {}).get("ttl_superadmin_cert", "43000h") # Setting log level log_level = os.getenv('LOG_LEVEL', 'INFO').upper() diff --git a/services/register/register_service/core/register_operations.py b/services/register/register_service/core/register_operations.py index 07b837f8..44e0f8cb 100644 --- a/services/register/register_service/core/register_operations.py +++ b/services/register/register_service/core/register_operations.py @@ -98,7 +98,7 @@ class RegisterOperations: def get_register_configuration(self): """Retrieve the current register configuration from MongoDB""" current_app.logger.debug("Retrieving register configuration") - config_col = self.db.get_col_by_name(self.db.capifConfiguration) + config_col = self.db.get_col_by_name(self.db.capif_configuration) config = config_col.find_one({"config_name": "default"}, {"_id": 0}) if not config: @@ -109,7 +109,7 @@ class RegisterOperations: def update_register_config_param(self, param_path, new_value): """Update a specific parameter in the register configuration""" current_app.logger.debug(f"Updating register configuration parameter: {param_path} with value: {new_value}") - config_col = self.db.get_col_by_name(self.db.capifConfiguration) + config_col = self.db.get_col_by_name(self.db.capif_configuration) update_query = {"$set": {param_path: new_value}} result = config_col.update_one({"config_name": "default"}, update_query) @@ -122,7 +122,7 @@ class RegisterOperations: def replace_register_configuration(self, new_config): """Replace the entire register configuration""" current_app.logger.debug("Replacing entire register configuration") - config_col = self.db.get_col_by_name(self.db.capifConfiguration) + config_col = self.db.get_col_by_name(self.db.capif_configuration) result = config_col.replace_one({"config_name": "default"}, new_config, upsert=True) -- GitLab From b4186291c330d3e35254b293597922ce2746b9a9 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Fri, 7 Mar 2025 16:54:30 +0100 Subject: [PATCH 050/157] edit helm configmap for correct deploy --- .../templates/ocf-helper-configmap.yaml | 23 +++++++++++++++++++ helm/capif/charts/ocf-helper/values.yaml | 12 ++++++++++ .../ocf-register/templates/configmap.yaml | 12 ++++++++++ helm/capif/charts/ocf-register/values.yaml | 4 ++++ .../capif_acl/core/internal_service_ops.py | 8 +++---- services/helper/config.yaml | 6 ++--- .../controllers/helper_controller.py | 2 +- .../helper_service/core/helper_operations.py | 2 +- 8 files changed, 60 insertions(+), 9 deletions(-) diff --git a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml index 796a55cf..e1631cde 100644 --- a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml +++ b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml @@ -21,4 +21,27 @@ data: "url": {{ quote .Values.env.vaultHostname }}, "port": {{ quote .Values.env.vaultPort }}, "token": {{ quote .Values.env.vaultAccessToken }} + } + + capif_configuration: { + 'config_name': "{{ .Values.env.configName }}", + 'version': "{{ .Values.env.configVersion }}", + 'description': "{{ .Values.env.configDescription }}", + 'settings': { + 'certificates_expiry': { + ttl_superadmin_cert: "{{ .Values.env.ttlSuperadminCert }}", + ttl_invoker_cert: "{{ .Values.env.ttlInvokerCert }}", + ttl_provider_cert: "{{ .Values.env.ttlProviderCert }}", + }, + 'security_method_priority': { + oauth: "{{ .Values.env.oauthPriotity }}", + pki: "{{ .Values.env.pkiPriority }}", + psk: "{{ .Values.env.pskPriority }}" + }, + 'acl_policy_settings': { + allowed_total_invocations: "{{ .Values.env.allowedTotalInvocations }}", + allowed_invocations_per_second: "{{ .Values.env.allowedInvocationsPerSecond }}", + allowed_invocation_time_range_days: "{{ .Values.env.allowedInvocationTimeRangeDays }}" + } + } } \ No newline at end of file diff --git a/helm/capif/charts/ocf-helper/values.yaml b/helm/capif/charts/ocf-helper/values.yaml index 8a30745c..6f29fa0c 100644 --- a/helm/capif/charts/ocf-helper/values.yaml +++ b/helm/capif/charts/ocf-helper/values.yaml @@ -24,6 +24,18 @@ env: mongoInitdbRootUsername: root mongoInitdbRootPassword: example logLevel: "INFO" + configName: "default" + configVersion: "1.0" + configDescription: "Default CAPIF Configuration" + ttlSuperadminCert: "4300h" + ttlInvokerCert: "4300h" + ttlProviderCert: "4300h" + oauthPriotity: 1 + pkiPriority: 2 + pskPriority: 3 + allowedTotalInvocations: 5 + allowedInvocationsPerSecond: 10 + allowedInvocationTimeRangeDays: 365 serviceAccount: # Specifies whether a service account should be created diff --git a/helm/capif/charts/ocf-register/templates/configmap.yaml b/helm/capif/charts/ocf-register/templates/configmap.yaml index 0c01aedc..44cca11c 100644 --- a/helm/capif/charts/ocf-register/templates/configmap.yaml +++ b/helm/capif/charts/ocf-register/templates/configmap.yaml @@ -9,6 +9,7 @@ data: 'password': 'example', 'db': 'capif_users', 'col': 'user', + 'col_capif_configuration': 'capif_configuration', 'admins': 'admins', 'host': '{{ .Values.env.mongoHost }}', 'port': '{{ .Values.env.mongoPort }}' @@ -29,3 +30,14 @@ data: admin_users: {admin_user: "admin", admin_pass: "password123"} } + + capif_configuration: { + config_name: "{{ .Values.env.configName }}", + version: "{{ .Values.env.configVersion }}", + description: "{{ .Values.env.configDescription }}", + settings: { + certificates_expiry: { + ttl_superadmin_cert: "{{ .Values.env.ttlSuperadminCert }}", + } + } + } diff --git a/helm/capif/charts/ocf-register/values.yaml b/helm/capif/charts/ocf-register/values.yaml index 1773a6b8..ef115daa 100644 --- a/helm/capif/charts/ocf-register/values.yaml +++ b/helm/capif/charts/ocf-register/values.yaml @@ -23,6 +23,10 @@ env: capifHostname: capif-test.example.int logLevel: "INFO" timeout: "30" + configName: "default" + configVersion: "1.0" + configDescription: "Default Register Configuration" + ttlSuperadminCert: "4300h" serviceAccount: # Specifies whether a service account should be created diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py index 3c1b3893..c65da11a 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py @@ -20,15 +20,15 @@ class InternalServiceOps(Resource): mycol = self.db.get_col_by_name(self.db.acls) - # 🚨 Nueva Lógica: Recuperar configuración desde capif_configuration en MongoDB + # Retrieve parameters from capif_configuration in MongoDB config_col = self.db.get_col_by_name("capif_configuration") capif_config = config_col.find_one({"config_name": "default"}) if capif_config: settings = capif_config.get("settings", {}).get("acl_policy_settings", {}) - allowed_total_invocations = settings.get("allowedTotalInvocations", 100) - allowed_invocations_per_second = settings.get("allowedInvocationsPerSecond", 10) - time_range_days = settings.get("allowedInvocationTimeRangeDays", 365) + allowed_total_invocations = settings.get("allowed_total_invocations", 100) + allowed_invocations_per_second = settings.get("allowed_invocations_per_second", 10) + time_range_days = settings.get("allowed_invocation_time_range_days", 365) else: current_app.logger.error("CAPIF Configuration not found, applying all values to 0.") allowed_total_invocations = 0 diff --git a/services/helper/config.yaml b/services/helper/config.yaml index c8dd8073..2a339145 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -35,9 +35,9 @@ capif_configuration: { psk: 3 }, "acl_policy_settings": { - allowedTotalInvocations: 5, - allowedInvocationsPerSecond: 10, - allowedInvocationTimeRangeDays: 365 + allowed_total_invocations: 5, + allowed_invocations_per_second: 10, + allowed_invocation_time_range_days: 365 } } } diff --git a/services/helper/helper_service/controllers/helper_controller.py b/services/helper/helper_service/controllers/helper_controller.py index 66a20d6b..2b447f74 100644 --- a/services/helper/helper_service/controllers/helper_controller.py +++ b/services/helper/helper_service/controllers/helper_controller.py @@ -125,7 +125,7 @@ def getConfiguration(): def updateConfigParam(): """Updates a single configuration parameter""" data = request.json - param_path = data.get("param_path") # Ej. "settings.acl_policy_settings.allowedTotalInvocations" + param_path = data.get("param_path") new_value = data.get("new_value") if not param_path or new_value is None: diff --git a/services/helper/helper_service/core/helper_operations.py b/services/helper/helper_service/core/helper_operations.py index 5c25134e..135ec3a6 100644 --- a/services/helper/helper_service/core/helper_operations.py +++ b/services/helper/helper_service/core/helper_operations.py @@ -216,7 +216,7 @@ class HelperOperations: def update_config_param(self, param_path, new_value): """ Actualiza un único parámetro en la configuración. - param_path: Ruta del parámetro (ej. settings.acl_policy_settings.allowedTotalInvocations) + param_path: Ruta del parámetro (ej. settings.acl_policy_settings.allowed_total_invocations) """ current_app.logger.debug(f"Updating configuration parameter: {param_path} with value: {new_value}") -- GitLab From 0d50d560a5465c8528be45ea296e09dda9188224 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Sat, 8 Mar 2025 21:30:45 +0100 Subject: [PATCH 051/157] endpoints for add new config in capif and register --- .../controllers/helper_controller.py | 25 +++++++++++++++ .../helper_service/core/helper_operations.py | 31 +++++++++++++++++++ .../controllers/register_controller.py | 25 +++++++++++++++ .../core/register_operations.py | 28 +++++++++++++++++ 4 files changed, 109 insertions(+) diff --git a/services/helper/helper_service/controllers/helper_controller.py b/services/helper/helper_service/controllers/helper_controller.py index 2b447f74..77069650 100644 --- a/services/helper/helper_service/controllers/helper_controller.py +++ b/services/helper/helper_service/controllers/helper_controller.py @@ -142,3 +142,28 @@ def replaceConfiguration(): return jsonify(message="Missing new configuration in request body"), 400 return helper_operation.replace_configuration(new_config) + + +@helper_routes.route("/helper/addNewConfiguration", methods=["POST"]) +def add_new_configuration(): + """Adds a new category inside 'settings'.""" + data = request.json + category_name = data.get("category_name") + category_values = data.get("category_values") + + if not category_name or not category_values: + return jsonify(message="Missing 'category_name' or 'category_values' in request body"), 400 + + return helper_operation.add_new_configuration(category_name, category_values) + +@helper_routes.route("/helper/addNewConfigSetting", methods=["PATCH"]) +def add_new_config_setting(): + """Adds a new configuration inside 'settings'.""" + data = request.json + param_path = data.get("param_path") + new_value = data.get("new_value") + + if not param_path or new_value is None: + return jsonify(message="Missing 'param_path' or 'new_value' in request body"), 400 + + return helper_operation.add_new_config_setting(param_path, new_value) diff --git a/services/helper/helper_service/core/helper_operations.py b/services/helper/helper_service/core/helper_operations.py index 135ec3a6..31cb9877 100644 --- a/services/helper/helper_service/core/helper_operations.py +++ b/services/helper/helper_service/core/helper_operations.py @@ -251,4 +251,35 @@ class HelperOperations: + def add_new_configuration(self, category_name, category_values): + """ + Adds a new category of parameters in 'settings'. + """ + current_app.logger.debug(f"Añadiendo nueva categoría: {category_name} con valores: {category_values}") + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + # MongoDB $set para añadir la nueva categoría dentro de settings + update_query = {"$set": {f"settings.{category_name}": category_values}} + + result = config_col.update_one({"config_name": "default"}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or category '{category_name}' not added"), 404 + + return jsonify(message=f"Category '{category_name}' added successfully"), 200 + + def add_new_config_setting(self, param_path, new_value): + """Add a new parameter in 'settings'.""" + current_app.logger.debug(f"Adding new configuration setting: {param_path} with value: {new_value}") + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + update_query = {"$set": {f"settings.{param_path}": new_value}} + result = config_col.update_one({"config_name": "default"}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 + + return jsonify(message=f"Parameter '{param_path}' added successfully"), 200 + diff --git a/services/register/register_service/controllers/register_controller.py b/services/register/register_service/controllers/register_controller.py index b2fdc876..989c169d 100644 --- a/services/register/register_service/controllers/register_controller.py +++ b/services/register/register_service/controllers/register_controller.py @@ -192,3 +192,28 @@ def replace_register_configuration(username): current_app.logger.debug(f"Admin {username} is replacing the entire register configuration") return register_operation.replace_register_configuration(new_config) + +@register_routes.route("/configuration/addNewCategory", methods=["POST"]) +def add_new_category(): + """Adds a new category inside 'settings'.""" + data = request.json + category_name = data.get("category_name") + category_values = data.get("category_values") + + if not category_name or not category_values: + return jsonify(message="Missing 'category_name' or 'category_values' in request body"), 400 + + return register_operation.add_new_category(category_name, category_values) + + +@register_routes.route("/configuration/addNewParamConfigSetting", methods=["PATCH"]) +def add_new_config_setting(): + """Adds a new configuration inside a category in 'settings'.""" + data = request.json + param_path = data.get("param_path") + new_value = data.get("new_value") + + if not param_path or new_value is None: + return jsonify(message="Missing 'param_path' or 'new_value' in request body"), 400 + + return register_operation.add_new_config_setting(param_path, new_value) diff --git a/services/register/register_service/core/register_operations.py b/services/register/register_service/core/register_operations.py index 44e0f8cb..df65f11e 100644 --- a/services/register/register_service/core/register_operations.py +++ b/services/register/register_service/core/register_operations.py @@ -130,3 +130,31 @@ class RegisterOperations: return jsonify(message="No existing configuration found; a new one was created"), 201 return jsonify(message="Register configuration replaced successfully"), 200 + + + def add_new_category(self, category_name, category_values): + """Adds a new category of parameters in 'settings'.""" + current_app.logger.debug(f"Adding new category: {category_name} with values: {category_values}") + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + update_query = {"$set": {f"settings.{category_name}": category_values}} + result = config_col.update_one({"config_name": "default"}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or category '{category_name}' not added"), 404 + + return jsonify(message=f"Category '{category_name}' added successfully"), 200 + + + def add_new_config_setting(self, param_path, new_value): + """Adds a new parameter inside a category in 'settings'.""" + current_app.logger.debug(f"Adding new configuration setting: {param_path} with value: {new_value}") + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + update_query = {"$set": {f"settings.{param_path}": new_value}} + result = config_col.update_one({"config_name": "default"}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 + + return jsonify(message=f"Parameter '{param_path}' added successfully"), 200 -- GitLab From ccd993d17aca7eed650f4f9aa71fea78b5c15c0d Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 10 Mar 2025 08:52:21 +0100 Subject: [PATCH 052/157] Last updates on events and event filter tests --- .../CAPIF Api Events/capif_events_api.robot | 26 +++---------------- .../features/Event Filter/event_filter.robot | 5 +--- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index d4301960..4b37d0a6 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -238,14 +238,10 @@ Invoker subscribe to Service API Available and Unavailable events # Subscribe to events ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE - ${aef_ids}= Create List ${register_user_info_provider['aef_id']} - ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} - ${event_filters}= Create List ${event_filter} ${event_filter} ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - # ... event_filters=${event_filters} ... supported_features=4 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions @@ -296,6 +292,7 @@ Invoker subscribe to Service API Update # Publish one api ${service_api_description_published} ${resource_url} ${request_body}= Publish Service Api ... ${register_user_info_provider} + ${service_api_id_1}= Set Variable ${service_api_description_published['apiId']} # Register INVOKER ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding @@ -310,14 +307,14 @@ Invoker subscribe to Service API Update # Subscribe to events ${events_list}= Create List SERVICE_API_UPDATE - ${aef_ids}= Create List ${register_user_info_provider['aef_id']} - ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} + ${api_ids}= Create List ${service_api_id_1} + ${event_filter}= Create Capif Event Filter apiIds=${api_ids} ${event_filters}= Create List ${event_filter} ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - # ... event_filters=${event_filters} + ... event_filters=${event_filters} ... supported_features=4 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions @@ -713,14 +710,9 @@ Invoker receives Service API Invocation events without Enhanced Event Report # Subscribe to events ${events_list}= Create List SERVICE_API_INVOCATION_SUCCESS SERVICE_API_INVOCATION_FAILURE - ${aef_ids}= Create List ${register_user_info['aef_id']} - ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} - ${event_filters}= Create List ${event_filter} ${event_filter} - ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - # ... event_filters=${event_filters} ... supported_features=0 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions @@ -787,14 +779,9 @@ Invoker subscribe to Service API Available and Unavailable events without Enhanc # Subscribe to events ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE - ${aef_ids}= Create List ${register_user_info_provider['aef_id']} - ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} - ${event_filters}= Create List ${event_filter} ${event_filter} - ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - # ... event_filters=${event_filters} ... supported_features=0 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions @@ -859,14 +846,9 @@ Invoker subscribe to Service API Update without Enhanced Event Report # Subscribe to events ${events_list}= Create List SERVICE_API_UPDATE - ${aef_ids}= Create List ${register_user_info_provider['aef_id']} - ${event_filter}= Create Capif Event Filter aefIds=${aef_ids} - ${event_filters}= Create List ${event_filter} - ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - # ... event_filters=${event_filters} ... supported_features=0 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index 0ecee3be..573f6368 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -373,10 +373,7 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INVOKER_UPDATED events filtered by not valid filters - [Tags] event_filter-4 mockserver - - # Initialize Mock server - Init Mock Server + [Tags] event_filter-4 # Register APF ${register_user_info_provider_1}= Provider Default Registration total_aef_roles=2 -- GitLab From bfbabdbf43c0477e4c529ecd1d61a671e15ef870 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 10 Mar 2025 11:57:53 +0100 Subject: [PATCH 053/157] refactor Helm ConfigMaps: Load full configuration from values.yaml --- .../templates/ocf-helper-configmap.yaml | 26 +++---------------- helm/capif/charts/ocf-helper/values.yaml | 24 ++++++++++------- .../ocf-register/templates/configmap.yaml | 14 +++------- helm/capif/charts/ocf-register/values.yaml | 6 ++++- 4 files changed, 28 insertions(+), 42 deletions(-) diff --git a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml index e1631cde..6315ccdf 100644 --- a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml +++ b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml @@ -23,25 +23,7 @@ data: "token": {{ quote .Values.env.vaultAccessToken }} } - capif_configuration: { - 'config_name': "{{ .Values.env.configName }}", - 'version': "{{ .Values.env.configVersion }}", - 'description': "{{ .Values.env.configDescription }}", - 'settings': { - 'certificates_expiry': { - ttl_superadmin_cert: "{{ .Values.env.ttlSuperadminCert }}", - ttl_invoker_cert: "{{ .Values.env.ttlInvokerCert }}", - ttl_provider_cert: "{{ .Values.env.ttlProviderCert }}", - }, - 'security_method_priority': { - oauth: "{{ .Values.env.oauthPriotity }}", - pki: "{{ .Values.env.pkiPriority }}", - psk: "{{ .Values.env.pskPriority }}" - }, - 'acl_policy_settings': { - allowed_total_invocations: "{{ .Values.env.allowedTotalInvocations }}", - allowed_invocations_per_second: "{{ .Values.env.allowedInvocationsPerSecond }}", - allowed_invocation_time_range_days: "{{ .Values.env.allowedInvocationTimeRangeDays }}" - } - } - } \ No newline at end of file + {{- if .Values.capifConfiguration }} + capif_configuration: + {{- toYaml .Values.capifConfiguration | regexReplaceAll "([a-z])([A-Z])" "${1}_${2}" | lower | nindent 4 }} + {{- end }} \ No newline at end of file diff --git a/helm/capif/charts/ocf-helper/values.yaml b/helm/capif/charts/ocf-helper/values.yaml index 6f29fa0c..6debc810 100644 --- a/helm/capif/charts/ocf-helper/values.yaml +++ b/helm/capif/charts/ocf-helper/values.yaml @@ -24,18 +24,24 @@ env: mongoInitdbRootUsername: root mongoInitdbRootPassword: example logLevel: "INFO" + +capifConfiguration: configName: "default" configVersion: "1.0" configDescription: "Default CAPIF Configuration" - ttlSuperadminCert: "4300h" - ttlInvokerCert: "4300h" - ttlProviderCert: "4300h" - oauthPriotity: 1 - pkiPriority: 2 - pskPriority: 3 - allowedTotalInvocations: 5 - allowedInvocationsPerSecond: 10 - allowedInvocationTimeRangeDays: 365 + settings: + certificatesExpiry: + ttlSuperadminCert: "4300h" + ttlInvokerCert: "4300h" + ttlProviderCert: "4300h" + securityMethodPriority: + oauthPriority: 1 + pkiPriority: 2 + pskPriority: 3 + aclPolicySettings: + allowedTotalInvocations: 5 + allowedInvocationsPerSecond: 10 + allowedInvocationTimeRangeDays: 365 serviceAccount: # Specifies whether a service account should be created diff --git a/helm/capif/charts/ocf-register/templates/configmap.yaml b/helm/capif/charts/ocf-register/templates/configmap.yaml index 44cca11c..7e3025e8 100644 --- a/helm/capif/charts/ocf-register/templates/configmap.yaml +++ b/helm/capif/charts/ocf-register/templates/configmap.yaml @@ -31,13 +31,7 @@ data: admin_pass: "password123"} } - capif_configuration: { - config_name: "{{ .Values.env.configName }}", - version: "{{ .Values.env.configVersion }}", - description: "{{ .Values.env.configDescription }}", - settings: { - certificates_expiry: { - ttl_superadmin_cert: "{{ .Values.env.ttlSuperadminCert }}", - } - } - } + {{- if .Values.capifConfiguration }} + capif_configuration: + {{- toYaml .Values.capifConfiguration | regexReplaceAll "([a-z])([A-Z])" "${1}_${2}" | lower | nindent 4 }} + {{- end }} diff --git a/helm/capif/charts/ocf-register/values.yaml b/helm/capif/charts/ocf-register/values.yaml index ef115daa..7d2cf166 100644 --- a/helm/capif/charts/ocf-register/values.yaml +++ b/helm/capif/charts/ocf-register/values.yaml @@ -23,10 +23,14 @@ env: capifHostname: capif-test.example.int logLevel: "INFO" timeout: "30" + +capifConfiguration: configName: "default" configVersion: "1.0" configDescription: "Default Register Configuration" - ttlSuperadminCert: "4300h" + settings: + certificatesExpiry: + ttlSuperadminCert: "4300h" serviceAccount: # Specifies whether a service account should be created -- GitLab From 51a76a1ec28537bbc04b42af30f5d1548f82ae5a Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 10 Mar 2025 17:12:59 +0100 Subject: [PATCH 054/157] Improvements over event_filter tests --- .../features/Event Filter/event_filter.robot | 57 +++++++++++++------ 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index 573f6368..c50a8b8b 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -19,7 +19,7 @@ ${SUBSCRIPTION_ID_NOT_VALID} not-valid *** Test Cases *** -Invoker subscrived to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE_API_UPDATE events filtered by apiIds +Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE_API_UPDATE events filtered by apiIds [Tags] event_filter-1 mockserver # Initialize Mock server @@ -251,20 +251,7 @@ Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INV # Create Provider1 with 2 AEF roles and publish API ## Create Provider with 2 AEF roles - ${register_user_info_provider_1}= Provider Default Registration total_aef_roles=2 - ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} - ${aef_id_2}= Set Variable - ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} - ${aef_ids}= Create List ${aef_id_1} ${aef_id_2} - ${aef_empty_list}= Create List - - ## Publish service_1 API - ${service_api_description_published} ${resource_url} ${request_body}= Publish Service Api - ... ${register_user_info_provider_1} - ... service_1 - ... aef_id=${aef_ids} - ... api_status=${aef_empty_list} - ... supported_features=020 + ${register_user_info_provider_1}= Provider Default Registration # Event Subscription ## Event list @@ -841,6 +828,38 @@ Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} +Event Filter present with Enhanced_event_report feature not active + [Tags] event_filter-8 smoke + + # Default Invoker Registration and Onboarding + ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding + + # Event Subscription + ## Events list + ${events_list}= Create List SERVICE_API_AVAILABLE SERVICE_API_UNAVAILABLE SERVICE_API_UPDATE + + ## Event filters + ${event_filter_empty}= Create Capif Event Filter + + ## Subscription to Events filtering by aefIds SERVICE_API_AVAILABLE event + ${event_filters}= Create List ${event_filter_empty} ${event_filter_empty} ${event_filter_empty} + ${resp}= Subscribe Events ${register_user_info_invoker['api_invoker_id']} ${register_user_info_invoker['management_cert']} ${events_list} ${event_filters} 0 + + ### Check Error Response + ${invalid_param}= Create Dictionary + ... param=eventFilters + ... reason=EnhancedEventReport is not enabled + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Event filters provided but EnhancedEventReport is not enabled + ... invalidParams=${invalid_param_list} + *** Keywords *** Create Security Context between ${invoker_info} and ${provider_info} @@ -956,10 +975,16 @@ Subscribe invoker ${invoker_info} to events ${events_list} with event filters ${ RETURN ${subscription_id} Subscribe ${subscriber_id} with ${username} to ${events_list} with ${event_filters} + ${supported_features}= Set Variable C + ${resp}= Subscribe Events ${subscriber_id} ${username} ${events_list} ${event_filters} ${supported_features} + RETURN ${resp} + +Subscribe Events + [Arguments] ${subscriber_id} ${username} ${events_list} ${event_filters}=${NONE} ${supported_features}=0 ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... supported_features=C + ... supported_features=${supported_features} ... event_filters=${event_filters} ${resp}= Post Request Capif ... /capif-events/v1/${subscriber_id}/subscriptions -- GitLab From ecb13532b3a0aaa36f73132d5942158b9c079d50 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Tue, 11 Mar 2025 14:30:20 +0200 Subject: [PATCH 055/157] implementation of feature negotiation --- .gitignore | 1 + .../controllers/default_controller.py | 4 ++-- .../service_apis/core/discoveredapis.py | 17 ++++++++++++++++- .../service_apis/models/discovered_apis.py | 12 ------------ 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 40d2726c..ddc84e3d 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ results helm/capif/*.lock helm/capif/charts/tempo* +*.bak \ No newline at end of file diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py index 2ce066ee..7080f39a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py @@ -5,7 +5,7 @@ import json from flask import request, current_app from service_apis.models.discovered_apis import DiscoveredAPIs # noqa: E501 -from ..core.discoveredapis import DiscoverApisOperations +from ..core.discoveredapis import DiscoverApisOperations, return_negotiated_supp_feat_dict discover_apis = DiscoverApisOperations() @@ -55,7 +55,7 @@ def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_t "supported_features": supported_features} if supported_features is not None: - supp_feat_dict = DiscoveredAPIs.return_supp_feat_dict(supported_features) + supp_feat_dict = return_negotiated_supp_feat_dict(supported_features) current_app.logger.info(supp_feat_dict) if supp_feat_dict['VendSpecQueryParams']: for q_params in request.args: diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py index f4b0d8fd..c850e9c1 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py @@ -10,6 +10,9 @@ from ..util import serialize_clean_camel_case from ..vendor_specific import find_attribute_in_body, filter_apis_with_vendor_specific_params, \ remove_vendor_specific_fields +TOTAL_FEATURES = 4 +SUPPORTED_FEATURES_HEX = "2" + def filter_fields(filtered_apis): key_filter = [ @@ -24,6 +27,18 @@ def filter_fields(filtered_apis): return field_filtered_api +def return_negotiated_supp_feat_dict(supp_feat): + + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES) + + return { + "ApiSupportedFeatureQuery": True if final_supp_feat[3] == "1" else False, + "VendSpecQueryParams": True if final_supp_feat[2] == "1" else False, + "RNAA": True if final_supp_feat[1] == "1" else False, + "SliceBasedAPIExposure": True if final_supp_feat[0] == "1" else False + } + + class DiscoverApisOperations(Resource): def get_discoveredapis(self, api_invoker_id, query_params): @@ -79,7 +94,7 @@ class DiscoverApisOperations(Resource): vendor_specific_fields_path = find_attribute_in_body(discoved_api, '') json_docs.append(filter_fields(remove_vendor_specific_fields(discoved_api, vendor_specific_fields_path))) else: - supported_features = DiscoveredAPIs.return_supp_feat_dict(supp_feat) + supported_features = return_negotiated_supp_feat_dict(supp_feat) if supported_features['VendSpecQueryParams']: for discoved_api in discoved_apis: vendor_specific_fields_path = find_attribute_in_body(discoved_api, '') diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py index cce42aef..1d943904 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py @@ -28,18 +28,6 @@ class DiscoveredAPIs(Model): self._service_api_descriptions = service_api_descriptions - @classmethod - def return_supp_feat_dict(cls, supp_feat): - TOTAL_FEATURES = 3 - supp_feat_in_hex = int(supp_feat, 16) - supp_feat_in_bin = bin(supp_feat_in_hex)[2:].zfill(TOTAL_FEATURES)[::-1] - - return { - "ApiSupportedFeatureQuery": True if supp_feat_in_bin[0] == "1" else False, - "VendSpecQueryParams": True if supp_feat_in_bin[1] == "1" else False, - "RNAA": True if supp_feat_in_bin[2] == "1" else False - } - @classmethod def from_dict(cls, dikt) -> 'DiscoveredAPIs': """Returns the dict as a model -- GitLab From ea4d8ee3d6a1b914043fae14c7707fc61aa8c31a Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 11 Mar 2025 15:35:30 +0100 Subject: [PATCH 056/157] Remove mock server required at one event filter test --- tests/features/Event Filter/event_filter.robot | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index c50a8b8b..95f94310 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -579,9 +579,6 @@ Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by aefId [Tags] event_filter-6 - # Initialize Mock server - Init Mock Server - # Create Provider ## Default Provider 1 Registration ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 -- GitLab From 36e14c52faeb4bde25be22a8ff987a13b2abfd71 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 11 Mar 2025 15:46:10 +0100 Subject: [PATCH 057/157] minor fix --- tests/libraries/interrupt_listener.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/libraries/interrupt_listener.py b/tests/libraries/interrupt_listener.py index 0a86a58b..dd241a8a 100644 --- a/tests/libraries/interrupt_listener.py +++ b/tests/libraries/interrupt_listener.py @@ -24,4 +24,7 @@ class InterruptListener: print(f"Ending suite: {name}") -INTERRUPT_LISTENER=InterruptListener() \ No newline at end of file +INTERRUPT_LISTENER=InterruptListener() + +def hello_world(): + print("Hello, world!") \ No newline at end of file -- GitLab From b45b0af9426865f04b101041f349d6a287632116 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Wed, 12 Mar 2025 16:42:42 +0100 Subject: [PATCH 058/157] change database query options --- services/helper/helper_service/app.py | 2 +- .../helper/helper_service/core/helper_operations.py | 13 ++++++------- services/register/register_service/app.py | 2 +- .../register_service/core/register_operations.py | 10 +++++----- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/services/helper/helper_service/app.py b/services/helper/helper_service/app.py index d7303999..6dd56d8c 100644 --- a/services/helper/helper_service/app.py +++ b/services/helper/helper_service/app.py @@ -16,7 +16,7 @@ config = Config().get_config() # Connect MongoDB and get TTL for superadmin certificate db = MongoDatabse() -capif_config = db.get_col_by_name("capif_configuration").find_one({"config_name": "default"}) +capif_config = db.get_col_by_name("capif_configuration").find_one({}) ttl_superadmin_cert = capif_config["settings"]["certificates_expiry"].get("ttl_superadmin_cert", "43000h") # Setting log level diff --git a/services/helper/helper_service/core/helper_operations.py b/services/helper/helper_service/core/helper_operations.py index 31cb9877..302967a3 100644 --- a/services/helper/helper_service/core/helper_operations.py +++ b/services/helper/helper_service/core/helper_operations.py @@ -205,7 +205,7 @@ class HelperOperations: """Recupera toda la configuración actual""" current_app.logger.debug("Retrieving current CAPIF configuration") config_col = self.db.get_col_by_name(self.db.capif_configuration) - config = config_col.find_one({"config_name": "default"}, {"_id": 0}) + config = config_col.find_one({}, {"_id": 0}) if not config: return jsonify(message="No CAPIF configuration found"), 404 @@ -221,11 +221,10 @@ class HelperOperations: current_app.logger.debug(f"Updating configuration parameter: {param_path} with value: {new_value}") config_col = self.db.get_col_by_name(self.db.capif_configuration) - + # Construir el query dinámico para actualizar un parámetro específico update_query = {"$set": {param_path: new_value}} - - result = config_col.update_one({"config_name": "default"}, update_query) + result = config_col.update_one({}, update_query) if result.modified_count == 0: return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 @@ -242,7 +241,7 @@ class HelperOperations: config_col = self.db.get_col_by_name(self.db.capif_configuration) # Reemplazar la configuración existente con la nueva - result = config_col.replace_one({"config_name": "default"}, new_config, upsert=True) + result = config_col.replace_one({}, new_config, upsert=True) if result.matched_count == 0: return jsonify(message="No existing configuration found; a new one was created"), 201 @@ -262,7 +261,7 @@ class HelperOperations: # MongoDB $set para añadir la nueva categoría dentro de settings update_query = {"$set": {f"settings.{category_name}": category_values}} - result = config_col.update_one({"config_name": "default"}, update_query) + result = config_col.update_one({}, update_query) if result.modified_count == 0: return jsonify(message=f"No configuration found or category '{category_name}' not added"), 404 @@ -275,7 +274,7 @@ class HelperOperations: config_col = self.db.get_col_by_name(self.db.capif_configuration) update_query = {"$set": {f"settings.{param_path}": new_value}} - result = config_col.update_one({"config_name": "default"}, update_query) + result = config_col.update_one({}, update_query) if result.modified_count == 0: return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 diff --git a/services/register/register_service/app.py b/services/register/register_service/app.py index 6521c1e9..8a03c2df 100644 --- a/services/register/register_service/app.py +++ b/services/register/register_service/app.py @@ -21,7 +21,7 @@ config = Config().get_config() # Connect MongoDB and get TTL for superadmin certificate db = MongoDatabse() -capif_config = db.get_col_by_name("capif_configuration").find_one({"config_name": "default"}) +capif_config = db.get_col_by_name("capif_configuration").find_one({}) ttl_superadmin_cert = capif_config.get("settings", {}).get("certificates_expiry", {}).get("ttl_superadmin_cert", "43000h") # Setting log level diff --git a/services/register/register_service/core/register_operations.py b/services/register/register_service/core/register_operations.py index df65f11e..cdf43863 100644 --- a/services/register/register_service/core/register_operations.py +++ b/services/register/register_service/core/register_operations.py @@ -99,7 +99,7 @@ class RegisterOperations: """Retrieve the current register configuration from MongoDB""" current_app.logger.debug("Retrieving register configuration") config_col = self.db.get_col_by_name(self.db.capif_configuration) - config = config_col.find_one({"config_name": "default"}, {"_id": 0}) + config = config_col.find_one({}, {"_id": 0}) if not config: return jsonify(message="No register configuration found"), 404 @@ -112,7 +112,7 @@ class RegisterOperations: config_col = self.db.get_col_by_name(self.db.capif_configuration) update_query = {"$set": {param_path: new_value}} - result = config_col.update_one({"config_name": "default"}, update_query) + result = config_col.update_one({}, update_query) if result.modified_count == 0: return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 @@ -124,7 +124,7 @@ class RegisterOperations: current_app.logger.debug("Replacing entire register configuration") config_col = self.db.get_col_by_name(self.db.capif_configuration) - result = config_col.replace_one({"config_name": "default"}, new_config, upsert=True) + result = config_col.replace_one({}, new_config, upsert=True) if result.matched_count == 0: return jsonify(message="No existing configuration found; a new one was created"), 201 @@ -138,7 +138,7 @@ class RegisterOperations: config_col = self.db.get_col_by_name(self.db.capif_configuration) update_query = {"$set": {f"settings.{category_name}": category_values}} - result = config_col.update_one({"config_name": "default"}, update_query) + result = config_col.update_one({}, update_query) if result.modified_count == 0: return jsonify(message=f"No configuration found or category '{category_name}' not added"), 404 @@ -152,7 +152,7 @@ class RegisterOperations: config_col = self.db.get_col_by_name(self.db.capif_configuration) update_query = {"$set": {f"settings.{param_path}": new_value}} - result = config_col.update_one({"config_name": "default"}, update_query) + result = config_col.update_one({}, update_query) if result.modified_count == 0: return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 -- GitLab From 46b211a8ba4b8656c03a30fd29780e5fab69dd79 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 13 Mar 2025 12:14:21 +0100 Subject: [PATCH 059/157] convert to snake case --- .../helper_service/core/helper_operations.py | 29 ++++++++++++------- services/helper/helper_service/utils/utils.py | 15 ++++++++++ .../core/register_operations.py | 25 +++++++++------- .../register/register_service/utils/utils.py | 15 ++++++++++ 4 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 services/helper/helper_service/utils/utils.py create mode 100644 services/register/register_service/utils/utils.py diff --git a/services/helper/helper_service/core/helper_operations.py b/services/helper/helper_service/core/helper_operations.py index 302967a3..7a0cc8c7 100644 --- a/services/helper/helper_service/core/helper_operations.py +++ b/services/helper/helper_service/core/helper_operations.py @@ -5,6 +5,7 @@ import requests from config import Config from db.db import MongoDatabse from flask import jsonify, current_app +from utils.utils import to_snake_case, convert_dict_keys_to_snake_case class HelperOperations: @@ -254,31 +255,37 @@ class HelperOperations: """ Adds a new category of parameters in 'settings'. """ - current_app.logger.debug(f"Añadiendo nueva categoría: {category_name} con valores: {category_values}") + current_app.logger.debug(f"Adding new category: {category_name} with values: {category_values}") config_col = self.db.get_col_by_name(self.db.capif_configuration) - # MongoDB $set para añadir la nueva categoría dentro de settings - update_query = {"$set": {f"settings.{category_name}": category_values}} + category_name_snake = to_snake_case(category_name) + category_values_snake = convert_dict_keys_to_snake_case(category_values) + + update_query = {"$set": {f"settings.{category_name_snake}": category_values_snake}} result = config_col.update_one({}, update_query) if result.modified_count == 0: - return jsonify(message=f"No configuration found or category '{category_name}' not added"), 404 + return jsonify(message=f"No configuration found or category '{category_name_snake}' not added"), 404 + + return jsonify(message=f"Category '{category_name_snake}' added successfully"), 200 - return jsonify(message=f"Category '{category_name}' added successfully"), 200 def add_new_config_setting(self, param_path, new_value): """Add a new parameter in 'settings'.""" current_app.logger.debug(f"Adding new configuration setting: {param_path} with value: {new_value}") config_col = self.db.get_col_by_name(self.db.capif_configuration) - - update_query = {"$set": {f"settings.{param_path}": new_value}} + + param_path_snake = ".".join(to_snake_case(part) for part in param_path.split(".")) + + update_query = {"$set": {f"settings.{param_path_snake}": new_value}} result = config_col.update_one({}, update_query) - + if result.modified_count == 0: - return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 - - return jsonify(message=f"Parameter '{param_path}' added successfully"), 200 + return jsonify(message=f"No configuration found or parameter '{param_path_snake}' not updated"), 404 + + return jsonify(message=f"Parameter '{param_path_snake}' added successfully"), 200 + diff --git a/services/helper/helper_service/utils/utils.py b/services/helper/helper_service/utils/utils.py new file mode 100644 index 00000000..d66e13db --- /dev/null +++ b/services/helper/helper_service/utils/utils.py @@ -0,0 +1,15 @@ +import re + +def to_snake_case(text): + """ + Convert string to snake case. + """ + return re.sub(r'\s+', '_', text).lower() + +def convert_dict_keys_to_snake_case(data): + """ + Converts the keys of a dictionary to snake_case. + """ + if isinstance(data, dict): + return {to_snake_case(k): convert_dict_keys_to_snake_case(v) for k, v in data.items()} + return data diff --git a/services/register/register_service/core/register_operations.py b/services/register/register_service/core/register_operations.py index cdf43863..3fcc89e2 100644 --- a/services/register/register_service/core/register_operations.py +++ b/services/register/register_service/core/register_operations.py @@ -7,6 +7,7 @@ from config import Config from db.db import MongoDatabse from flask import jsonify, current_app from flask_jwt_extended import create_access_token +from utils.utils import to_snake_case, convert_dict_keys_to_snake_case class RegisterOperations: @@ -137,13 +138,16 @@ class RegisterOperations: current_app.logger.debug(f"Adding new category: {category_name} with values: {category_values}") config_col = self.db.get_col_by_name(self.db.capif_configuration) - update_query = {"$set": {f"settings.{category_name}": category_values}} + category_name_snake = to_snake_case(category_name) + category_values_snake = convert_dict_keys_to_snake_case(category_values) + + update_query = {"$set": {f"settings.{category_name_snake}": category_values_snake}} result = config_col.update_one({}, update_query) - + if result.modified_count == 0: - return jsonify(message=f"No configuration found or category '{category_name}' not added"), 404 - - return jsonify(message=f"Category '{category_name}' added successfully"), 200 + return jsonify(message=f"No configuration found or category '{category_name_snake}' not added"), 404 + + return jsonify(message=f"Category '{category_name_snake}' added successfully"), 200 def add_new_config_setting(self, param_path, new_value): @@ -151,10 +155,11 @@ class RegisterOperations: current_app.logger.debug(f"Adding new configuration setting: {param_path} with value: {new_value}") config_col = self.db.get_col_by_name(self.db.capif_configuration) - update_query = {"$set": {f"settings.{param_path}": new_value}} + param_path_snake = ".".join(to_snake_case(part) for part in param_path.split(".")) + update_query = {"$set": {f"settings.{param_path_snake}": new_value}} result = config_col.update_one({}, update_query) - + if result.modified_count == 0: - return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 - - return jsonify(message=f"Parameter '{param_path}' added successfully"), 200 + return jsonify(message=f"No configuration found or parameter '{param_path_snake}' not updated"), 404 + + return jsonify(message=f"Parameter '{param_path_snake}' added successfully"), 200 diff --git a/services/register/register_service/utils/utils.py b/services/register/register_service/utils/utils.py new file mode 100644 index 00000000..d66e13db --- /dev/null +++ b/services/register/register_service/utils/utils.py @@ -0,0 +1,15 @@ +import re + +def to_snake_case(text): + """ + Convert string to snake case. + """ + return re.sub(r'\s+', '_', text).lower() + +def convert_dict_keys_to_snake_case(data): + """ + Converts the keys of a dictionary to snake_case. + """ + if isinstance(data, dict): + return {to_snake_case(k): convert_dict_keys_to_snake_case(v) for k, v in data.items()} + return data -- GitLab From 4be5be999f6ca13957734f9c7392b579f25dde3d Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 13 Mar 2025 21:28:39 +0100 Subject: [PATCH 060/157] remove delete config and add snake case checks --- .../controllers/helper_controller.py | 24 +++++++++ .../helper_service/core/helper_operations.py | 49 ++++++++++++++++--- services/helper/helper_service/utils/utils.py | 20 ++++++++ .../controllers/register_controller.py | 29 +++++++++++ .../core/register_operations.py | 47 +++++++++++++++++- .../register/register_service/utils/utils.py | 19 +++++++ 6 files changed, 180 insertions(+), 8 deletions(-) diff --git a/services/helper/helper_service/controllers/helper_controller.py b/services/helper/helper_service/controllers/helper_controller.py index 77069650..5a8eba34 100644 --- a/services/helper/helper_service/controllers/helper_controller.py +++ b/services/helper/helper_service/controllers/helper_controller.py @@ -167,3 +167,27 @@ def add_new_config_setting(): return jsonify(message="Missing 'param_path' or 'new_value' in request body"), 400 return helper_operation.add_new_config_setting(param_path, new_value) + + +@helper_routes.route("/helper/removeConfigParam", methods=["DELETE"]) +def remove_config_param(): + """Deletes a specific parameter inside 'settings'.""" + data = request.json + param_path = data.get("param_path") + + if not param_path: + return jsonify(message="Missing 'param_path' in request body"), 400 + + return helper_operation.remove_config_param(param_path) + + +@helper_routes.route("/helper/removeConfigCategory", methods=["DELETE"]) +def remove_config_category(): + """Deletes an entire category inside 'settings'.""" + data = request.json + category_name = data.get("category_name") + + if not category_name: + return jsonify(message="Missing 'category_name' in request body"), 400 + + return helper_operation.remove_config_category(category_name) diff --git a/services/helper/helper_service/core/helper_operations.py b/services/helper/helper_service/core/helper_operations.py index 7a0cc8c7..243ec45c 100644 --- a/services/helper/helper_service/core/helper_operations.py +++ b/services/helper/helper_service/core/helper_operations.py @@ -5,7 +5,7 @@ import requests from config import Config from db.db import MongoDatabse from flask import jsonify, current_app -from utils.utils import to_snake_case, convert_dict_keys_to_snake_case +from utils.utils import to_snake_case, convert_dict_keys_to_snake_case, validate_snake_case_keys class HelperOperations: @@ -203,7 +203,7 @@ class HelperOperations: return jsonify(message="User entities removed successfully"), 200 def get_configuration(self): - """Recupera toda la configuración actual""" + """Get all current settings.""" current_app.logger.debug("Retrieving current CAPIF configuration") config_col = self.db.get_col_by_name(self.db.capif_configuration) config = config_col.find_one({}, {"_id": 0}) @@ -216,14 +216,13 @@ class HelperOperations: def update_config_param(self, param_path, new_value): """ - Actualiza un único parámetro en la configuración. - param_path: Ruta del parámetro (ej. settings.acl_policy_settings.allowed_total_invocations) + Updates a single parameter in the configuration. + param_path: Path of the parameter (e.g., settings.acl_policy_settings.allowed_total_invocations) """ current_app.logger.debug(f"Updating configuration parameter: {param_path} with value: {new_value}") config_col = self.db.get_col_by_name(self.db.capif_configuration) - # Construir el query dinámico para actualizar un parámetro específico update_query = {"$set": {param_path: new_value}} result = config_col.update_one({}, update_query) @@ -235,13 +234,16 @@ class HelperOperations: def replace_configuration(self, new_config): """ - Reemplaza toda la configuración actual con una nueva. + Replaces all current settings with a new one. """ current_app.logger.debug("Replacing entire CAPIF configuration") + error_response = validate_snake_case_keys(new_config) + if error_response: + return error_response + config_col = self.db.get_col_by_name(self.db.capif_configuration) - # Reemplazar la configuración existente con la nueva result = config_col.replace_one({}, new_config, upsert=True) if result.matched_count == 0: @@ -288,4 +290,37 @@ class HelperOperations: return jsonify(message=f"Parameter '{param_path_snake}' added successfully"), 200 + def remove_config_param(self, param_path): + """Removes a specific parameter inside 'settings'.""" + current_app.logger.debug(f"Removing configuration parameter: {param_path}") + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + param_path_snake = ".".join(to_snake_case(part) for part in param_path.split(".")) + + update_query = {"$unset": {f"settings.{param_path_snake}": ""}} + + result = config_col.update_one({}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or parameter '{param_path_snake}' not removed"), 404 + + return jsonify(message=f"Parameter '{param_path_snake}' removed successfully"), 200 + + + def remove_config_category(self, category_name): + """Removes an entire category inside 'settings'.""" + current_app.logger.debug(f"Removing configuration category: {category_name}") + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + category_name_snake = to_snake_case(category_name) + + update_query = {"$unset": {f"settings.{category_name_snake}": ""}} + + result = config_col.update_one({}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or category '{category_name_snake}' not removed"), 404 + return jsonify(message=f"Category '{category_name_snake}' removed successfully"), 200 diff --git a/services/helper/helper_service/utils/utils.py b/services/helper/helper_service/utils/utils.py index d66e13db..c870a408 100644 --- a/services/helper/helper_service/utils/utils.py +++ b/services/helper/helper_service/utils/utils.py @@ -1,4 +1,5 @@ import re +from flask import jsonify def to_snake_case(text): """ @@ -13,3 +14,22 @@ def convert_dict_keys_to_snake_case(data): if isinstance(data, dict): return {to_snake_case(k): convert_dict_keys_to_snake_case(v) for k, v in data.items()} return data + + +def is_snake_case(value): + """ + Checks if a key is in snake_case. + """ + return bool(re.match(r'^[a-z0-9_]+$', value)) + +def validate_snake_case_keys(obj, path="root"): + """ + Iterates through the JSON validating that all keys are in snake_case. + """ + for key, value in obj.items(): + if not is_snake_case(key): + return jsonify({"error": f"The key '{path}.{key}' is not in snake_case"}), 400 + if isinstance(value, dict): + error_response = validate_snake_case_keys(value, f"{path}.{key}") + if error_response: + return error_response diff --git a/services/register/register_service/controllers/register_controller.py b/services/register/register_service/controllers/register_controller.py index 989c169d..85777ed3 100644 --- a/services/register/register_service/controllers/register_controller.py +++ b/services/register/register_service/controllers/register_controller.py @@ -217,3 +217,32 @@ def add_new_config_setting(): return jsonify(message="Missing 'param_path' or 'new_value' in request body"), 400 return register_operation.add_new_config_setting(param_path, new_value) + + +@register_routes.route("/configuration/removeConfigParam", methods=["DELETE"]) +@admin_required() +def remove_register_config_param(username): + """Remove a specific parameter in the register configuration""" + data = request.json + param_path = data.get("param_path") + + if not param_path: + return jsonify(message="Missing 'param_path' in request body"), 400 + + current_app.logger.debug(f"Admin {username} is removing parameter {param_path}") + return register_operation.remove_register_config_param(param_path) + + +@register_routes.route("/configuration/removeConfigCategory", methods=["DELETE"]) +@admin_required() +def remove_register_config_category(username): + """Remove an entire category in the register configuration""" + data = request.json + category_name = data.get("category_name") + + if not category_name: + return jsonify(message="Missing 'category_name' in request body"), 400 + + current_app.logger.debug(f"Admin {username} is removing category {category_name}") + return register_operation.remove_register_config_category(category_name) + diff --git a/services/register/register_service/core/register_operations.py b/services/register/register_service/core/register_operations.py index 3fcc89e2..452a8c0d 100644 --- a/services/register/register_service/core/register_operations.py +++ b/services/register/register_service/core/register_operations.py @@ -7,7 +7,7 @@ from config import Config from db.db import MongoDatabse from flask import jsonify, current_app from flask_jwt_extended import create_access_token -from utils.utils import to_snake_case, convert_dict_keys_to_snake_case +from utils.utils import to_snake_case, convert_dict_keys_to_snake_case, validate_snake_case_keys class RegisterOperations: @@ -123,6 +123,11 @@ class RegisterOperations: def replace_register_configuration(self, new_config): """Replace the entire register configuration""" current_app.logger.debug("Replacing entire register configuration") + + error_response = validate_snake_case_keys(new_config) + if error_response: + return error_response + config_col = self.db.get_col_by_name(self.db.capif_configuration) result = config_col.replace_one({}, new_config, upsert=True) @@ -163,3 +168,43 @@ class RegisterOperations: return jsonify(message=f"No configuration found or parameter '{param_path_snake}' not updated"), 404 return jsonify(message=f"Parameter '{param_path_snake}' added successfully"), 200 + + + def remove_register_config_param(self, param_path): + """ + Removes a specific parameter in the registry settings. + """ + current_app.logger.debug(f"Removing configuration parameter: {param_path}") + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + param_path_snake = ".".join(to_snake_case(part) for part in param_path.split(".")) + update_query = {"$unset": {f"settings.{param_path_snake}": ""}} + + result = config_col.update_one({}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or parameter '{param_path_snake}' not removed"), 404 + + return jsonify(message=f"Parameter '{param_path_snake}' removed successfully"), 200 + + + def remove_register_config_category(self, category_name): + """ + Deletes an entire category within 'settings'. + """ + current_app.logger.debug(f"Removing configuration category: {category_name}") + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + category_name_snake = to_snake_case(category_name) + update_query = {"$unset": {f"settings.{category_name_snake}": ""}} + + result = config_col.update_one({}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or category '{category_name_snake}' not removed"), 404 + + return jsonify(message=f"Category '{category_name_snake}' removed successfully"), 200 + + diff --git a/services/register/register_service/utils/utils.py b/services/register/register_service/utils/utils.py index d66e13db..067bf1f1 100644 --- a/services/register/register_service/utils/utils.py +++ b/services/register/register_service/utils/utils.py @@ -1,4 +1,5 @@ import re +from flask import jsonify def to_snake_case(text): """ @@ -13,3 +14,21 @@ def convert_dict_keys_to_snake_case(data): if isinstance(data, dict): return {to_snake_case(k): convert_dict_keys_to_snake_case(v) for k, v in data.items()} return data + +def is_snake_case(value): + """ + Checks if a key is in snake_case. + """ + return bool(re.match(r'^[a-z0-9_]+$', value)) + +def validate_snake_case_keys(obj, path="root"): + """ + Iterates through the JSON validating that all keys are in snake_case. + """ + for key, value in obj.items(): + if not is_snake_case(key): + return jsonify({"error": f"The key '{path}.{key}' is not in snake_case"}), 400 + if isinstance(value, dict): + error_response = validate_snake_case_keys(value, f"{path}.{key}") + if error_response: + return error_response -- GitLab From 51c5955ed7ea870e52a7bbfb6de026c4150cc0ac Mon Sep 17 00:00:00 2001 From: guillecxb Date: Fri, 14 Mar 2025 11:23:51 +0100 Subject: [PATCH 061/157] format string to int --- .../helper_service/core/helper_operations.py | 25 +++++++-- services/helper/helper_service/utils/utils.py | 56 +++++++++++++++++++ 2 files changed, 76 insertions(+), 5 deletions(-) diff --git a/services/helper/helper_service/core/helper_operations.py b/services/helper/helper_service/core/helper_operations.py index 243ec45c..77384cda 100644 --- a/services/helper/helper_service/core/helper_operations.py +++ b/services/helper/helper_service/core/helper_operations.py @@ -5,7 +5,7 @@ import requests from config import Config from db.db import MongoDatabse from flask import jsonify, current_app -from utils.utils import to_snake_case, convert_dict_keys_to_snake_case, validate_snake_case_keys +from utils.utils import to_snake_case, convert_dict_keys_to_snake_case, validate_snake_case_keys, get_nested_value, convert_value_to_original_type, convert_nested_values class HelperOperations: @@ -223,7 +223,18 @@ class HelperOperations: config_col = self.db.get_col_by_name(self.db.capif_configuration) - update_query = {"$set": {param_path: new_value}} + existing_config = config_col.find_one({}, {"_id": 0}) + current_value = get_nested_value(existing_config, param_path) + + if current_value is None: + return jsonify(message=f"The parameter '{param_path}' does not exist in the configuration"), 404 + + converted_value = convert_value_to_original_type(new_value, current_value) + + if isinstance(converted_value, tuple): + return converted_value + + update_query = {"$set": {param_path: converted_value}} result = config_col.update_one({}, update_query) if result.modified_count == 0: @@ -231,10 +242,10 @@ class HelperOperations: return jsonify(message=f"Parameter '{param_path}' updated successfully"), 200 - + def replace_configuration(self, new_config): """ - Replaces all current settings with a new one. + Replace all current settings with a new one. """ current_app.logger.debug("Replacing entire CAPIF configuration") @@ -243,6 +254,10 @@ class HelperOperations: return error_response config_col = self.db.get_col_by_name(self.db.capif_configuration) + existing_config = config_col.find_one({}, {"_id": 0}) + + if existing_config: + new_config = convert_nested_values(new_config, existing_config) result = config_col.replace_one({}, new_config, upsert=True) @@ -255,7 +270,7 @@ class HelperOperations: def add_new_configuration(self, category_name, category_values): """ - Adds a new category of parameters in 'settings'. + Add a new category of parameters in 'settings'. """ current_app.logger.debug(f"Adding new category: {category_name} with values: {category_values}") diff --git a/services/helper/helper_service/utils/utils.py b/services/helper/helper_service/utils/utils.py index c870a408..cca2b410 100644 --- a/services/helper/helper_service/utils/utils.py +++ b/services/helper/helper_service/utils/utils.py @@ -33,3 +33,59 @@ def validate_snake_case_keys(obj, path="root"): error_response = validate_snake_case_keys(value, f"{path}.{key}") if error_response: return error_response + +def get_nested_value(config, path): + """ + Obtiene un valor dentro de un diccionario anidado siguiendo una ruta de claves separadas por puntos. + """ + keys = path.split('.') + for key in keys: + if isinstance(config, dict) and key in config: + config = config[key] + else: + return None + return config + +def convert_value_to_original_type(new_value, current_value): + """ + Convierte new_value al tipo de current_value si es posible. + """ + if isinstance(current_value, int): + try: + return int(new_value) + except ValueError: + return jsonify(message=f"Valor inválido: {new_value} no es un entero"), 400 + elif isinstance(current_value, float): + try: + return float(new_value) + except ValueError: + return jsonify(message=f"Valor inválido: {new_value} no es un flotante"), 400 + elif isinstance(current_value, bool): + if isinstance(new_value, str) and new_value.lower() in ["true", "false"]: + return new_value.lower() == "true" + elif not isinstance(new_value, bool): + return jsonify(message=f"Valor inválido: {new_value} no es un booleano"), 400 + return new_value + +def convert_nested_values(new_data, reference_data): + """ + Recorre recursivamente new_data y convierte los valores al tipo original basado en reference_data. + """ + if isinstance(new_data, dict) and isinstance(reference_data, dict): + for key, value in new_data.items(): + if key in reference_data: + new_data[key] = convert_nested_values(value, reference_data[key]) + elif isinstance(reference_data, int): + try: + return int(new_data) + except ValueError: + return new_data + elif isinstance(reference_data, float): + try: + return float(new_data) + except ValueError: + return new_data + elif isinstance(reference_data, bool): + if isinstance(new_data, str) and new_data.lower() in ["true", "false"]: + return new_data.lower() == "true" + return new_data \ No newline at end of file -- GitLab From 1550b228393e88a121dcf1a24c45ee338323aafa Mon Sep 17 00:00:00 2001 From: guillecxb Date: Fri, 14 Mar 2025 11:31:24 +0100 Subject: [PATCH 062/157] format --- .../capif_acl/core/internal_service_ops.py | 2 -- services/helper/helper_service/utils/utils.py | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py index c65da11a..700805b0 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/internal_service_ops.py @@ -35,8 +35,6 @@ class InternalServiceOps(Resource): allowed_invocations_per_second = 0 time_range_days = 0 - - res = mycol.find_one( {"service_id": service_id, "aef_id": aef_id}, {"_id": 0}) diff --git a/services/helper/helper_service/utils/utils.py b/services/helper/helper_service/utils/utils.py index cca2b410..a5349309 100644 --- a/services/helper/helper_service/utils/utils.py +++ b/services/helper/helper_service/utils/utils.py @@ -36,7 +36,7 @@ def validate_snake_case_keys(obj, path="root"): def get_nested_value(config, path): """ - Obtiene un valor dentro de un diccionario anidado siguiendo una ruta de claves separadas por puntos. + Gets a value within a nested dictionary by following a path of keys separated by periods. """ keys = path.split('.') for key in keys: @@ -48,28 +48,28 @@ def get_nested_value(config, path): def convert_value_to_original_type(new_value, current_value): """ - Convierte new_value al tipo de current_value si es posible. + Convert new_value to the type of current_value. """ if isinstance(current_value, int): try: return int(new_value) except ValueError: - return jsonify(message=f"Valor inválido: {new_value} no es un entero"), 400 + return jsonify(message=f"Invalid value: {new_value} is not an integer"), 400 elif isinstance(current_value, float): try: return float(new_value) except ValueError: - return jsonify(message=f"Valor inválido: {new_value} no es un flotante"), 400 + return jsonify(message=f"Invalid value: {new_value} is not a float"), 400 elif isinstance(current_value, bool): if isinstance(new_value, str) and new_value.lower() in ["true", "false"]: return new_value.lower() == "true" elif not isinstance(new_value, bool): - return jsonify(message=f"Valor inválido: {new_value} no es un booleano"), 400 + return jsonify(message=f"Invalid value: {new_value} is not a boolean"), 400 return new_value def convert_nested_values(new_data, reference_data): """ - Recorre recursivamente new_data y convierte los valores al tipo original basado en reference_data. + Recursively traverses new_data and converts values ​​back to the original type based on reference_data. """ if isinstance(new_data, dict) and isinstance(reference_data, dict): for key, value in new_data.items(): -- GitLab From 1cf8bf23d2ab10b462d1bc3dbf6fa6301e4fd651 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 17 Mar 2025 11:11:09 +0100 Subject: [PATCH 063/157] fix helm configmap format --- .../charts/ocf-helper/templates/ocf-helper-configmap.yaml | 3 +-- helm/capif/charts/ocf-register/templates/configmap.yaml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml index 6315ccdf..48a72a4c 100644 --- a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml +++ b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml @@ -24,6 +24,5 @@ data: } {{- if .Values.capifConfiguration }} - capif_configuration: - {{- toYaml .Values.capifConfiguration | regexReplaceAll "([a-z])([A-Z])" "${1}_${2}" | lower | nindent 4 }} + capif_configuration: {{ .Values.capifConfiguration | toPrettyJson | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/helm/capif/charts/ocf-register/templates/configmap.yaml b/helm/capif/charts/ocf-register/templates/configmap.yaml index 7e3025e8..8aa0f811 100644 --- a/helm/capif/charts/ocf-register/templates/configmap.yaml +++ b/helm/capif/charts/ocf-register/templates/configmap.yaml @@ -32,6 +32,5 @@ data: } {{- if .Values.capifConfiguration }} - capif_configuration: - {{- toYaml .Values.capifConfiguration | regexReplaceAll "([a-z])([A-Z])" "${1}_${2}" | lower | nindent 4 }} + capif_configuration: {{ .Values.capifConfiguration | toPrettyJson | nindent 4 }} {{- end }} -- GitLab From 10d5d7d62822304663c44439e0d043052d7c4369 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 17 Mar 2025 11:15:43 +0100 Subject: [PATCH 064/157] Add -P option to yaml to write config.yaml in local testing with prettyprint active --- services/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/run.sh b/services/run.sh index fbd0750d..7cb00c34 100755 --- a/services/run.sh +++ b/services/run.sh @@ -135,7 +135,7 @@ cp $REGISTER_CONFIG_FILE $REGISTER_CONFIG_FILE.bak git update-index --assume-unchanged "$REGISTER_CONFIG_FILE" # Edit Register Service URL within ccf in the config.yaml file -yq eval ".ccf.url = \"$CAPIF_HOSTNAME\"" -i "$REGISTER_CONFIG_FILE" +yq eval ".ccf.url = \"$CAPIF_HOSTNAME\"" -i "$REGISTER_CONFIG_FILE" -P # Deploy Register service CAPIF_PRIV_KEY_BASE_64=$(echo "$(cat ${SERVICES_DIR}/nginx/certs/server.key)") -- GitLab From 77f040cd64851655f8dc2cf331f9f65df2dbf5cf Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 17 Mar 2025 13:37:52 +0100 Subject: [PATCH 065/157] change camelCase to snakeCase in values --- helm/capif/charts/ocf-helper/values.yaml | 30 +++++++++++----------- helm/capif/charts/ocf-register/values.yaml | 10 ++++---- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/helm/capif/charts/ocf-helper/values.yaml b/helm/capif/charts/ocf-helper/values.yaml index 6debc810..051711f8 100644 --- a/helm/capif/charts/ocf-helper/values.yaml +++ b/helm/capif/charts/ocf-helper/values.yaml @@ -26,22 +26,22 @@ env: logLevel: "INFO" capifConfiguration: - configName: "default" - configVersion: "1.0" - configDescription: "Default CAPIF Configuration" + config_name: "default" + config_version: "1.0" + config_description: "Default CAPIF Configuration" settings: - certificatesExpiry: - ttlSuperadminCert: "4300h" - ttlInvokerCert: "4300h" - ttlProviderCert: "4300h" - securityMethodPriority: - oauthPriority: 1 - pkiPriority: 2 - pskPriority: 3 - aclPolicySettings: - allowedTotalInvocations: 5 - allowedInvocationsPerSecond: 10 - allowedInvocationTimeRangeDays: 365 + certificates_expiry: + ttl_superadmin_cert: "4300h" + ttl_invoker_cert: "4300h" + ttl_provider_cert: "4300h" + security_method_priority: + oauth_priority: 1 + pki_priority: 2 + psk_priority: 3 + acl_policy_settings: + allowed_total_invocations: 5 + allowed_invocations_per_second: 10 + allowed_invocation_time_range_days: 365 serviceAccount: # Specifies whether a service account should be created diff --git a/helm/capif/charts/ocf-register/values.yaml b/helm/capif/charts/ocf-register/values.yaml index 7d2cf166..bf12e498 100644 --- a/helm/capif/charts/ocf-register/values.yaml +++ b/helm/capif/charts/ocf-register/values.yaml @@ -25,12 +25,12 @@ env: timeout: "30" capifConfiguration: - configName: "default" - configVersion: "1.0" - configDescription: "Default Register Configuration" + config_name: "default" + config_version: "1.0" + config_description: "Default Register Configuration" settings: - certificatesExpiry: - ttlSuperadminCert: "4300h" + certificates_expiry: + ttl_superadmin_cert: "4300h" serviceAccount: # Specifies whether a service account should be created -- GitLab From 12f8f7407f2946517c4e7298e474947ccad615b7 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 17 Mar 2025 16:09:07 +0100 Subject: [PATCH 066/157] test fixing config.yaml --- services/helper/config.yaml | 18 +++++++++--------- services/register/config.yaml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/services/helper/config.yaml b/services/helper/config.yaml index 2a339145..9c9f6615 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -25,19 +25,19 @@ capif_configuration: { "description": "Default CAPIF Configuration", "settings": { "certificates_expiry": { - ttl_superadmin_cert: "4300h", - ttl_invoker_cert: "4300h", - ttl_provider_cert: "4300h", + "ttl_superadmin_cert": "4300h", + "ttl_invoker_cert": "4300h", + "ttl_provider_cert": "4300h", }, "security_method_priority": { - oauth: 1, - pki: 2, - psk: 3 + "oauth": 1, + "pki": 2, + "psk": 3 }, "acl_policy_settings": { - allowed_total_invocations: 5, - allowed_invocations_per_second: 10, - allowed_invocation_time_range_days: 365 + "allowed_total_invocations": 5, + "allowed_invocations_per_second": 10, + "allowed_invocation_time_range_days": 365 } } } diff --git a/services/register/config.yaml b/services/register/config.yaml index df8c00f5..7c303ece 100644 --- a/services/register/config.yaml +++ b/services/register/config.yaml @@ -34,7 +34,7 @@ capif_configuration: { "description": "Default Register Configuration", "settings": { "certificates_expiry": { - ttl_superadmin_cert: "4300h", + "ttl_superadmin_cert": "4300h", } } } \ No newline at end of file -- GitLab From a2251480c673d7ea112c79281de0e5604d71d99c Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 17 Mar 2025 21:33:22 +0100 Subject: [PATCH 067/157] test fixing config.yaml --- .../templates/ocf-helper-configmap.yaml | 1 + helm/capif/charts/ocf-helper/values.yaml | 6 +++--- services/helper/config.yaml | 18 +++++++++--------- services/register/config.yaml | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml index 48a72a4c..76e694bc 100644 --- a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml +++ b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml @@ -13,6 +13,7 @@ data: 'col_services': "serviceapidescriptions", 'col_security': "security", 'col_event': "eventsdetails", + 'col_capif_configuration': "capif_configuration", 'host': '{{ .Values.env.mongoHost }}', 'port': "{{ .Values.env.mongoPort }}" } diff --git a/helm/capif/charts/ocf-helper/values.yaml b/helm/capif/charts/ocf-helper/values.yaml index 051711f8..a255d463 100644 --- a/helm/capif/charts/ocf-helper/values.yaml +++ b/helm/capif/charts/ocf-helper/values.yaml @@ -35,9 +35,9 @@ capifConfiguration: ttl_invoker_cert: "4300h" ttl_provider_cert: "4300h" security_method_priority: - oauth_priority: 1 - pki_priority: 2 - psk_priority: 3 + oauth: 1 + pki: 2 + psk: 3 acl_policy_settings: allowed_total_invocations: 5 allowed_invocations_per_second: 10 diff --git a/services/helper/config.yaml b/services/helper/config.yaml index 9c9f6615..2a339145 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -25,19 +25,19 @@ capif_configuration: { "description": "Default CAPIF Configuration", "settings": { "certificates_expiry": { - "ttl_superadmin_cert": "4300h", - "ttl_invoker_cert": "4300h", - "ttl_provider_cert": "4300h", + ttl_superadmin_cert: "4300h", + ttl_invoker_cert: "4300h", + ttl_provider_cert: "4300h", }, "security_method_priority": { - "oauth": 1, - "pki": 2, - "psk": 3 + oauth: 1, + pki: 2, + psk: 3 }, "acl_policy_settings": { - "allowed_total_invocations": 5, - "allowed_invocations_per_second": 10, - "allowed_invocation_time_range_days": 365 + allowed_total_invocations: 5, + allowed_invocations_per_second: 10, + allowed_invocation_time_range_days: 365 } } } diff --git a/services/register/config.yaml b/services/register/config.yaml index 7c303ece..df8c00f5 100644 --- a/services/register/config.yaml +++ b/services/register/config.yaml @@ -34,7 +34,7 @@ capif_configuration: { "description": "Default Register Configuration", "settings": { "certificates_expiry": { - "ttl_superadmin_cert": "4300h", + ttl_superadmin_cert: "4300h", } } } \ No newline at end of file -- GitLab From 2444f919159d6e8bfd7c60894682ac77ab319a31 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Tue, 18 Mar 2025 12:03:40 +0100 Subject: [PATCH 068/157] final config.yaml format --- .../templates/ocf-helper-configmap.yaml | 2 +- .../ocf-register/templates/configmap.yaml | 2 +- services/helper/config.yaml | 37 ++++++++----------- services/register/config.yaml | 17 ++++----- 4 files changed, 25 insertions(+), 33 deletions(-) diff --git a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml index 76e694bc..fe3e1c17 100644 --- a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml +++ b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml @@ -25,5 +25,5 @@ data: } {{- if .Values.capifConfiguration }} - capif_configuration: {{ .Values.capifConfiguration | toPrettyJson | nindent 4 }} + capif_configuration: {{ .Values.capifConfiguration | toYaml | nindent 6 }} {{- end }} \ No newline at end of file diff --git a/helm/capif/charts/ocf-register/templates/configmap.yaml b/helm/capif/charts/ocf-register/templates/configmap.yaml index 8aa0f811..2b89f180 100644 --- a/helm/capif/charts/ocf-register/templates/configmap.yaml +++ b/helm/capif/charts/ocf-register/templates/configmap.yaml @@ -32,5 +32,5 @@ data: } {{- if .Values.capifConfiguration }} - capif_configuration: {{ .Values.capifConfiguration | toPrettyJson | nindent 4 }} + capif_configuration: {{ .Values.capifConfiguration | toYaml | nindent 6 }} {{- end }} diff --git a/services/helper/config.yaml b/services/helper/config.yaml index 2a339145..1efa369e 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -19,25 +19,20 @@ ca_factory: { "verify": False } -capif_configuration: { - "config_name": "default", - "version": "1.0", - "description": "Default CAPIF Configuration", - "settings": { - "certificates_expiry": { - ttl_superadmin_cert: "4300h", - ttl_invoker_cert: "4300h", - ttl_provider_cert: "4300h", - }, - "security_method_priority": { - oauth: 1, - pki: 2, - psk: 3 - }, - "acl_policy_settings": { - allowed_total_invocations: 5, - allowed_invocations_per_second: 10, +capif_configuration: + config_description: Default CAPIF Configuration + config_name: default + config_version: "1.0" + settings: + acl_policy_settings: allowed_invocation_time_range_days: 365 - } - } -} + allowed_invocations_per_second: 10 + allowed_total_invocations: 5 + certificates_expiry: + ttl_invoker_cert: 4300h + ttl_provider_cert: 4300h + ttl_superadmin_cert: 4300h + security_method_priority: + oauth: 1 + pki: 2 + psk: 3 diff --git a/services/register/config.yaml b/services/register/config.yaml index df8c00f5..85fb232c 100644 --- a/services/register/config.yaml +++ b/services/register/config.yaml @@ -28,13 +28,10 @@ register: { admin_pass: "password123"} } -capif_configuration: { - "config_name": "default", - "version": "1.0", - "description": "Default Register Configuration", - "settings": { - "certificates_expiry": { - ttl_superadmin_cert: "4300h", - } - } -} \ No newline at end of file +capif_configuration: + config_description: Default Register Configuration + config_name: default + config_version: "1.0" + settings: + certificates_expiry: + ttl_superadmin_cert: 4300h \ No newline at end of file -- GitLab From e6e1581b40d995ba3933187b66d39cc60b6e1d65 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 25 Mar 2025 15:58:50 +0100 Subject: [PATCH 069/157] New templates for Issues and MRs --- .gitlab/issue_templates/issue_template.md | 24 +++++++++++++++++++ .../merge_request_templates/issue_template.md | 24 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .gitlab/issue_templates/issue_template.md create mode 100644 .gitlab/merge_request_templates/issue_template.md diff --git a/.gitlab/issue_templates/issue_template.md b/.gitlab/issue_templates/issue_template.md new file mode 100644 index 00000000..2bc23639 --- /dev/null +++ b/.gitlab/issue_templates/issue_template.md @@ -0,0 +1,24 @@ +# Proposers + +- name-of-proposer-1 (institution-of-proposer-1) +- name-of-proposer-2 (institution-of-proposer-2) +... + +# Description + +Describe your proposal in ~1000 characters. +You can reference external content listed in section "References" as [Ref-1]. + +# Demo or definition of done + +Describe which high level conditions needs to be fulfilled to demonstrate this feature implementation is completed. +You can reference external content (example, demo paper) listed in section "References" as [Ref-2]. + +# References + +1. [Reference name](https://reference-url) +2. Author1, Author2, Author3, et. al., “My demo using feature,” in Conference-Name Demo Track, 20XX. + +# Acknowledgements +This work is funded by the European Commission through the project with Grant Agreement number . +```example HORIZON-JU-SNS-2022 FLEX-SCALE project with Grant Agreement number 101096909.``` diff --git a/.gitlab/merge_request_templates/issue_template.md b/.gitlab/merge_request_templates/issue_template.md new file mode 100644 index 00000000..2bc23639 --- /dev/null +++ b/.gitlab/merge_request_templates/issue_template.md @@ -0,0 +1,24 @@ +# Proposers + +- name-of-proposer-1 (institution-of-proposer-1) +- name-of-proposer-2 (institution-of-proposer-2) +... + +# Description + +Describe your proposal in ~1000 characters. +You can reference external content listed in section "References" as [Ref-1]. + +# Demo or definition of done + +Describe which high level conditions needs to be fulfilled to demonstrate this feature implementation is completed. +You can reference external content (example, demo paper) listed in section "References" as [Ref-2]. + +# References + +1. [Reference name](https://reference-url) +2. Author1, Author2, Author3, et. al., “My demo using feature,” in Conference-Name Demo Track, 20XX. + +# Acknowledgements +This work is funded by the European Commission through the project with Grant Agreement number . +```example HORIZON-JU-SNS-2022 FLEX-SCALE project with Grant Agreement number 101096909.``` -- GitLab From a1ac9bb913e19e6dea0b6bc1efd9460475e0d997 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 25 Mar 2025 16:13:41 +0100 Subject: [PATCH 070/157] Setup default templated --- .gitlab/issue_templates/{issue_template.md => default.md} | 0 .gitlab/merge_request_templates/{issue_template.md => Default.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .gitlab/issue_templates/{issue_template.md => default.md} (100%) rename .gitlab/merge_request_templates/{issue_template.md => Default.md} (100%) diff --git a/.gitlab/issue_templates/issue_template.md b/.gitlab/issue_templates/default.md similarity index 100% rename from .gitlab/issue_templates/issue_template.md rename to .gitlab/issue_templates/default.md diff --git a/.gitlab/merge_request_templates/issue_template.md b/.gitlab/merge_request_templates/Default.md similarity index 100% rename from .gitlab/merge_request_templates/issue_template.md rename to .gitlab/merge_request_templates/Default.md -- GitLab From ac1446b806fb402a1d876c7c76a027314cfb94e2 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 26 Mar 2025 16:11:21 +0100 Subject: [PATCH 071/157] Test updated according to new logic. Now tests that create a security context must send valid aef_id and api_id, because now serivce API existence is checked by interfaceDescription or aef_id and api_id --- .../capif_security_api.robot | 272 +++++++++++++++--- tests/libraries/security_api/bodyRequests.py | 107 ++++++- 2 files changed, 331 insertions(+), 48 deletions(-) diff --git a/tests/features/CAPIF Security Api/capif_security_api.robot b/tests/features/CAPIF Security Api/capif_security_api.robot index 85b26ee3..8d511765 100644 --- a/tests/features/CAPIF Security Api/capif_security_api.robot +++ b/tests/features/CAPIF Security Api/capif_security_api.robot @@ -14,6 +14,7 @@ Test Teardown Reset Testing Environment ${APF_ID_NOT_VALID} apf-example ${SERVICE_API_ID_NOT_VALID} not-valid ${API_INVOKER_NOT_VALID} not-valid +${AEF_ID_NOT_VALID} not-valid *** Test Cases *** @@ -22,8 +23,22 @@ Create a security context for an API invoker # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding + # Register Provider + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + # Create Security Context - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} ... json=${request_body} @@ -41,10 +56,21 @@ Create a security context for an API invoker with Provider role ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding # Register Provider - ${register_user_info_publisher}= Provider Default Registration + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} # Create Security Context - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} ... json=${request_body} @@ -62,10 +88,21 @@ Create a security context for an API invoker with Provider role Create a security context for an API invoker with Provider entity role and invalid apiInvokerId [Tags] capif_security_api-3 # Register APF - ${register_user_info_publisher}= Provider Default Registration + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} # Create Security Context - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${API_INVOKER_NOT_VALID} ... json=${request_body} @@ -85,7 +122,22 @@ Create a security context for an API invoker with Invalid apiInvokerID # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Register APF + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${API_INVOKER_NOT_VALID} ... json=${request_body} @@ -101,11 +153,28 @@ Create a security context for an API invoker with Invalid apiInvokerID ... cause=API Invoker not exists or invalid ID Retrieve the Security Context of an API Invoker - [Tags] capif_security_api-5 smoke + [Tags] capif_security_api-5 smoke # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Register Provider + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} + ... authentication_info=authenticationInfo + ... authorization_info=authorizationInfo ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} ... json=${request_body} @@ -118,9 +187,6 @@ Retrieve the Security Context of an API Invoker ${service_security_context}= Set Variable ${resp.json()} - # Register APF - ${register_user_info_publisher}= Provider Default Registration - # Retrieve Security context can setup by parameters if authenticationInfo and authorizationInfo are needed at response. # ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']}?authenticationInfo=true&authorizationInfo=true ${resp}= Get Request Capif @@ -161,7 +227,22 @@ Retrieve the Security Context of an API Invoker with invalid apfId # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Register Provider + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} ... json=${request_body} @@ -186,11 +267,26 @@ Retrieve the Security Context of an API Invoker with invalid apfId ... cause=User role must be aef Delete the Security Context of an API Invoker - [Tags] capif_security_api-8 smoke + [Tags] capif_security_api-8 smoke # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Register Provider + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} ... json=${request_body} @@ -200,9 +296,6 @@ Delete the Security Context of an API Invoker Check Response Variable Type And Values ${resp} 201 ServiceSecurity - # Register APF - ${register_user_info_publisher}= Provider Default Registration - # Remove Security Context ${resp}= Delete Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} @@ -230,7 +323,22 @@ Delete the Security Context of an API Invoker with Invoker entity role # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Register Provider + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} ... json=${request_body} @@ -290,14 +398,27 @@ Delete the Security Context of an API Invoker with invalid apiInvokerID ... cause=API Invoker not exists or invalid ID Update the Security Context of an API Invoker - [Tags] capif_security_api-12 smoke + [Tags] capif_security_api-12 smoke # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding # Register Provider - ${register_user_info_publisher}= Provider Default Registration + # Register Provider + ${register_user_info_provider}= Provider Default Registration - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} ... json=${request_body} @@ -312,7 +433,12 @@ Update the Security Context of an API Invoker ${security_context}= Set Variable ${resp.json()} # Update Security Context - ${request_body}= Create Service Security Body http://robot.testing2 + ${request_body}= Create Service Security Default Body + ... http://robot.testing2 + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} + ... authentication_info=authenticationInfo + ... authorization_info=authorizationInfo ${resp}= Post Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']}/update ... json=${request_body} @@ -341,7 +467,22 @@ Update the Security Context of an API Invoker with Provider entity role # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Register Provider + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} ... json=${request_body} @@ -351,9 +492,6 @@ Update the Security Context of an API Invoker with Provider entity role Check Response Variable Type And Values ${resp} 201 ServiceSecurity - # Register Provider - ${register_user_info_publisher}= Provider Default Registration - ${resp}= Post Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']}/update ... json=${request_body} @@ -371,9 +509,21 @@ Update the Security Context of an API Invoker with Provider entity role Update the Security Context of an API Invoker with AEF entity role and invalid apiInvokerId [Tags] capif_security_api-14 # Register Provider - ${register_user_info_publisher}= Provider Default Registration + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Post Request Capif ... /capif-security/v1/trustedInvokers/${API_INVOKER_NOT_VALID}/update ... json=${request_body} @@ -392,7 +542,22 @@ Update the Security Context of an API Invoker with invalid apiInvokerID # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Register Provider + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} ${resp}= Post Request Capif ... /capif-security/v1/trustedInvokers/${API_INVOKER_NOT_VALID}/update ... json=${request_body} @@ -408,7 +573,7 @@ Update the Security Context of an API Invoker with invalid apiInvokerID ... cause=API Invoker not exists or invalid ID Revoke the authorization of the API invoker for APIs - [Tags] capif_security_api-16 smoke + [Tags] capif_security_api-16 smoke # Register APF ${register_user_info_provider}= Provider Default Registration @@ -478,7 +643,24 @@ Revoke the authorization of the API invoker for APIs without valid apfID. # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Register Provider + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} + ... authorization_info=authorizationInfo + ... authentication_info=authenticationInfo ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} ... json=${request_body} @@ -490,9 +672,6 @@ Revoke the authorization of the API invoker for APIs without valid apfID. ${security_context}= Set Variable ${resp.json()} - # Register Provider - ${register_user_info_publisher}= Provider Default Registration - # Revoke Security Context by Invoker ${request_body}= Create Security Notification Body ${register_user_info_invoker['api_invoker_id']} 1234 ${resp}= Post Request Capif @@ -528,7 +707,25 @@ Revoke the authorization of the API invoker for APIs with invalid apiInvokerId # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding - ${request_body}= Create Service Security Body ${NOTIFICATION_DESTINATION_URL} + # Register Provider + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} + ... authentication_info=authenticationInfo + ... authorization_info=authorizationInfo + ... authorization_info=authorizationInfo ${resp}= Put Request Capif ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} ... json=${request_body} @@ -540,9 +737,6 @@ Revoke the authorization of the API invoker for APIs with invalid apiInvokerId ${security_context}= Set Variable ${resp.json()} - # Register Provider - ${register_user_info_publisher}= Provider Default Registration - ${request_body}= Create Security Notification Body ${API_INVOKER_NOT_VALID} 1234 ${resp}= Post Request Capif ... /capif-security/v1/trustedInvokers/${API_INVOKER_NOT_VALID}/delete @@ -569,7 +763,7 @@ Revoke the authorization of the API invoker for APIs with invalid apiInvokerId Dictionaries Should Be Equal ${resp.json()} ${security_context} Retrieve access token - [Tags] capif_security_api-19 smoke + [Tags] capif_security_api-19 smoke # Register APF ${register_user_info_provider}= Provider Default Registration diff --git a/tests/libraries/security_api/bodyRequests.py b/tests/libraries/security_api/bodyRequests.py index dabee876..5f0ec3bc 100644 --- a/tests/libraries/security_api/bodyRequests.py +++ b/tests/libraries/security_api/bodyRequests.py @@ -1,7 +1,47 @@ -def create_service_security_body(notification_destination, aef_id=None, api_id=None): +def create_service_security_default_body( + notification_destination, + supported_features="0", + interface_details=None, + aef_id=None, + api_id=None, + authentication_info=None, + authorization_info=None, + grant_type=None, + pref_security_methods=["PSK", "PKI", "OAUTH"], + sel_security_method=None, + request_websocket_uri=None, + websocket_uri=None): data = { "notificationDestination": notification_destination, - "supportedFeatures": "fffffff", + "supportedFeatures": supported_features + } + security_info = list() + security_info.append( + create_security_info(aef_id=aef_id, + interface_details=interface_details, + api_id=api_id, + authentication_info=authentication_info, + authorization_info=authorization_info, + grant_type=grant_type, + pref_security_methods=pref_security_methods, + sel_security_method=sel_security_method)) + data['securityInfo'] = security_info + if request_websocket_uri is not None or websocket_uri is not None: + data['websockNotifConfig'] = create_web_sock_notif_config( + request_websocket_uri, websocket_uri) + return data + + +def create_service_security_body(notification_destination, + supported_features, + security_info=None, + aef_id=None, + api_id=None, + authentication_info=None, + authorization_info=None): + data = { + "notificationDestination": notification_destination, + "supportedFeatures": supported_features, "securityInfo": [{ "authenticationInfo": "authenticationInfo", "authorizationInfo": "authorizationInfo", @@ -20,7 +60,12 @@ def create_service_security_body(notification_destination, aef_id=None, api_id=N "requestTestNotification": True } - if aef_id != None and api_id != None: + if aef_id is not None and api_id is not None: + security_info = dict() + if authentication_info is not None: + security_info['authenticationInfo'] = authentication_info + if authorization_info is not None: + security_info['authorizationInfo'] = authorization_info data['securityInfo'].append({ "authenticationInfo": "authenticationInfo", "authorizationInfo": "authorizationInfo", @@ -32,6 +77,48 @@ def create_service_security_body(notification_destination, aef_id=None, api_id=N return data +def create_security_info( + aef_id=None, + interface_details=None, + api_id=None, + authentication_info=None, + authorization_info=None, + grant_type=None, + pref_security_methods=None, + sel_security_method=None): + # aef_id or interface_details must be set. + # authentication_info, authorization_info, grant_type, sel_security_method + # only should be present in repsonse from CCF + data = dict() + if aef_id is not None: + data["aefId"] = aef_id + if interface_details is not None: + data['interfaceDetails'] = interface_details + if api_id is not None: + data['apiId'] = api_id + if authentication_info is not None: + data['authenticationInfo'] = authentication_info + if authorization_info is not None: + data['authorizationInfo'] = authorization_info + if grant_type is not None: + data['grantType'] = grant_type + if pref_security_methods is not None: + data['prefSecurityMethods'] = pref_security_methods + if sel_security_method is not None: + data['selSecurityMethod'] = sel_security_method + + return data + + +def create_web_sock_notif_config(request_websocket_uri=None, websocket_uri=None): + data = dict() + if request_websocket_uri is not None: + data['requestWebsocketUri'] = request_websocket_uri + if websocket_uri is not None: + data['websocketUri'] = websocket_uri + return data + + def create_service_security_from_discover_response(notification_destination, discover_response): data = { "notificationDestination": notification_destination, @@ -43,7 +130,8 @@ def create_service_security_from_discover_response(notification_destination, dis }, "requestTestNotification": True } - service_api_descriptions = discover_response.json()['serviceAPIDescriptions'] + service_api_descriptions = discover_response.json()[ + 'serviceAPIDescriptions'] for service_api_description in service_api_descriptions: for aef_profile in service_api_description['aefProfiles']: data['securityInfo'].append({ @@ -64,14 +152,13 @@ def create_security_notification_body(api_invoker_id, api_ids, cause="OVERLIMIT_ "cause": cause } - if isinstance(api_ids,list): + if isinstance(api_ids, list): data['apiIds'] = api_ids else: - data['apiIds'] = [ api_ids ] + data['apiIds'] = [api_ids] if aef_id != None: data['aefId'] = aef_id - return data @@ -88,9 +175,11 @@ def create_access_token_req_body(client_id, scope, client_secret=None, grant_typ return data + def get_api_ids_from_discover_response(discover_response): - api_ids=[] - service_api_descriptions = discover_response.json()['serviceAPIDescriptions'] + api_ids = [] + service_api_descriptions = discover_response.json()[ + 'serviceAPIDescriptions'] for service_api_description in service_api_descriptions: api_ids.append(service_api_description['apiId']) return api_ids -- GitLab From ab9c78b38716d7cd9a75299c39d45cc7d989788b Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 27 Mar 2025 14:22:35 +0100 Subject: [PATCH 072/157] added security body request --- tests/libraries/security_api/bodyRequests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/libraries/security_api/bodyRequests.py b/tests/libraries/security_api/bodyRequests.py index 2ac5edf2..409fcfcf 100644 --- a/tests/libraries/security_api/bodyRequests.py +++ b/tests/libraries/security_api/bodyRequests.py @@ -119,7 +119,7 @@ def create_web_sock_notif_config(request_websocket_uri=None, websocket_uri=None) return data -def create_service_security_from_discover_response(notification_destination, discover_response): +def create_service_security_from_discover_response(notification_destination, discover_response, legacy=True): data = { "notificationDestination": notification_destination, "supportedFeatures": "fffffff", @@ -130,8 +130,8 @@ def create_service_security_from_discover_response(notification_destination, dis }, "requestTestNotification": True } - service_api_descriptions = discover_response.json()[ - 'serviceAPIDescriptions'] + api_ids=list() + service_api_descriptions = discover_response.json()['serviceAPIDescriptions'] for service_api_description in service_api_descriptions: for aef_profile in service_api_description['aefProfiles']: data['securityInfo'].append({ -- GitLab From a6dac5997f249bf72cf3fef67f1049d459ea3766 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 27 Mar 2025 15:56:42 +0100 Subject: [PATCH 073/157] init --- .../core/provider_enrolment_details_api.py | 2 +- .../api_provider_management/util.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py index 9c964345..27a1d85d 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py @@ -12,7 +12,7 @@ from .redis_internal_event import RedisInternalEvent from .resources import Resource from .responses import internal_server_error, not_found_error, forbidden_error, make_response, bad_request_error from ..core.sign_certificate import sign_certificate -from ..util import dict_to_camel_case, clean_empty, serialize_clean_camel_case +from ..util import dict_to_camel_case, clean_empty, serialize_clean_camel_case, negotiate_supported_features class ProviderManagementOperations(Resource): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/util.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/util.py index f4f15bc5..04b1ae1f 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/util.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/util.py @@ -192,3 +192,17 @@ def _deserialize_dict(data, boxed_type): """ return {k: _deserialize(v, boxed_type) for k, v in data.items() } + +TOTAL_FEATURES = 18 +SUPPORTED_FEATURES_HEX = "201" + +def negotiate_supported_features(client_hex: str) -> str: + client_bin = bin(int(client_hex or "0", 16))[2:].zfill(TOTAL_FEATURES)[::-1] + server_bin = bin(int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] + + negotiated_bin = ''.join([ + '1' if client_bin[i] == '1' and server_bin[i] == '1' else '0' + for i in range(TOTAL_FEATURES) + ])[::-1] + + return hex(int(negotiated_bin, 2))[2:] or "0" \ No newline at end of file -- GitLab From cbf9f71ae1ee441d096f55d4efd4556ecd1a315f Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Fri, 28 Mar 2025 09:55:52 +0200 Subject: [PATCH 074/157] Add invesion and change order of supported features in return bracket --- .../service_apis/controllers/default_controller.py | 1 - .../service_apis/core/discoveredapis.py | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py index 7080f39a..fbe0640a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py @@ -56,7 +56,6 @@ def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_t if supported_features is not None: supp_feat_dict = return_negotiated_supp_feat_dict(supported_features) - current_app.logger.info(supp_feat_dict) if supp_feat_dict['VendSpecQueryParams']: for q_params in request.args: if "vend-spec" in q_params: diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py index c850e9c1..bdcd3004 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py @@ -29,13 +29,13 @@ def filter_fields(filtered_apis): def return_negotiated_supp_feat_dict(supp_feat): - final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES) + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] return { - "ApiSupportedFeatureQuery": True if final_supp_feat[3] == "1" else False, - "VendSpecQueryParams": True if final_supp_feat[2] == "1" else False, - "RNAA": True if final_supp_feat[1] == "1" else False, - "SliceBasedAPIExposure": True if final_supp_feat[0] == "1" else False + "ApiSupportedFeatureQuery": True if final_supp_feat[0] == "1" else False, + "VendSpecQueryParams": True if final_supp_feat[1] == "1" else False, + "RNAA": True if final_supp_feat[2] == "1" else False, + "SliceBasedAPIExposure": True if final_supp_feat[3] == "1" else False } -- GitLab From 3d7929b08e88412dda893f2e0abdd47946f44bc2 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Fri, 28 Mar 2025 12:47:34 +0100 Subject: [PATCH 075/157] negotiate suppFeat --- .../core/provider_enrolment_details_api.py | 19 ++++++++++++++++++- .../api_provider_management/util.py | 14 -------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py index 27a1d85d..2866cfcf 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py @@ -12,7 +12,18 @@ from .redis_internal_event import RedisInternalEvent from .resources import Resource from .responses import internal_server_error, not_found_error, forbidden_error, make_response, bad_request_error from ..core.sign_certificate import sign_certificate -from ..util import dict_to_camel_case, clean_empty, serialize_clean_camel_case, negotiate_supported_features +from ..util import dict_to_camel_case, clean_empty, serialize_clean_camel_case + + +TOTAL_FEATURES = 2 +SUPPORTED_FEATURES_HEX = "1" + +def negotiate_supported_features(supp_feat): + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] + return { + "PatchUpdate": True if final_supp_feat[0] == "1" else False, + "RNAA": True if final_supp_feat[1] == "1" else False, + } class ProviderManagementOperations(Resource): @@ -49,6 +60,12 @@ class ProviderManagementOperations(Resource): api_provider_enrolment_details.api_prov_dom_id = secrets.token_hex( 15) + + # Suppoerted Features Negotiation + client_feat = api_provider_enrolment_details.supp_feat + negotiated = negotiate_supported_features(client_feat) + api_provider_enrolment_details.supp_feat = negotiated + current_app.logger.debug(f"Negotiated supported features: {negotiated}") current_app.logger.debug("Generating certs to api prov funcs") diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/util.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/util.py index 04b1ae1f..f4f15bc5 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/util.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/util.py @@ -192,17 +192,3 @@ def _deserialize_dict(data, boxed_type): """ return {k: _deserialize(v, boxed_type) for k, v in data.items() } - -TOTAL_FEATURES = 18 -SUPPORTED_FEATURES_HEX = "201" - -def negotiate_supported_features(client_hex: str) -> str: - client_bin = bin(int(client_hex or "0", 16))[2:].zfill(TOTAL_FEATURES)[::-1] - server_bin = bin(int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] - - negotiated_bin = ''.join([ - '1' if client_bin[i] == '1' and server_bin[i] == '1' else '0' - for i in range(TOTAL_FEATURES) - ])[::-1] - - return hex(int(negotiated_bin, 2))[2:] or "0" \ No newline at end of file -- GitLab From f3fc5d4ca26af47a1c5483de7c961475d279fade Mon Sep 17 00:00:00 2001 From: guillecxb Date: Fri, 28 Mar 2025 14:03:18 +0100 Subject: [PATCH 076/157] fix comment --- .../core/provider_enrolment_details_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py index 2866cfcf..e574fcfa 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py @@ -61,7 +61,7 @@ class ProviderManagementOperations(Resource): api_provider_enrolment_details.api_prov_dom_id = secrets.token_hex( 15) - # Suppoerted Features Negotiation + # Supported Features Negotiation client_feat = api_provider_enrolment_details.supp_feat negotiated = negotiate_supported_features(client_feat) api_provider_enrolment_details.supp_feat = negotiated -- GitLab From 96af23566d6dd3f2917485e26201909ddd996cb4 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 31 Mar 2025 17:07:26 +0200 Subject: [PATCH 077/157] suppFeat mandatory --- .../core/provider_enrolment_details_api.py | 17 +++++++++++------ .../openapi/openapi.yaml | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py index e574fcfa..291e9e68 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py @@ -26,6 +26,11 @@ def negotiate_supported_features(supp_feat): } +def negotiate_supported_features_hex(supp_feat): + negotiated = int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16) + return format(negotiated, 'x') + + class ProviderManagementOperations(Resource): def __check_api_provider_domain(self, api_prov_dom_id): @@ -63,9 +68,9 @@ class ProviderManagementOperations(Resource): # Supported Features Negotiation client_feat = api_provider_enrolment_details.supp_feat - negotiated = negotiate_supported_features(client_feat) - api_provider_enrolment_details.supp_feat = negotiated - current_app.logger.debug(f"Negotiated supported features: {negotiated}") + negotiated_hex = negotiate_supported_features_hex(client_feat) + api_provider_enrolment_details.supp_feat = negotiated_hex + negotiated_flags = negotiate_supported_features(negotiated_hex) current_app.logger.debug("Generating certs to api prov funcs") @@ -89,9 +94,9 @@ class ProviderManagementOperations(Resource): current_app.logger.debug("Provider inserted in database") - res = make_response(object=serialize_clean_camel_case( - api_provider_enrolment_details), status=201) - + response_obj = serialize_clean_camel_case(api_provider_enrolment_details) + response_obj["supportedFeaturesFlags"] = negotiated_flags + res = make_response(object=response_obj, status=201) res.headers['Location'] = f"https://{os.getenv("CAPIF_HOSTNAME")}/api-provider-management/v1/registrations/{str(api_provider_enrolment_details.api_prov_dom_id)}" return res diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml index 60fd3db1..d25d77f3 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml @@ -544,6 +544,7 @@ components: type: string required: - regSec + - suppFeat title: APIProviderEnrolmentDetails type: object APIProviderFunctionDetails: -- GitLab From eee424daf7f629875d6cbb18daca3c3d232d3947 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Tue, 1 Apr 2025 09:24:00 +0200 Subject: [PATCH 078/157] revert swagger --- .../api_provider_management/openapi/openapi.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml index d25d77f3..60fd3db1 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml @@ -544,7 +544,6 @@ components: type: string required: - regSec - - suppFeat title: APIProviderEnrolmentDetails type: object APIProviderFunctionDetails: -- GitLab From aade85c8940b5ca7bfeec286b5b8bf21aeaa653f Mon Sep 17 00:00:00 2001 From: guillecxb Date: Tue, 1 Apr 2025 10:33:29 +0200 Subject: [PATCH 079/157] field validation --- .../core/provider_enrolment_details_api.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py index 291e9e68..1b88a73c 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py @@ -66,6 +66,13 @@ class ProviderManagementOperations(Resource): api_provider_enrolment_details.api_prov_dom_id = secrets.token_hex( 15) + if api_provider_enrolment_details.supp_feat is None: + return bad_request_error( + detail="supportedFeatures not present in request", + cause="supportedFeatures not present", + invalid_params=[{"param": "supp_feat", "reason": "not defined"}] + ) + # Supported Features Negotiation client_feat = api_provider_enrolment_details.supp_feat negotiated_hex = negotiate_supported_features_hex(client_feat) -- GitLab From 52815feec68f8b725e530086965e3ca666718774 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Tue, 1 Apr 2025 12:46:05 +0300 Subject: [PATCH 080/157] Add feature negotiation on Events API, change supported feature attribute in API response to match the negotiated one --- .../capif_events/core/events_apis.py | 66 ++++++++++++++----- .../capif_events/core/notifications.py | 20 +++++- .../capif_events/models/event_subscription.py | 12 ---- 3 files changed, 65 insertions(+), 33 deletions(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index d6b0bdf2..a247226b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -11,6 +11,21 @@ from .responses import internal_server_error, not_found_error, make_response, ba from ..util import serialize_clean_camel_case, clean_empty, dict_to_camel_case +TOTAL_FEATURES = 4 +SUPPORTED_FEATURES_HEX = "c" + +def return_negotiated_supp_feat_dict(supp_feat): + + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] + + return { + "NotificationTestEvent": True if final_supp_feat[0] == "1" else False, + "NotificationWebsocket": True if final_supp_feat[1] == "1" else False, + "EnhancedEventReport": True if final_supp_feat[2] == "1" else False, + "ApiStatusMonitoring": True if final_supp_feat[3] == "1" else False, + "Final": hex(int(final_supp_feat[::-1], 2))[2:] + } + class EventSubscriptionsOperations(Resource): def __check_subscriber_id(self, subscriber_id): @@ -32,7 +47,7 @@ class EventSubscriptionsOperations(Resource): return not_found_error(detail="Invoker or APF or AEF or AMF Not found", cause="Subscriber Not Found") return None - + def __check_event_filters(self, events, filters): current_app.logger.debug("Checking event filters.") valid_filters = { @@ -86,10 +101,11 @@ class EventSubscriptionsOperations(Resource): if isinstance(result, Response): return result - + + negotiated_supported_features = return_negotiated_supp_feat_dict(event_subscription.supported_features) + # Check if EnhancedEventReport is enabled and validate event filters - - if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"]: + if negotiated_supported_features["EnhancedEventReport"]: if event_subscription.event_filters: current_app.logger.debug(event_subscription.event_filters) result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) @@ -109,6 +125,10 @@ class EventSubscriptionsOperations(Resource): evnt = dict() evnt["subscriber_id"] = subscriber_id evnt["subscription_id"] = subscription_id + + # Edit supported_features field to the negotiated one + event_subscription.supported_features = negotiated_supported_features["Final"] + evnt.update(event_subscription.to_dict()) mycol.insert_one(evnt) @@ -159,13 +179,13 @@ class EventSubscriptionsOperations(Resource): exception= "An exception occurred in delete event" current_app.logger.error(exception + "::" + str(e)) return internal_server_error(detail=exception, cause=str(e)) - + def put_event(self, event_subscription, subscriber_id, subscription_id): try: mycol = self.db.get_col_by_name(self.db.event_collection) current_app.logger.debug("Updating event subscription") - + if event_subscription.supported_features is None: return bad_request_error( detail="supportedFeatures not present in request", @@ -177,19 +197,25 @@ class EventSubscriptionsOperations(Resource): if isinstance(result, Response): return result - - if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"] and event_subscription.event_filters: - result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) - if isinstance(result, Response): - return result my_query = {'subscriber_id': subscriber_id, - 'subscription_id': subscription_id} + 'subscription_id': subscription_id} eventdescription = mycol.find_one(my_query) if eventdescription is None: current_app.logger.error("Event subscription not found") - return not_found_error(detail="Event subscription not exist", cause="Event API subscription id not found") + return not_found_error(detail="Event subscription not exist", + cause="Event API subscription id not found") + + negotiated_supported_features = return_negotiated_supp_feat_dict(event_subscription.supported_features) + + if negotiated_supported_features["EnhancedEventReport"] and event_subscription.event_filters: + result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) + if isinstance(result, Response): + return result + + event_subscription.supported_features = negotiated_supported_features["Final"] + body = event_subscription.to_dict() body["subscriber_id"] = subscriber_id @@ -202,11 +228,11 @@ class EventSubscriptionsOperations(Resource): res = make_response(object=serialize_clean_camel_case(event_subscription), status=200) return res - + except Exception as e: exception= "An exception occurred in updating event" current_app.logger.error(exception + "::" + str(e)) - return internal_server_error(detail=exception, cause=str(e)) + return internal_server_error(detail=exception, cause=str(e)) def patch_event(self, event_subscription, subscriber_id, subscription_id): @@ -228,7 +254,9 @@ class EventSubscriptionsOperations(Resource): current_app.logger.error("Event subscription not found") return not_found_error(detail="Event subscription not exist", cause="Event API subscription id not found") - if EventSubscription.return_supp_feat_dict(eventdescription.get("supported_features"))["EnhancedEventReport"]: + negotiated_supported_features = return_negotiated_supp_feat_dict(eventdescription.get("supported_features")) + + if negotiated_supported_features["EnhancedEventReport"]: if event_subscription.events and event_subscription.event_filters: result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) elif event_subscription.events and event_subscription.event_filters is None and eventdescription.get("event_filters", None): @@ -239,6 +267,8 @@ class EventSubscriptionsOperations(Resource): if isinstance(result, Response): return result + event_subscription.supported_features = negotiated_supported_features["Final"] + body = clean_empty(event_subscription.to_dict()) document = mycol.update_one(my_query, {"$set":body}) document = mycol.find_one(my_query) @@ -247,8 +277,8 @@ class EventSubscriptionsOperations(Resource): res = make_response(object=EventSubscription.from_dict(dict_to_camel_case(document)), status=200) return res - + except Exception as e: exception= "An exception occurred in patching event" current_app.logger.error(exception + "::" + str(e)) - return internal_server_error(detail=exception, cause=str(e)) + return internal_server_error(detail=exception, cause=str(e)) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index ab769e51..451054b3 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -13,6 +13,20 @@ from util import serialize_clean_camel_case from .internal_event_ops import InternalEventOperations +TOTAL_FEATURES = 4 +SUPPORTED_FEATURES_HEX = "c" + +def return_negotiated_supp_feat_dict(supp_feat): + + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] + + return { + "NotificationTestEvent": True if final_supp_feat[0] == "1" else False, + "NotificationWebsocket": True if final_supp_feat[1] == "1" else False, + "EnhancedEventReport": True if final_supp_feat[2] == "1" else False, + "ApiStatusMonitoring": True if final_supp_feat[3] == "1" else False, + "Final": hex(int(final_supp_feat[::-1], 2))[2:] + } class Notifications(): @@ -36,7 +50,7 @@ class Notifications(): data = EventNotification(sub["subscription_id"], events=event) event_detail_redis=redis_event.get('event_detail', None) if event_detail_redis is not None: - if EventSubscription.return_supp_feat_dict(sub["supported_features"])["EnhancedEventReport"]: + if return_negotiated_supp_feat_dict(sub["supported_features"])["EnhancedEventReport"]: event_detail={} current_app.logger.debug(f"event: {event_detail_redis}") @@ -54,13 +68,13 @@ class Notifications(): api_ids_list = event_filter.get("api_ids", None) if api_ids_list and event_detail_redis.get('apiIds', None)[0] in api_ids_list: event_detail["apiIds"]=event_detail_redis.get('apiIds', None) - if EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]: + if return_negotiated_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]: event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) else: continue else: event_detail["apiIds"]=event_detail_redis.get('apiIds', None) - if EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]: + if return_negotiated_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]: event_detail["serviceAPIDescriptions"]=event_detail_redis.get('serviceAPIDescriptions', None) elif event in ["SERVICE_API_UPDATE"]: if event_filter: diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py index fef52865..af05c096 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py @@ -62,18 +62,6 @@ class EventSubscription(Model): self._websock_notif_config = websock_notif_config self._supported_features = supported_features - @classmethod - def return_supp_feat_dict(cls, supp_feat): - TOTAL_FEATURES=4 - supp_feat_in_hex = int(supp_feat, 16) - supp_feat_in_bin = bin(supp_feat_in_hex)[2:].zfill(TOTAL_FEATURES)[::-1] - - return { - "NotificationTestEvent": True if supp_feat_in_bin[0] == "1" else False, - "NotificationWebsocket": True if supp_feat_in_bin[1] == "1" else False, - "EnhancedEventReport": True if supp_feat_in_bin[2] == "1" else False, - "ApiStatusMonitoring": True if supp_feat_in_bin[3] == "1" else False - } @classmethod def from_dict(cls, dikt) -> 'EventSubscription': -- GitLab From 916a94a73378c01b62c0c152aa34f101d6d88ed1 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Tue, 1 Apr 2025 12:15:19 +0200 Subject: [PATCH 081/157] added event requirement to events service --- .../capif_events/celery_app/Dockerfile | 14 + .../capif_events/celery_app/__init__.py | 0 .../capif_events/celery_app/config.py | 20 + .../capif_events/celery_app/config.yaml | 8 + .../capif_events/celery_app/requirements.txt | 7 + .../capif_events/celery_app/start_celery.sh | 12 + .../capif_events/celery_app/tasks.py | 124 +++++ .../capif_events/core/events_apis.py | 77 ++- .../capif_events/core/internal_event_ops.py | 31 ++ .../capif_events/core/notifications.py | 27 +- .../capif_events/db/db.py | 3 + services/TS29222_CAPIF_Events_API/config.yaml | 1 + services/docker-compose-capif.yml | 19 + tests/features/Event Filter/event_req.robot | 443 ++++++++++++++++++ tests/libraries/api_events/bodyRequests.py | 16 + 15 files changed, 797 insertions(+), 5 deletions(-) create mode 100644 services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile create mode 100644 services/TS29222_CAPIF_Events_API/capif_events/celery_app/__init__.py create mode 100644 services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.py create mode 100644 services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.yaml create mode 100644 services/TS29222_CAPIF_Events_API/capif_events/celery_app/requirements.txt create mode 100644 services/TS29222_CAPIF_Events_API/capif_events/celery_app/start_celery.sh create mode 100644 services/TS29222_CAPIF_Events_API/capif_events/celery_app/tasks.py create mode 100644 tests/features/Event Filter/event_req.robot diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile new file mode 100644 index 00000000..1b96a1c3 --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile @@ -0,0 +1,14 @@ +# celery_app/Dockerfile + +FROM python:3.9 + +WORKDIR /celery_app + +COPY requirements.txt /celery_app/ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . /celery_app + +RUN chmod +x /celery_app/start_celery.sh + +CMD ["/celery_app/start_celery.sh"] diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/__init__.py b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.py b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.py new file mode 100644 index 00000000..60d542a2 --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.py @@ -0,0 +1,20 @@ +import os + +import yaml + + +#Config class to get config +class Config: + def __init__(self): + self.cached = 0 + self.file="./config.yaml" + self.my_config = {} + stamp = os.stat(self.file).st_mtime + if stamp != self.cached: + self.cached = stamp + f = open(self.file) + self.my_config = yaml.safe_load(f) + f.close() + + def get_config(self): + return self.my_config diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.yaml b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.yaml new file mode 100644 index 00000000..c1aa656a --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.yaml @@ -0,0 +1,8 @@ +mongo: { + 'user': 'root', + 'password': 'example', + 'db': 'capif', + 'notifications_col': 'notifications', + 'host': 'mongo', + 'port': "27017" +} diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/requirements.txt b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/requirements.txt new file mode 100644 index 00000000..64b64cfd --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/requirements.txt @@ -0,0 +1,7 @@ +celery==5.4 +pymongo==4.2.0 +redis==4.5.4 +aiohttp == 3.10.5 +async-timeout == 4.0.3 +pyyaml == 6.0.2 +python_dateutil >= 2.6.0 diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/start_celery.sh b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/start_celery.sh new file mode 100644 index 00000000..979e325b --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/start_celery.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +if [ "$CELERY_MODE" = "worker" ]; then + echo "Starting Celery Worker..." + celery -A tasks worker --loglevel=info +elif [ "$CELERY_MODE" = "beat" ]; then + echo "Iniciando Celery Beat..." + celery -A tasks beat --loglevel=info +else + echo "ERROR: The environment variable CELERY_MODE is not set correctly (worker|beat)" + exit 1 +fi \ No newline at end of file diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/tasks.py b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/tasks.py new file mode 100644 index 00000000..3016f12c --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/tasks.py @@ -0,0 +1,124 @@ +# celery/tasks.py +from celery import Celery +from datetime import datetime, timedelta, timezone +import pymongo +import os +from bson.codec_options import CodecOptions +from config import Config +import aiohttp +import asyncio +from dateutil import parser + +# Celery Configuration +celery = Celery( + "notifications", + broker=os.environ.get("CELERY_BROKER_URL", "redis://redis:6379/0"), + backend=os.environ.get("CELERY_RESULT_BACKEND", "redis://redis:6379/0") +) + +celery.conf.beat_schedule = { + "check_notifications_collection": { + "task": "celery.tasks.check_notifications_collection", + "schedule": 1.0, + "args": (), + }, +} +celery.conf.timezone = "UTC" + +# MongoDB Connection +config = Config().get_config() + +mongo_uri = f"mongodb://{config['mongo']['user']}:{config['mongo']['password']}@" \ + f"{config['mongo']['host']}:{config['mongo']['port']}" +client = pymongo.MongoClient(mongo_uri) +notifications_col = client[config['mongo']['db']][config['mongo']['notifications_col']].with_options(codec_options=CodecOptions(tz_aware=True)) + +def serialize_clean_camel_case(obj): + res = obj.to_dict() + res = clean_empty(res) + res = dict_to_camel_case(res) + + return res + +def clean_empty(d): + if isinstance(d, dict): + return { + k: v + for k, v in ((k, clean_empty(v)) for k, v in d.items()) + if v is not None or (isinstance(v, list) and len(v) == 0) + } + if isinstance(d, list): + return [v for v in map(clean_empty, d) if v is not None] + return d + +def dict_to_camel_case(my_dict): + + + result = {} + + for attr, value in my_dict.items(): + + if len(attr.split('_')) != 1: + my_key = ''.join(word.title() for word in attr.split('_')) + my_key = ''.join([my_key[0].lower(), my_key[1:]]) + else: + my_key = attr + + if my_key == "serviceApiCategory": + my_key = "serviceAPICategory" + elif my_key == "serviceApiDescriptions": + my_key = "serviceAPIDescriptions" + + if isinstance(value, list): + result[my_key] = list(map( + lambda x: dict_to_camel_case(x) if isinstance(x, dict) else x, value )) + + elif hasattr(value, "to_dict"): + result[my_key] = dict_to_camel_case(value) + + elif isinstance(value, dict): + value = dict_to_camel_case(value) + result[my_key] = value + else: + result[my_key] = value + + return result + +async def send_request(url, data): + async with aiohttp.ClientSession() as session: + timeout = aiohttp.ClientTimeout(total=10) + headers = {'content-type': 'application/json'} + async with session.post(url, json=data, timeout=timeout, headers=headers) as response: + return await response.text() + +async def send(url, data): + try: + response = await send_request(url, data) + print(response) + except asyncio.TimeoutError: + print("Timeout: Request timeout") + except Exception as e: + print("An exception occurred sending notification::" + str(e)) + return False + +@celery.task(name="celery.tasks.check_notifications_collection") +def my_periodic_task(): + print("Checking notifications collection...") + while True: + try: + notification_data = notifications_col.find_one_and_delete( + {"next_report_time": {"$lt": datetime.now(timezone.utc)}} + ) + if not notification_data: + break + except pymongo.errors.AutoReconnect: + print("MongoDB connection failed. Retrying...") + continue + + try: + print(f"sending notification to {notification_data['url']}") + asyncio.run(send(notification_data["url"], notification_data["notification"])) + except Exception as e: + print(f"Error sending notification: {e}") + + print("Finished processing notifications.") diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index d6b0bdf2..fea10021 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -4,6 +4,7 @@ import secrets import rfc3987 from capif_events.models.event_subscription import EventSubscription # noqa: E501 from flask import current_app, Response +from datetime import datetime, timedelta, timezone from .auth_manager import AuthManager from .resources import Resource @@ -56,6 +57,28 @@ class EventSubscriptionsOperations(Resource): current_app.logger.debug(f"The eventFilter {invalid_filters} for event {event} are not applicable.") return bad_request_error(detail="Bad Param", cause = f"Invalid eventFilter for event {event}", invalid_params=[{"param": "eventFilter", "reason": f"The eventFilter {invalid_filters} for event {event} are not applicable."}]) return None + + def __check_event_req(self, event_subscription): + current_app.logger.debug("Checking event requirement.") + if event_subscription.event_req.mon_dur: + if event_subscription.event_req.mon_dur > datetime.now(timezone.utc): + expired_at = event_subscription.event_req.mon_dur + else: + current_app.logger.error("monDur is in the past") + return bad_request_error( + detail="Bad Param", + cause="monDur is in the past", + invalid_params=[{"param": "monDur", "reason": "monDur is in the past"}] + ) + + if event_subscription.event_req.notif_method == "PERIODIC" and event_subscription.event_req.rep_period is None: + current_app.logger.error("Periodic notification method selected but repPeriod not provided") + return bad_request_error( + detail="Bad Param", + cause="Periodic notification method selected but repPeriod not provided", + invalid_params=[{"param": "repPeriod", "reason": "Periodic notification method selected but repPeriod not provided"}] + ) + return expired_at def __init__(self): Resource.__init__(self) @@ -89,12 +112,19 @@ class EventSubscriptionsOperations(Resource): # Check if EnhancedEventReport is enabled and validate event filters + expired_at = None + if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"]: if event_subscription.event_filters: current_app.logger.debug(event_subscription.event_filters) result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) if isinstance(result, Response): return result + if event_subscription.event_req: + current_app.logger.debug(event_subscription.event_req) + expired_at = self.__check_event_req(event_subscription) + if isinstance(expired_at, Response): + return result else: if event_subscription.event_filters: current_app.logger.error("Event filters provided but EnhancedEventReport is not enabled") @@ -103,12 +133,25 @@ class EventSubscriptionsOperations(Resource): cause="Event filters provided but EnhancedEventReport is not enabled", invalid_params=[{"param": "eventFilters", "reason": "EnhancedEventReport is not enabled"}] ) + if event_subscription.event_req: + current_app.logger.error("Event requirement provided but EnhancedEventReport is not enabled") + return bad_request_error( + detail="Bad Param", + cause="Event requirement provided but EnhancedEventReport is not enabled", + invalid_params=[{"param": "eventReq", "reason": "EnhancedEventReport is not enabled"}] + ) # Generate subscriptionID subscription_id = secrets.token_hex(15) evnt = dict() evnt["subscriber_id"] = subscriber_id evnt["subscription_id"] = subscription_id + + evnt["report_nbr"] = 0 + evnt["created_at"] = datetime.now(timezone.utc) + evnt["expire_at"] = expired_at + + evnt.update(event_subscription.to_dict()) mycol.insert_one(evnt) @@ -130,6 +173,7 @@ class EventSubscriptionsOperations(Resource): try: mycol = self.db.get_col_by_name(self.db.event_collection) + notifications_col = self.db.get_col_by_name(self.db.notifications_col) current_app.logger.debug("Removing event subscription") @@ -148,6 +192,7 @@ class EventSubscriptionsOperations(Resource): return not_found_error(detail="Event subscription not exist", cause="Event API subscription id not found") mycol.delete_one(my_query) + notifications_col.delete_many({"subscription_id": subscription_id}) current_app.logger.debug("Event subscription removed from database") self.auth_manager.remove_auth_event(subscription_id, subscriber_id) @@ -178,10 +223,17 @@ class EventSubscriptionsOperations(Resource): if isinstance(result, Response): return result - if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"] and event_subscription.event_filters: - result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) - if isinstance(result, Response): - return result + if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"]: + if event_subscription.event_filters: + current_app.logger.debug(event_subscription.event_filters) + result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) + if isinstance(result, Response): + return result + if event_subscription.event_req: + current_app.logger.debug(event_subscription.event_req) + expired_at = self.__check_event_req(event_subscription) + if isinstance(expired_at, Response): + return result my_query = {'subscriber_id': subscriber_id, 'subscription_id': subscription_id} @@ -195,6 +247,10 @@ class EventSubscriptionsOperations(Resource): body["subscriber_id"] = subscriber_id body["subscription_id"] = subscription_id + body["report_nbr"] = eventdescription.get("report_nbr", 0) + body["created_at"] = eventdescription.get("created_at", datetime.now(timezone.utc)) + body["expire_at"] = expired_at if expired_at else eventdescription.get("expire_at", None) + mycol.replace_one(my_query, body) current_app.logger.debug("Event subscription updated from database") @@ -238,8 +294,21 @@ class EventSubscriptionsOperations(Resource): if isinstance(result, Response): return result + + if event_subscription.event_req: + current_app.logger.debug(event_subscription.event_req) + expired_at = self.__check_event_req(event_subscription) + if isinstance(expired_at, Response): + return result + else: + expired_at = expired_at if expired_at else eventdescription.get("expire_at", None) + + if isinstance(result, Response): + return result body = clean_empty(event_subscription.to_dict()) + if expired_at: + body["expire_at"] = expired_at document = mycol.update_one(my_query, {"$set":body}) document = mycol.find_one(my_query) current_app.logger.debug("Event subscription patched from database") diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/internal_event_ops.py b/services/TS29222_CAPIF_Events_API/capif_events/core/internal_event_ops.py index f9daf008..73ea353f 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/internal_event_ops.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/internal_event_ops.py @@ -21,6 +21,14 @@ class InternalEventOperations(Resource): #We dont need remove all auth events, becase when invoker is removed, remove auth entry #self.auth_manager.remove_auth_all_event(subscriber_id) + + def delete_subscription(self, subscription_id): + + mycol = self.db.get_col_by_name(self.db.event_collection) + my_query = {'subscription_id': subscription_id} + mycol.delete_one(my_query) + + current_app.logger.info(f"Removed subscription: {subscription_id}") def get_event_subscriptions(self, event): current_app.logger.info("get subscription from db") @@ -42,3 +50,26 @@ class InternalEventOperations(Resource): except Exception as e: current_app.logger.error("An exception occurred ::" + str(e)) return False + + def add_notification(self, notification): + current_app.logger.info("Adding Notification to notifications list") + try: + mycol = self.db.get_col_by_name(self.db.notifications_col) + mycol.insert_one(notification) + current_app.logger.info("Notification added to notifications list") + except Exception as e: + current_app.logger.error("An exception occurred ::" + str(e)) + return False + + def update_report_nbr(self, subscription_id): + current_app.logger.info("Incrementing report number") + try: + mycol = self.db.get_col_by_name(self.db.event_collection) + my_query = {'subscription_id': subscription_id} + result = mycol.update_one(my_query, {'$inc': {'report_nbr': 1}}) + current_app.logger.info(result) + current_app.logger.info("Report number incremented") + except Exception as e: + current_app.logger.error("An exception occurred ::" + str(e)) + return False + diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index ab769e51..584e31fe 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -10,6 +10,7 @@ from flask import current_app from models.event_notification import EventNotification from models.event_subscription import EventSubscription from util import serialize_clean_camel_case +from datetime import datetime, timedelta, timezone from .internal_event_ops import InternalEventOperations @@ -135,7 +136,31 @@ class Notifications(): current_app.logger.debug(json.dumps(data.to_dict(),cls=CustomJSONEncoder)) - asyncio.run(self.send(url, serialize_clean_camel_case(data))) + if EventSubscription.return_supp_feat_dict(sub["supported_features"])["EnhancedEventReport"] and sub.get("event_req", None): + current_app.logger.debug(f"Creating notification for {sub['subscription_id']}") + + if sub["event_req"]["notif_method"] == "PERIODIC": + transcurred_time = (datetime.now(timezone.utc)-sub["created_at"]).total_seconds() + if transcurred_time > sub["event_req"]["rep_period"]: + transcurred_blocks = int(transcurred_time // sub["event_req"]["rep_period"]) + next_report_time = sub["created_at"] + timedelta(seconds=((transcurred_blocks+1) * sub["event_req"]["rep_period"])) + else: + next_report_time = sub["created_at"] + timedelta(seconds=sub["event_req"]["rep_period"]) + + notification = {"notification": data.to_dict(), "next_report_time" : next_report_time, "url": url, "subscription_id": sub["subscription_id"]} + + self.events_ops.add_notification(notification) + + if sub["event_req"].get("max_report_nbr", None) and sub["report_nbr"] + 1 == sub["event_req"].get("max_report_nbr", None): + current_app.logger.debug(f"Limit reached, deleting subscription {sub['subscription_id']}") + self.events_ops.delete_subscription(sub["subscription_id"]) + + else: + asyncio.run(self.send(url, serialize_clean_camel_case(data))) + + self.events_ops.update_report_nbr(sub["subscription_id"]) + + except Exception as e: current_app.logger.error("An exception occurred ::" + str(e)) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/db/db.py b/services/TS29222_CAPIF_Events_API/capif_events/db/db.py index adfc472a..3af5d6cf 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/db/db.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/db/db.py @@ -21,6 +21,9 @@ class MongoDatabse(): self.invoker_collection = self.config['mongo']['capif_invokers_col'] self.provider_collection = self.config['mongo']['capif_providers_col'] self.certs_col = self.config['mongo']['certs_col'] + self.notifications_col = self.config['mongo']['notifications_col'] + + self.get_col_by_name(self.event_collection).create_index([("expire_at", 1)],expireAfterSeconds=0) # self.acls_col = self.config['mongo']['capif_acls_col'] def get_col_by_name(self, name): diff --git a/services/TS29222_CAPIF_Events_API/config.yaml b/services/TS29222_CAPIF_Events_API/config.yaml index 101d300e..a64584dd 100644 --- a/services/TS29222_CAPIF_Events_API/config.yaml +++ b/services/TS29222_CAPIF_Events_API/config.yaml @@ -7,6 +7,7 @@ mongo: { 'capif_invokers_col': 'invokerdetails', 'capif_providers_col': 'providerenrolmentdetails', 'capif_acls_col': 'acls', + 'notifications_col': 'notifications', 'host': 'mongo', 'port': "27017" } diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index 6b5a504c..e965cedb 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -175,6 +175,25 @@ services: - redis - mongo + celery_worker: + build: + context: ${SERVICES_DIR}/TS29222_CAPIF_Events_API/capif_events/celery_app + environment: + - CELERY_MODE=worker + - REDIS_HOST=redis + - REDIS_PORT=6379 + depends_on: + - redis + + celery_beat: + build: + context: ${SERVICES_DIR}/TS29222_CAPIF_Events_API/capif_events/celery_app + environment: + - CELERY_MODE=beat + - REDIS_HOST=redis + - REDIS_PORT=6379 + depends_on: + - redis api-invocation-logs: build: context: ${SERVICES_DIR}/TS29222_CAPIF_Logging_API_Invocation_API diff --git a/tests/features/Event Filter/event_req.robot b/tests/features/Event Filter/event_req.robot new file mode 100644 index 00000000..4530c0d2 --- /dev/null +++ b/tests/features/Event Filter/event_req.robot @@ -0,0 +1,443 @@ +*** Settings *** +Resource /opt/robot-tests/tests/resources/common.resource +Library /opt/robot-tests/tests/libraries/bodyRequests.py +Library XML +Library String +Resource /opt/robot-tests/tests/resources/common/basicRequests.robot +Resource ../../resources/common.resource +Resource ../../resources/common/basicRequests.robot + +Suite Teardown Reset Testing Environment +Test Setup Reset Testing Environment +Test Teardown Reset Testing Environment + + +*** Variables *** +${API_INVOKER_NOT_REGISTERED} not-valid +${SUBSCRIBER_ID_NOT_VALID} not-valid +${SUBSCRIPTION_ID_NOT_VALID} not-valid + + +*** Test Cases *** +Invoker subscribe to Service API Available + [Tags] pelayo-1 mockserver + + # Initialize Mock server + Init Mock Server + + # Default Invoker Registration and Onboarding + ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding + + # Create Provider1 with 2 AEF roles and publish API + ${register_user_info_provider_1}= Provider Default Registration + ${aef_id_1}= Set Variable ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}']['aef_id']} + ${aef_empty_list}= Create List + + # Subscribe to events and setup event filter with api_id + ${events_list}= Create List API_INVOKER_ONBOARDED + ${event_req}= Create Event Req notif_method=PERIODIC max_report_nbr=${2} rep_period=${1} + + ${subscription_ids}= Create List + + FOR ${counter} IN RANGE 1 10000 1 + Log ${counter} + ${subscription_id}= + ... Subscribe invoker ${register_user_info_invoker} to events ${events_list} with event req ${event_req} + Append To List ${subscription_ids} ${subscription_id} + END + + Sleep 300s + + ${resp}= Get Mock Server Messages + + ${notification_events_on_mock_server}= Set Variable ${resp.json()} + +Invoker subscribe to Service API Availables + [Tags] event_filter-7 mockserver smoke + + # Initialize Mock server + Init Mock Server + + # Register Providers + ## Default Provider 1 Registration + ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 + ${aef_id_1}= Set Variable + ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} + + ## Publish service_1 API + ${service_api_description_published_1} + ... ${provider_resource_url_1} + ... ${provider_request_body_1}= + ... Publish Service Api + ... ${register_user_info_provider_1} + ... service_name=service_1 + + ## Default Provider 2 Registration + ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_2 + ${aef_id_2}= Set Variable + ... ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_2']['aef_id']} + + ## Publish service_2 API + ${service_api_description_published_2} + ... ${provider_resource_url_2} + ... ${provider_request_body_2}= + ... Publish Service Api + ... ${register_user_info_provider_2} + ... service_name=service_2 + + ## Store apiId1 and apiId2 for further use + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + ${service_api_id_2}= Set Variable ${service_api_description_published_2['apiId']} + + # Register Invokers + ## Default Invoker 1 Registration and Onboarding + ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding + ... invoker_username=${INVOKER_USERNAME}_1 + + ## Default Invoker 2 Registration and Onboarding + ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding + ... invoke_username=${INVOKER_USERNAME}_2 + + ## Store apiInvokerIds for further use + ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} + ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} + + # Subscribe to events + ## Event lists + ${events_list}= Create List SERVICE_API_INVOCATION_SUCCESS SERVICE_API_INVOCATION_FAILURE + + ## Event filters + ${event_filter_empty}= Create Capif Event Filter + ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} + ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} + ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_id_2} + ${event_filter_api_ids_and_aef_ids}= Create Capif Event Filter + ... apiIds=${service_api_id_2} + ... aefIds=${aef_id_2} + ${event_filter_api_ids_and_api_invoker_ids}= Create Capif Event Filter + ... apiInvokerIds=${api_invoker_id_2} + ... apiIds=${service_api_id_2} + ${event_filter_aef_ids_and_api_invoker_ids}= Create Capif Event Filter + ... apiInvokerIds=${api_invoker_id_2} + ... aefIds=${aef_id_1} + ${event_filter_api_ids_aef_ids_and_api_invoker_ids}= Create Capif Event Filter + ... apiInvokerIds=${api_invoker_id_2} + ... aefIds=${aef_id_2} + ... apiIds=${service_api_id_2} + + ## Subscription to Events 1 + ${event_filters}= Create List ${event_filter_api_ids} ${event_filter_api_ids} + ${subscription_id_1}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 2 + ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_aef_ids} + ${subscription_id_2}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 3 + ${event_filters}= Create List ${event_filter_api_invoker_ids} ${event_filter_api_invoker_ids} + ${subscription_id_3}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 4 + ${event_filters}= Create List ${event_filter_api_ids_and_aef_ids} ${event_filter_api_ids_and_aef_ids} + ${subscription_id_4}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 5 + ${event_filters}= Create List + ... ${event_filter_api_ids_and_api_invoker_ids} + ... ${event_filter_api_ids_and_api_invoker_ids} + ${subscription_id_5}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 6 + ${event_filters}= Create List + ... ${event_filter_aef_ids_and_api_invoker_ids} + ... ${event_filter_aef_ids_and_api_invoker_ids} + ${subscription_id_6}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + ## Subscription to Events 7 + ${event_filters}= Create List + ... ${event_filter_api_ids_aef_ids_and_api_invoker_ids} + ... ${event_filter_api_ids_aef_ids_and_api_invoker_ids} + ${subscription_id_7}= + ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} + + # 1.Log entry for service_1 and invoker_1 + ${request_body_log_1}= Send Log Message to CAPIF + ... ${service_api_id_1} + ... service_1 + ... ${register_user_info_invoker_1} + ... ${register_user_info_provider_1} + ... 200 + ... 400 + + # 2.Log entry for service_2 and invoker_1 + ${request_body_log_2}= Send Log Message to CAPIF + ... ${service_api_id_2} + ... service_2 + ... ${register_user_info_invoker_1} + ... ${register_user_info_provider_2} + ... 200 + + # 3.Log entry for service_2 and invoker_2 + ${request_body_log_3}= Send Log Message to CAPIF + ... ${service_api_id_2} + ... service_2 + ... ${register_user_info_invoker_2} + ... ${register_user_info_provider_2} + ... 200 + + # 4.Log entry for service_1 and invoker_2 + ${request_body_log_4}= Send Log Message to CAPIF + ... ${service_api_id_1} + ... service_1 + ... ${register_user_info_invoker_2} + ... ${register_user_info_provider_1} + ... 400 + + # Check Event Notifications + ## Create check Events to ensure all notifications were received + ### Subscription 1 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_1} + ... ${request_body_log_1} + + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_1} + ... ${request_body_log_4} + ... events_expected=${events_expected} + + ### Subcription 2 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_2} + ... ${request_body_log_2} + ... events_expected=${events_expected} + + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_2} + ... ${request_body_log_3} + ... events_expected=${events_expected} + + # Subscription 3 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_3} + ... ${request_body_log_1} + ... events_expected=${events_expected} + + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_3} + ... ${request_body_log_2} + ... events_expected=${events_expected} + + # Subscription 4 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_4} + ... ${request_body_log_2} + ... events_expected=${events_expected} + + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_4} + ... ${request_body_log_3} + ... events_expected=${events_expected} + + # Subscription 5 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_5} + ... ${request_body_log_3} + ... events_expected=${events_expected} + + # Subscription 6 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_6} + ... ${request_body_log_4} + ... events_expected=${events_expected} + + # Subscription 7 Checks + ${events_expected}= Create Events From InvocationLogs + ... ${subscription_id_7} + ... ${request_body_log_3} + ... events_expected=${events_expected} + + Log List ${events_expected} + ## Check Events Expected towards received notifications at mock server + Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} + + +*** Keywords *** +Create Security Context between ${invoker_info} and ${provider_info} + # Discover APIs by invoker + ${discover_response}= Get Request Capif + ... ${DISCOVER_URL}${invoker_info['api_invoker_id']}&aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + Check Response Variable Type And Values ${discover_response} 200 DiscoveredAPIs + + # create Security Context + ${request_service_security_body} ${api_ids}= Create Service Security From Discover Response + ... http://${CAPIF_HOSTNAME}:${CAPIF_HTTP_PORT}/test + ... ${discover_response} + ... legacy=${FALSE} + ${resp}= Put Request Capif + ... /capif-security/v1/trustedInvokers/${invoker_info['api_invoker_id']} + ... json=${request_service_security_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + Set To Dictionary ${invoker_info} security_body=${request_service_security_body} + # Check Service Security + Check Response Variable Type And Values ${resp} 201 ServiceSecurity + ${resource_url}= Check Location Header ${resp} ${LOCATION_SECURITY_RESOURCE_REGEX} + + ${api_invoker_policies_list}= Create List + + FOR ${api_id} IN @{api_ids} + Log ${api_id} + ${resp}= Get Request Capif + ... /access-control-policy/v1/accessControlPolicyList/${api_id}?aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${provider_info['aef_username']} + Check Response Variable Type And Values ${resp} 200 AccessControlPolicyList + Should Not Be Empty ${resp.json()['apiInvokerPolicies']} + ${api_invoker_policies}= Set Variable ${resp.json()['apiInvokerPolicies']} + ${api_invoker_policies_list}= Set Variable ${api_invoker_policies} + END + + Log List ${api_invoker_policies_list} + + RETURN ${api_invoker_policies_list} + +Update Security Context between ${invoker_info} and ${provider_info} + # Discover APIs by invoker + ${discover_response}= Get Request Capif + ... ${DISCOVER_URL}${invoker_info['api_invoker_id']}&aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + Check Response Variable Type And Values ${discover_response} 200 DiscoveredAPIs + + # create Security Context + ${request_service_security_body} ${api_ids}= Update Service Security With Discover Response + ... ${invoker_info['security_body']} + ... ${discover_response} + ... legacy=${FALSE} + ${resp}= Post Request Capif + ... /capif-security/v1/trustedInvokers/${invoker_info['api_invoker_id']}/update + ... json=${request_service_security_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${invoker_info['management_cert']} + + # Check Service Security + Check Response Variable Type And Values ${resp} 200 ServiceSecurity + ${resource_url}= Check Location Header ${resp} ${LOCATION_SECURITY_RESOURCE_REGEX} + + ${api_invoker_policies_list}= Create List + + ${api_id}= Get From List ${api_ids} -1 + Log ${api_id} + ${resp}= Get Request Capif + ... /access-control-policy/v1/accessControlPolicyList/${api_id}?aef-id=${provider_info['aef_id']} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${provider_info['aef_username']} + + Check Response Variable Type And Values ${resp} 200 AccessControlPolicyList + # Check returned values + Should Not Be Empty ${resp.json()['apiInvokerPolicies']} + + ${api_invoker_policies}= Set Variable ${resp.json()['apiInvokerPolicies']} + # Append To List ${api_invoker_policies_list} ${api_invoker_policies} + ${api_invoker_policies_list}= Set Variable ${api_invoker_policies} + + Log List ${api_invoker_policies_list} + + RETURN ${api_invoker_policies_list} + +Subscribe provider ${provider_info} to events ${events_list} with event filters ${event_filters} + ${resp}= + ... Subscribe ${provider_info['amf_id']} with ${provider_info['amf_username']} to ${events_list} with ${event_filters} + + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + + RETURN ${subscription_id} + +Subscribe invoker ${invoker_info} to events ${events_list} with event filters ${event_filters} + ${resp}= + ... Subscribe ${invoker_info['api_invoker_id']} with ${invoker_info['management_cert']} to ${events_list} with ${event_filters} + + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + + RETURN ${subscription_id} + +Subscribe invoker ${invoker_info} to events ${events_list} with event req ${event_req} + ${resp}= + ... Subscribe ${invoker_info['api_invoker_id']} with ${invoker_info['management_cert']} to ${events_list} with ${event_req} + + Check Response Variable Type And Values ${resp} 201 EventSubscription + ${subscriber_id} ${subscription_id}= Check Event Location Header ${resp} + + RETURN ${subscription_id} + +Subscribe ${subscriber_id} with ${username} to ${events_list} with ${event_req} + ${request_body}= Create Events Subscription + ... events=@{events_list} + ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing + ... supported_features=C + ... event_req=${event_req} + ${resp}= Post Request Capif + ... /capif-events/v1/${subscriber_id}/subscriptions + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${username} + + RETURN ${resp} + +Send Log Message to CAPIF + [Arguments] ${api_id} ${service_name} ${invoker_info} ${provider_info} @{results} + ${api_ids}= Create List ${api_id} + ${api_names}= Create List ${service_name} + ${request_body}= Create Log Entry + ... ${provider_info['aef_id']} + ... ${invoker_info['api_invoker_id']} + ... ${api_ids} + ... ${api_names} + ... results=@{results} + ${resp}= Post Request Capif + ... /api-invocation-logs/v1/${provider_info['aef_id']}/logs + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${provider_info['amf_username']} + + Check Response Variable Type And Values ${resp} 201 InvocationLog + ${resource_url}= Check Location Header ${resp} ${LOCATION_LOGGING_RESOURCE_REGEX} + + RETURN ${request_body} + +Check not valid ${resp} with event filter ${attribute_snake_case} for event ${event} + # Check Results + ${invalid_param}= Create Dictionary + ... param=eventFilter + ... reason=The eventFilter {'${attribute_snake_case}'} for event ${event} are not applicable. + ${invalid_param_list}= Create List ${invalid_param} + Check Response Variable Type And Values + ... ${resp} + ... 400 + ... ProblemDetails + ... title=Bad Request + ... status=400 + ... detail=Bad Param + ... cause=Invalid eventFilter for event ${event} + ... invalidParams=${invalid_param_list} diff --git a/tests/libraries/api_events/bodyRequests.py b/tests/libraries/api_events/bodyRequests.py index 1bb4604f..4e853a62 100644 --- a/tests/libraries/api_events/bodyRequests.py +++ b/tests/libraries/api_events/bodyRequests.py @@ -39,6 +39,21 @@ def create_capif_event_filter(aefIds=None, apiIds=None, apiInvokerIds=None): return capif_event_filter +def create_event_req(imm_rep=None, notif_method=None, max_report_nbr=None, mon_dur=None, rep_period=None): + data = dict() + if imm_rep is not None: + data['immRep'] = imm_rep + if notif_method is not None: + data['notifMethod'] = notif_method + if max_report_nbr is not None: + data['maxReportNbr'] = max_report_nbr + if mon_dur is not None: + data['monDur'] = mon_dur + if rep_period is not None: + data['repPeriod'] = rep_period + return data + + def create_default_event_req(): return { "grpRepTime": 5, @@ -51,6 +66,7 @@ def create_default_event_req(): } + def create_websock_notif_config_default(): return { "requestWebsocketUri": True, -- GitLab From f47caf83c58d9de7a03187d230c6d333ab32e630 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Tue, 1 Apr 2025 12:17:54 +0200 Subject: [PATCH 082/157] use etsi python image in celery --- .../capif_events/celery_app/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile index 1b96a1c3..7d334128 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile +++ b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile @@ -1,6 +1,4 @@ -# celery_app/Dockerfile - -FROM python:3.9 +FROM labs.etsi.org:5050/ocf/capif/python:3-slim-bullseye WORKDIR /celery_app -- GitLab From 1c9e176cca3f7841db071448b23f771146f2d948 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 1 Apr 2025 12:39:08 +0200 Subject: [PATCH 083/157] Implement CA root retrieve from vault, some changes on testing and adding some comments to code --- .../capif_security/core/servicesecurity.py | 82 +++++++++++++++++-- .../prepare_security.sh | 53 ++++++++++-- services/run.sh | 6 +- services/variables.sh | 1 + tests/libraries/security_api/bodyRequests.py | 47 +---------- 5 files changed, 128 insertions(+), 61 deletions(-) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py index c9b5cd16..b7c82b2c 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py @@ -105,12 +105,66 @@ class SecurityOperations(Resource): current_app.logger.error("Not found security context") return not_found_error(detail=security_context_not_found_detail, cause=api_invoker_no_context_cause) - if not authentication_info: - for security_info_obj in services_security_object['security_info']: - del security_info_obj['authentication_info'] - if not authorization_info: - for security_info_obj in services_security_object['security_info']: - del security_info_obj['authorization_info'] + for security_info_obj in services_security_object['security_info']: + if security_info_obj.get('sel_security_method') == "PKI": + current_app.logger.debug("PKI security method selected") + if authentication_info: + # Read the CA certificate from the file + with open("/usr/src/app/capif_security/ca.crt", "rb") as key_file: + key_data = key_file.read() + # Decode the certificate to a string + key_data = key_data.decode('utf-8') + # Add the CA certificate to the authentication_info + security_info_obj['authentication_info'] = key_data + else: + # If authentication_info is not needed, remove the key_data + del security_info_obj['authentication_info'] + + if authorization_info: + security_info_obj['authorization_info'] = security_info_obj.get('authorization_info', "") + else: + # If authorization_info is not needed, remove the key_data + del security_info_obj['authorization_info'] + + elif security_info_obj.get('sel_security_method') == "PSK": + current_app.logger.debug("PSK security method selected") + if authentication_info: + # Read the PSK from the file + with open("/usr/src/app/capif_security/ca.crt", "rb") as key_file: + key_data = key_file.read() + # Decode the PSK to a string + key_data = key_data.decode('utf-8') + # Add the PSK to the authentication_info + security_info_obj['authentication_info'] = key_data + else: + # If authentication_info is not needed, remove the key_data + del security_info_obj['authentication_info'] + + if authorization_info: + security_info_obj['authorization_info'] = security_info_obj.get('authorization_info', "UNDER DEVELOPMENT") + else: + # If authorization_info is not needed, remove the key_data + del security_info_obj['authorization_info'] + + elif security_info_obj.get('sel_security_method') == "OAUTH": + current_app.logger.debug("OAUTH security method selected, this request is not needed") + + if authentication_info: + security_info_obj['authentication_info'] = security_info_obj.get('authentication_info', "") + else: + # If authentication_info is not needed, remove the key_data + del security_info_obj['authentication_info'] + + if authorization_info: + security_info_obj['authorization_info'] = security_info_obj.get('authorization_info', "") + else: + # If authorization_info is not needed, remove the key_data + del security_info_obj['authorization_info'] + + else: + current_app.logger.error("Bad format security method") + return bad_request_error(detail="Bad format security method", cause="Bad format security method", invalid_params=[{"param": "securityMethod", "reason": "Bad format security method"}]) + properyly_json = json.dumps( services_security_object, default=json_util.default) @@ -176,6 +230,22 @@ class SecurityOperations(Resource): return not_found_error(detail=f"Service with interfaceDescription {json.dumps(clean_empty(service_instance.interface_details.to_dict()))} not found", cause="Not found Service") # We obtain the interface security methods + # We need to go deeper here, because the interface description is an array + # and we need to find the correct one according to preferred security method by invoker, + # maybe Published API contains more than one interface description, and each one is related + # with a different security method, then we need to get a complete list (interface and related security methods) + # amd then we need to check if the preferred security method is compatible with the interface description + # also the security methods inside interface description is not mandatory, in that case we use aefProfile.securityMethods + # an also that aefProfile.securityMethods is not mandatory, only in cases described on TS 29222 - 8.2.4.2.4 Type: AefProfile - + # + # NOTE4: + # For AEFs defined by 3GPP interacting with API invokers via CAPIF-2e, at least one of the "securityMethods" attribute + # within this data type or the "securityMethods" attribute within the "interfaceDescriptions" attribute shall be present. + # For AEFs defined by 3GPP interacting with API invokers via CAPIF-2, the "securityMethods" attribute is optional. + # For AEFs not defined by 3GPP, the "securityMethods" attribute is optional. + # + # To achieve this, we need to setup at config which domains or IPs are CAPIF-2e or CAPIF-2, and then we need to check if the domain or IP of the service is in the list. + security_methods = aef_profile["aef_profiles"][0]["interface_descriptions"][0]["security_methods"] current_app.logger.debug("Interface security methods: " + str(security_methods)) diff --git a/services/TS29222_CAPIF_Security_API/prepare_security.sh b/services/TS29222_CAPIF_Security_API/prepare_security.sh index 3bfb1558..c14609ad 100644 --- a/services/TS29222_CAPIF_Security_API/prepare_security.sh +++ b/services/TS29222_CAPIF_Security_API/prepare_security.sh @@ -3,6 +3,9 @@ VAULT_ADDR="http://$VAULT_HOSTNAME:$VAULT_PORT" VAULT_TOKEN=$VAULT_ACCESS_TOKEN +CERTS_FOLDER="/usr/src/app/capif_security" +# cd $CERTS_FOLDER + # Maximum number of retry attempts MAX_RETRIES=30 # Delay between retries (in seconds) @@ -10,6 +13,40 @@ RETRY_DELAY=10 # Attempt counter ATTEMPT=0 +while [ $ATTEMPT -lt $MAX_RETRIES ]; do + # Increment ATTEMPT using eval + eval "ATTEMPT=\$((ATTEMPT + 1))" + echo "Attempt $ATTEMPT of $MAX_RETRIES" + + # Make the request to Vault and store the response in a variable + RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ + --header "X-Vault-Token: $VAULT_TOKEN" \ + --request GET "$VAULT_ADDR/v1/secret/data/ca" | jq -r '.data.data.ca') + + echo "$RESPONSE" + + # Check if the response is "null" or empty + if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then + echo "$RESPONSE" > $CERTS_FOLDER/ca.crt + openssl verify -CAfile $CERTS_FOLDER/ca.crt $CERTS_FOLDER/ca.crt + echo "CA Root successfully saved." + SUCCES_OPERATION=true + break + else + echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." + sleep $RETRY_DELAY + fi +done + +if [ "$SUCCES_OPERATION" = false ]; then + echo "Error: Failed to retrieve ca root a valid response after $MAX_RETRIES attempts." + exit 1 # Exit with failure +fi + +# Setup inital value to ATTEMPT and SUCCESS_OPERATION +ATTEMPT=0 +SUCCES_OPERATION=false + while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Increment ATTEMPT using eval eval "ATTEMPT=\$((ATTEMPT + 1))" @@ -24,16 +61,20 @@ while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Check if the response is "null" or empty if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then - echo "$RESPONSE" > /usr/src/app/capif_security/server.key + echo "$RESPONSE" > $CERTS_FOLDER/server.key echo "Public key successfully saved." - gunicorn -k uvicorn.workers.UvicornH11Worker --bind 0.0.0.0:8080 \ - --chdir /usr/src/app/capif_security wsgi:app - exit 0 # Exit successfully + SUCCES_OPERATION=true + break else echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." sleep $RETRY_DELAY fi done -echo "Error: Failed to retrieve a valid response after $MAX_RETRIES attempts." -exit 1 # Exit with failure +if [ "$SUCCES_OPERATION" = false ]; then + echo "Error: Failed to retrieve server key valid response after $MAX_RETRIES attempts." + exit 1 # Exit with failure +fi + +gunicorn -k uvicorn.workers.UvicornH11Worker --bind 0.0.0.0:8080 \ + --chdir $CERTS_FOLDER wsgi:app diff --git a/services/run.sh b/services/run.sh index 7cb00c34..9f2983bb 100755 --- a/services/run.sh +++ b/services/run.sh @@ -4,7 +4,7 @@ source $(dirname "$(readlink -f "$0")")/variables.sh help() { echo "Usage: $1 " echo " -c : Setup different hostname for capif" - echo " -s : Run Mock server" + echo " -s : Run Mock server. Default true" echo " -m : Run monitoring service" echo " -l : Set Log Level (default DEBUG). Select one of: [CRITICAL, FATAL, ERROR, WARNING, WARN, INFO, DEBUG, NOTSET]" echo " -r : Remove cached information on build" @@ -35,7 +35,7 @@ then fi # Read params -while getopts ":c:l:mshrv:f:g:b:" opt; do +while getopts ":c:l:ms:hrv:f:g:b:" opt; do case $opt in c) CAPIF_HOSTNAME="$OPTARG" @@ -44,7 +44,7 @@ while getopts ":c:l:mshrv:f:g:b:" opt; do MONITORING_STATE=true ;; s) - ROBOT_MOCK_SERVER=true + ROBOT_MOCK_SERVER="$OPTARG" ;; v) OCF_VERSION="$OPTARG" diff --git a/services/variables.sh b/services/variables.sh index 1fa65aa2..dd99ae30 100755 --- a/services/variables.sh +++ b/services/variables.sh @@ -32,6 +32,7 @@ export LOG_LEVEL=DEBUG export CACHED_INFO="" export BUILD_DOCKER_IMAGES=true export REMOVE_IMAGES=false +export ROBOT_MOCK_SERVER=true # Needed to avoid write permissions on bind volumes with prometheus and grafana export DUID=$(id -u) diff --git a/tests/libraries/security_api/bodyRequests.py b/tests/libraries/security_api/bodyRequests.py index 409fcfcf..bf9cda31 100644 --- a/tests/libraries/security_api/bodyRequests.py +++ b/tests/libraries/security_api/bodyRequests.py @@ -7,7 +7,7 @@ def create_service_security_default_body( authentication_info=None, authorization_info=None, grant_type=None, - pref_security_methods=["PSK", "PKI", "OAUTH"], + pref_security_methods=["OAUTH", "PKI", "PSK"], sel_security_method=None, request_websocket_uri=None, websocket_uri=None): @@ -32,51 +32,6 @@ def create_service_security_default_body( return data -def create_service_security_body(notification_destination, - supported_features, - security_info=None, - aef_id=None, - api_id=None, - authentication_info=None, - authorization_info=None): - data = { - "notificationDestination": notification_destination, - "supportedFeatures": supported_features, - "securityInfo": [{ - "authenticationInfo": "authenticationInfo", - "authorizationInfo": "authorizationInfo", - "interfaceDetails": { - "ipv4Addr": "127.0.0.1", - "securityMethods": ["PSK"], - "port": 5248 - }, - "prefSecurityMethods": ["PSK", "PKI", "OAUTH"], - } - ], - "websockNotifConfig": { - "requestWebsocketUri": True, - "websocketUri": "websocketUri" - }, - "requestTestNotification": True - } - - if aef_id is not None and api_id is not None: - security_info = dict() - if authentication_info is not None: - security_info['authenticationInfo'] = authentication_info - if authorization_info is not None: - security_info['authorizationInfo'] = authorization_info - data['securityInfo'].append({ - "authenticationInfo": "authenticationInfo", - "authorizationInfo": "authorizationInfo", - "prefSecurityMethods": ["PSK", "PKI", "OAUTH"], - "aefId": aef_id, - "apiId": api_id - }) - - return data - - def create_security_info( aef_id=None, interface_details=None, -- GitLab From d9da718dbb74ec8293f11b7a0ed48fa403e6aa14 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 1 Apr 2025 17:43:25 +0200 Subject: [PATCH 084/157] Fixed issues after implement security improvements over authorizationInfo and AuthenticationInfo --- .../api_publish_service/bodyRequests.py | 109 +++++++++++++++--- 1 file changed, 93 insertions(+), 16 deletions(-) diff --git a/tests/libraries/api_publish_service/bodyRequests.py b/tests/libraries/api_publish_service/bodyRequests.py index f76fe9d2..efdd87c6 100644 --- a/tests/libraries/api_publish_service/bodyRequests.py +++ b/tests/libraries/api_publish_service/bodyRequests.py @@ -3,7 +3,10 @@ def create_service_api_description(api_name="service_1", supported_features="0", vendor_specific_service_api_description=None, vendor_specific_aef_profile=None, - api_status=None): + api_status=None, + security_method="default", + domain_name=None, + interface_descriptions=None): aef_ids = list() if isinstance(aef_id, list): aef_ids = aef_id @@ -12,7 +15,32 @@ def create_service_api_description(api_name="service_1", print("aef_id parameter is a string") aef_ids.append(aef_id) - profiles = create_aef_profiles(aef_ids) + security_methods = list() + if security_method is not None: + if isinstance(security_method, list): + print("security_method parameter is a list") + if len(security_method) > 0: + if isinstance(security_method[0], list): + security_methods = security_method + else: + security_methods.append(security_method) + elif isinstance(security_method, str): + print("security_methods parameter is a string") + if security_method == "default": + for idx in range(len(aef_ids)): + security_methods.append(["OAUTH"]) + security_methods.append([security_method]) + else: + print(f"security_method is {security_method}") + print(f"security_methods: {security_methods}") + else: + print("security_method parameter is None") + + profiles = create_aef_profiles( + aef_ids, + security_methods, + domain_name, + interface_descriptions) body = { "apiName": api_name, @@ -58,16 +86,32 @@ def create_service_api_description(api_name="service_1", return body -def create_aef_profiles(aef_ids): +def create_aef_profiles( + aef_ids, + security_methods, + domain_name=None, + interface_descriptions=None): profiles = list() index = 1 for aef_id in aef_ids: - profiles.append(create_aef_profile(aef_id, "resource_" + str(index))) + security_method = get_value(security_methods, index-1) + print(f"aef_id: {aef_id}, security_method: {security_method}") + profiles.append( + create_aef_profile( + aef_id, + "resource_" + str(index), + security_method, + domain_name, + interface_descriptions)) index = index+1 return profiles -def create_aef_profile(aef_id, resource_name): +def create_aef_profile(aef_id, + resource_name, + security_method=None, + domain_name=None, + interface_descriptions=None): data = { "aefId": aef_id, "versions": [ @@ -90,15 +134,23 @@ def create_aef_profile(aef_id, resource_name): ], "protocol": "HTTP_1_1", "dataFormat": "JSON", - "securityMethods": ["PSK"], - "interfaceDescriptions": [ - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - } - ] } + + if domain_name is not None: + data['domainName'] = domain_name + elif interface_descriptions is not None: + data['interfaceDescriptions'] = interface_descriptions + elif domain_name is None and interface_descriptions is None: + data['interfaceDescriptions'] = [ + { + "ipv4Addr": "string", + "port": 65535, + "securityMethods": security_method + } + ] + + if security_method is not None: + data['securityMethods'] = security_method return data @@ -109,7 +161,10 @@ def create_service_api_description_patch(aef_id=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, - ccf_id=None): + ccf_id=None, + security_method=None, + domain_name=None, + interface_descriptions=None): body = dict() # aef profiles @@ -122,10 +177,28 @@ def create_service_api_description_patch(aef_id=None, elif isinstance(aef_id, str): print("aef_id parameter is a string") aef_ids.append(aef_id) + + security_methods = list() + if security_method is not None: + if isinstance(security_method, list): + print("security_method parameter is a list") + if len(security_method) > 0: + if isinstance(security_method[0], list): + security_methods = security_method + else: + security_methods.append(security_method) + elif isinstance(security_methods, str): + print("security_methods parameter is a string") + security_methods.append([security_methods]) + if aef_ids is not None: - profiles = create_aef_profiles(aef_ids) + profiles = create_aef_profiles( + aef_ids, + security_methods, + domain_name, + interface_descriptions) body['aefProfiles'] = profiles - + # description if description is not None: body['description'] = description @@ -163,3 +236,7 @@ def create_service_api_description_patch(aef_id=None, body['apiStatus']['aefIds'] = aef_ids_active return body + + +def get_value(lst, index): + return lst[index] if index < len(lst) else None -- GitLab From 5a3f638e0407589c755b6613caab5bf822334634 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 2 Apr 2025 11:53:33 +0200 Subject: [PATCH 085/157] created new test related with security flow of PKI --- .../capif_security_api.robot | 65 +++++++++++ .../api_publish_service/bodyRequests.py | 102 ++++++++++++------ tests/libraries/helpers.py | 12 +++ tests/resources/common/basicRequests.robot | 13 +++ 4 files changed, 159 insertions(+), 33 deletions(-) diff --git a/tests/features/CAPIF Security Api/capif_security_api.robot b/tests/features/CAPIF Security Api/capif_security_api.robot index 8d511765..530914a9 100644 --- a/tests/features/CAPIF Security Api/capif_security_api.robot +++ b/tests/features/CAPIF Security Api/capif_security_api.robot @@ -1252,3 +1252,68 @@ Retrieve access token with invalid apiName at scope Check Response Variable Type And Values ${resp} 400 AccessTokenErr ... error=invalid_scope ... error_description=One of the api names does not exist or is not associated with the aef id provided + + +Retrieve the Security Context of an API Invoker for PKI security method + [Tags] capif_security_api-28 smoke + # Default Invoker Registration and Onboarding + ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding + + # Register Provider + ${register_user_info_provider}= Provider Default Registration + + # Publish Service API + # Create list with security methods + ${security_methods}= Create List PKI + ${service_api_description_published_1} ${resource_url} ${request_body}= Publish Service Api + ... ${register_user_info_provider} + ... service_1 + ... security_methods=${security_methods} + + # Store apiId1 + ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} + + # Create Security Context + ${request_body}= Create Service Security Default Body + ... ${NOTIFICATION_DESTINATION_URL} + ... aef_id=${register_user_info_provider['aef_id']} + ... api_id=${service_api_id_1} + ${resp}= Put Request Capif + ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']} + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + Check Response Variable Type And Values ${resp} 201 ServiceSecurity + ${resource_url}= Check Location Header ${resp} ${LOCATION_SECURITY_RESOURCE_REGEX} + + ${service_security_context}= Set Variable ${resp.json()} + + # Retrieve Security context can setup by parameters if authenticationInfo and authorizationInfo are needed at response. + ${resp}= Get Request Capif + ... /capif-security/v1/trustedInvokers/${register_user_info_invoker['api_invoker_id']}?authenticationInfo=true&authorizationInfo=true + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AEF_PROVIDER_USERNAME} + + # Check Results + Check Response Variable Type And Values ${resp} 200 ServiceSecurity + + # Response must accomplish: + # aefProfile must contain authenticationInfo with CA root certificate + # aefProfile must NOT CONTAIN authorizationInfo + + # Create security_info to compare with response + ## Read CA root certificate + ${ca_root}= Read File Utf8 ca.crt + ## Create a securityInfo with authenticationInfo with CA root certificate + ${security_info_expected}= Add Key To Object ${service_security_context['securityInfo'][0]} authenticationInfo ${ca_root} + ## Create List of securityInfo + ${security_info_list}= Create List ${security_info_expected} + ## Set expected securityInfo list in service_security_context + ${service_security_context_filtered}= Add Key To Object ${service_security_context} securityInfo ${security_info_list} + Log Dictionary ${service_security_context_filtered} + + # Check Results + Dictionaries Should Be Equal ${resp.json()} ${service_security_context_filtered} diff --git a/tests/libraries/api_publish_service/bodyRequests.py b/tests/libraries/api_publish_service/bodyRequests.py index efdd87c6..3f17e6c0 100644 --- a/tests/libraries/api_publish_service/bodyRequests.py +++ b/tests/libraries/api_publish_service/bodyRequests.py @@ -4,7 +4,7 @@ def create_service_api_description(api_name="service_1", vendor_specific_service_api_description=None, vendor_specific_aef_profile=None, api_status=None, - security_method="default", + security_methods="default", domain_name=None, interface_descriptions=None): aef_ids = list() @@ -15,30 +15,31 @@ def create_service_api_description(api_name="service_1", print("aef_id parameter is a string") aef_ids.append(aef_id) - security_methods = list() - if security_method is not None: - if isinstance(security_method, list): - print("security_method parameter is a list") - if len(security_method) > 0: - if isinstance(security_method[0], list): - security_methods = security_method + security_methods_normalized = list() + if security_methods is not None: + if isinstance(security_methods, list): + print("security_methods parameter is a list") + if len(security_methods) > 0: + if isinstance(security_methods[0], list): + security_methods_normalized = security_methods else: - security_methods.append(security_method) - elif isinstance(security_method, str): + security_methods_normalized.append(security_methods) + elif isinstance(security_methods, str): print("security_methods parameter is a string") - if security_method == "default": + if security_methods == "default": for idx in range(len(aef_ids)): - security_methods.append(["OAUTH"]) - security_methods.append([security_method]) + security_methods_normalized.append(["OAUTH"]) + else: + security_methods_normalized.append([security_methods]) else: - print(f"security_method is {security_method}") - print(f"security_methods: {security_methods}") + print(f"security_methods is {security_methods}") + print(f"security_methods_normalized: {security_methods_normalized}") else: - print("security_method parameter is None") + print("security_methods parameter is None") profiles = create_aef_profiles( aef_ids, - security_methods, + security_methods_normalized, domain_name, interface_descriptions) @@ -142,11 +143,12 @@ def create_aef_profile(aef_id, data['interfaceDescriptions'] = interface_descriptions elif domain_name is None and interface_descriptions is None: data['interfaceDescriptions'] = [ - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": security_method - } + create_interface_description( + ipv4_addr="string", + port=65535, + security_methods=security_method, + grant_types=["CLIENT_CREDENTIALS"] + ) ] if security_method is not None: @@ -162,7 +164,7 @@ def create_service_api_description_patch(aef_id=None, api_supp_feats=None, pub_api_path=None, ccf_id=None, - security_method=None, + security_methods=None, domain_name=None, interface_descriptions=None): body = dict() @@ -178,23 +180,23 @@ def create_service_api_description_patch(aef_id=None, print("aef_id parameter is a string") aef_ids.append(aef_id) - security_methods = list() - if security_method is not None: - if isinstance(security_method, list): - print("security_method parameter is a list") - if len(security_method) > 0: - if isinstance(security_method[0], list): - security_methods = security_method + security_methods_normalized = list() + if security_methods is not None: + if isinstance(security_methods, list): + print("security_methods parameter is a list") + if len(security_methods) > 0: + if isinstance(security_methods[0], list): + security_methods_normalized = security_methods else: - security_methods.append(security_method) + security_methods_normalized.append(security_methods) elif isinstance(security_methods, str): print("security_methods parameter is a string") - security_methods.append([security_methods]) + security_methods_normalized.append([security_methods]) if aef_ids is not None: profiles = create_aef_profiles( aef_ids, - security_methods, + security_methods_normalized, domain_name, interface_descriptions) body['aefProfiles'] = profiles @@ -240,3 +242,37 @@ def create_service_api_description_patch(aef_id=None, def get_value(lst, index): return lst[index] if index < len(lst) else None + + +def create_interface_description(ipv4_addr=None, + ipv6_addr=None, + fqdn=None, + port=None, + api_prefix=None, + security_methods=None, + grant_types=None): + """ + Create an interface description with the given parameters. + """ + # Create the interface description dictionary + data = dict() + if ipv4_addr is not None: + data['ipv4Addr'] = ipv4_addr + elif ipv6_addr is not None: + data['ipv6Addr'] = ipv6_addr + elif fqdn is not None: + data['fqdn'] = fqdn + else: + raise ValueError( + "At least one of ipv4_addr, ipv6_addr, or fqdn must be provided.") + + if port is not None: + data['port'] = port + if api_prefix is not None: + data['apiPrefix'] = api_prefix + if security_methods is not None: + data['securityMethods'] = security_methods + if grant_types is not None: + data['grantTypes'] = grant_types + # Return the interface description + return data diff --git a/tests/libraries/helpers.py b/tests/libraries/helpers.py index ae633734..eac2594a 100644 --- a/tests/libraries/helpers.py +++ b/tests/libraries/helpers.py @@ -50,6 +50,12 @@ def store_in_file(file_path, data): f.write(bytes(data, 'utf-8')) f.close() +def read_file_utf8(file_path: str) -> str: + try: + with open(file_path, 'r', encoding='utf-8') as file: + return file.read() + except Exception as error: + raise Exception(f"Error al leer el archivo: {error}") def cert_tuple(cert_file, key_file): return (cert_file, key_file) @@ -134,6 +140,12 @@ def remove_key_from_object(input, key_to_remove): return input_copy +def add_key_to_object(input, key_to_add, value_to_add): + input_copy = copy.deepcopy(input) + input_copy[key_to_add] = value_to_add + return input_copy + + def create_scope(aef_id, api_name): data = "3gpp#" + aef_id + ":" + api_name diff --git a/tests/resources/common/basicRequests.robot b/tests/resources/common/basicRequests.robot index 14953559..2fcd1894 100644 --- a/tests/resources/common/basicRequests.robot +++ b/tests/resources/common/basicRequests.robot @@ -796,6 +796,9 @@ Publish Service Api Request ... ${vendor_specific_aef_profile}=${None} ... ${aef_id}=${NONE} ... ${api_status}=${NONE} + ... ${security_methods}=default + ... ${domain_name}=${NONE} + ... ${interface_descriptions}=${NONE} ${aef_ids}= Create List IF "${aef_id}" == "${NONE}" @@ -826,6 +829,10 @@ Publish Service Api Request ... ${vendor_specific_service_api_description} ... ${vendor_specific_aef_profile} ... ${api_status} + ... ${security_methods} + ... ${domain_name} + ... ${interface_descriptions} + ${resp}= Post Request Capif ... /published-apis/v1/${apf_id_to_use}/service-apis ... json=${request_body} @@ -846,6 +853,9 @@ Publish Service Api ... ${vendor_specific_aef_profile}=${None} ... ${aef_id}=${NONE} ... ${api_status}=${NONE} + ... ${security_methods}=default + ... ${domain_name}=${NONE} + ... ${interface_descriptions}=${NONE} ${resp} ${request_body}= Publish Service Api Request ... ${register_user_info_provider} @@ -857,6 +867,9 @@ Publish Service Api ... ${vendor_specific_aef_profile} ... ${aef_id} ... ${api_status} + ... ${security_methods} + ... ${domain_name} + ... ${interface_descriptions} Check Response Variable Type And Values ${resp} 201 ServiceAPIDescription Dictionary Should Contain Key ${resp.json()} apiId -- GitLab From ba88c40ccc6ba9ca9b620b86fa134e5c3d0725f2 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Wed, 2 Apr 2025 12:38:04 +0200 Subject: [PATCH 086/157] return suppFeat in the same field --- .../core/provider_enrolment_details_api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py index 1b88a73c..490a9e68 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py @@ -102,7 +102,10 @@ class ProviderManagementOperations(Resource): current_app.logger.debug("Provider inserted in database") response_obj = serialize_clean_camel_case(api_provider_enrolment_details) - response_obj["supportedFeaturesFlags"] = negotiated_flags + + # ← Aquí aplicamos el cambio: sustituimos suppFeat por los flags interpretados + response_obj["suppFeat"] = negotiated_flags + res = make_response(object=response_obj, status=201) res.headers['Location'] = f"https://{os.getenv("CAPIF_HOSTNAME")}/api-provider-management/v1/registrations/{str(api_provider_enrolment_details.api_prov_dom_id)}" return res -- GitLab From db93ee118ebe89273571a85ce8e7e74383542df5 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 2 Apr 2025 12:56:23 +0200 Subject: [PATCH 087/157] remove grantType from interfaceDescriptions (is present from v18.7.0 of 3GPP CAPIF --- .../capif_security/core/servicesecurity.py | 2 +- tests/libraries/api_publish_service/bodyRequests.py | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py index b7c82b2c..e0a9041b 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py @@ -129,7 +129,7 @@ class SecurityOperations(Resource): elif security_info_obj.get('sel_security_method') == "PSK": current_app.logger.debug("PSK security method selected") if authentication_info: - # Read the PSK from the file + # Read the PSK from the file -> TODO with open("/usr/src/app/capif_security/ca.crt", "rb") as key_file: key_data = key_file.read() # Decode the PSK to a string diff --git a/tests/libraries/api_publish_service/bodyRequests.py b/tests/libraries/api_publish_service/bodyRequests.py index 3f17e6c0..a86ce024 100644 --- a/tests/libraries/api_publish_service/bodyRequests.py +++ b/tests/libraries/api_publish_service/bodyRequests.py @@ -146,8 +146,7 @@ def create_aef_profile(aef_id, create_interface_description( ipv4_addr="string", port=65535, - security_methods=security_method, - grant_types=["CLIENT_CREDENTIALS"] + security_methods=security_method ) ] @@ -249,8 +248,7 @@ def create_interface_description(ipv4_addr=None, fqdn=None, port=None, api_prefix=None, - security_methods=None, - grant_types=None): + security_methods=None): """ Create an interface description with the given parameters. """ @@ -272,7 +270,5 @@ def create_interface_description(ipv4_addr=None, data['apiPrefix'] = api_prefix if security_methods is not None: data['securityMethods'] = security_methods - if grant_types is not None: - data['grantTypes'] = grant_types # Return the interface description return data -- GitLab From 2f2d04f0a80f66b7089a11032332b77d83774b53 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Wed, 2 Apr 2025 14:11:00 +0300 Subject: [PATCH 088/157] Add check when EnhancedEventReport is deactivated and events filters exist --- .../capif_events/core/events_apis.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index a247226b..7f60bc24 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -213,6 +213,13 @@ class EventSubscriptionsOperations(Resource): result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) if isinstance(result, Response): return result + elif (not negotiated_supported_features["EnhancedEventReport"]) and event_subscription.event_filters: + current_app.logger.error("Event filters provided but EnhancedEventReport is not enabled") + return bad_request_error( + detail="Bad Param", + cause="Event filters provided but EnhancedEventReport is not enabled", + invalid_params=[{"param": "eventFilters", "reason": "EnhancedEventReport is not enabled"}] + ) event_subscription.supported_features = negotiated_supported_features["Final"] -- GitLab From 8e03d7ed1c546ab5a8995d0cf270d1703635b85e Mon Sep 17 00:00:00 2001 From: guillecxb Date: Wed, 2 Apr 2025 16:24:15 +0200 Subject: [PATCH 089/157] implementation with the negotiated hex inside of the dict --- .../core/provider_enrolment_details_api.py | 35 ++++++------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py index 490a9e68..a721a5aa 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py @@ -16,21 +16,16 @@ from ..util import dict_to_camel_case, clean_empty, serialize_clean_camel_case TOTAL_FEATURES = 2 -SUPPORTED_FEATURES_HEX = "1" +SUPPORTED_FEATURES_HEX = "0" -def negotiate_supported_features(supp_feat): +def return_negotiated_supp_feat_dict(supp_feat): final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] return { "PatchUpdate": True if final_supp_feat[0] == "1" else False, "RNAA": True if final_supp_feat[1] == "1" else False, + "Final": hex(int(final_supp_feat[::-1], 2))[2:] } - -def negotiate_supported_features_hex(supp_feat): - negotiated = int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16) - return format(negotiated, 'x') - - class ProviderManagementOperations(Resource): def __check_api_provider_domain(self, api_prov_dom_id): @@ -66,18 +61,8 @@ class ProviderManagementOperations(Resource): api_provider_enrolment_details.api_prov_dom_id = secrets.token_hex( 15) - if api_provider_enrolment_details.supp_feat is None: - return bad_request_error( - detail="supportedFeatures not present in request", - cause="supportedFeatures not present", - invalid_params=[{"param": "supp_feat", "reason": "not defined"}] - ) - - # Supported Features Negotiation - client_feat = api_provider_enrolment_details.supp_feat - negotiated_hex = negotiate_supported_features_hex(client_feat) - api_provider_enrolment_details.supp_feat = negotiated_hex - negotiated_flags = negotiate_supported_features(negotiated_hex) + negotiated_supported_features = return_negotiated_supp_feat_dict(api_provider_enrolment_details.supp_feat) + api_provider_enrolment_details.supp_feat = negotiated_supported_features["Final"] current_app.logger.debug("Generating certs to api prov funcs") @@ -101,12 +86,9 @@ class ProviderManagementOperations(Resource): current_app.logger.debug("Provider inserted in database") - response_obj = serialize_clean_camel_case(api_provider_enrolment_details) - - # ← Aquí aplicamos el cambio: sustituimos suppFeat por los flags interpretados - response_obj["suppFeat"] = negotiated_flags + res = make_response(object=serialize_clean_camel_case( + api_provider_enrolment_details), status=201) - res = make_response(object=response_obj, status=201) res.headers['Location'] = f"https://{os.getenv("CAPIF_HOSTNAME")}/api-provider-management/v1/registrations/{str(api_provider_enrolment_details.api_prov_dom_id)}" return res @@ -167,6 +149,9 @@ class ProviderManagementOperations(Resource): if isinstance(result, Response): return result + + negotiated_supported_features = return_negotiated_supp_feat_dict(api_provider_enrolment_details.supp_feat) + api_provider_enrolment_details.supp_feat = negotiated_supported_features["Final"] for func in api_provider_enrolment_details.api_prov_funcs: if func.api_prov_func_id is None: -- GitLab From 128eced72d285b3bd6c6016bd98c3405bfbdbcab Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 3 Apr 2025 10:10:55 +0200 Subject: [PATCH 090/157] ACL API realease V18.6.0 --- .../.openapi-generator/VERSION | 2 +- .../TS29222_CAPIF_Access_Control_Policy_API/README.md | 4 ++-- .../capif_acl/controllers/default_controller.py | 2 -- .../capif_acl/controllers/security_controller.py | 2 +- .../capif_acl/encoder.py | 2 +- .../capif_acl/models/__init__.py | 5 +++++ .../capif_acl/models/access_control_policy_list.py | 6 ++++-- .../capif_acl/models/api_invoker_policy.py | 6 ++++-- .../capif_acl/models/base_model.py | 1 + .../capif_acl/models/invalid_param.py | 3 ++- .../capif_acl/models/problem_details.py | 11 +++++++---- .../capif_acl/models/time_range_list.py | 3 ++- .../capif_acl/openapi/openapi.yaml | 6 +++--- .../capif_acl/test/__init__.py | 3 ++- .../capif_acl/util.py | 2 -- .../TS29222_CAPIF_Access_Control_Policy_API/setup.py | 2 +- 16 files changed, 36 insertions(+), 24 deletions(-) diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/VERSION index 18bb4182..b23eb275 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.11.0 diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/README.md b/services/TS29222_CAPIF_Access_Control_Policy_API/README.md index 1222b0aa..40feae4b 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/README.md +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/README.md @@ -42,8 +42,8 @@ To run the server on a Docker container, please execute the following from the r ```bash # building the image -docker build -t capif_acl . +docker build -t openapi_server . # starting up a container -docker run -p 8080:8080 capif_acl +docker run -p 8080:8080 openapi_server ``` \ No newline at end of file diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py index bf9857c6..4cd2db2d 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py @@ -6,7 +6,6 @@ from flask import request, current_app from ..core.accesscontrolpolicyapi import accessControlPolicyApi - def cert_validation(): def _cert_validation(f): @wraps(f) @@ -24,7 +23,6 @@ def cert_validation(): return __cert_validation return _cert_validation -@cert_validation() def access_control_policy_list_service_api_id_get(service_api_id, aef_id, api_invoker_id=None, supported_features=None): # noqa: E501 """access_control_policy_list_service_api_id_get diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller.py index 139597f9..6d294ffd 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller.py @@ -1,2 +1,2 @@ - +from typing import List diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py index 9afbbe1d..627a7bd7 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py @@ -15,4 +15,4 @@ class CustomJSONEncoder(JSONEncoder): attr = o.attribute_map[attr] dikt[attr] = value return dikt - return JSONEncoder.default(self, o) + return JSONEncoder.default(self, o) \ No newline at end of file diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py index d036df69..43aa0151 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py @@ -1,2 +1,7 @@ # flake8: noqa # import models into model package +from capif_acl.models.access_control_policy_list import AccessControlPolicyList +from capif_acl.models.api_invoker_policy import ApiInvokerPolicy +from capif_acl.models.invalid_param import InvalidParam +from capif_acl.models.problem_details import ProblemDetails +from capif_acl.models.time_range_list import TimeRangeList diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py index 03850940..a851ac32 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_acl import util -from capif_acl.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 from capif_acl.models.base_model import Model +from capif_acl.models.api_invoker_policy import ApiInvokerPolicy +from capif_acl import util +from capif_acl.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 class AccessControlPolicyList(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py index 1798a003..a22e84c5 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_acl import util from capif_acl.models.base_model import Model -from capif_acl.models.time_range_list import TimeRangeList # noqa: E501 +from capif_acl.models.time_range_list import TimeRangeList +from capif_acl import util +from capif_acl.models.time_range_list import TimeRangeList # noqa: E501 class ApiInvokerPolicy(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py index 2e2e14aa..fed13c90 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py @@ -1,4 +1,5 @@ import pprint + import typing from capif_acl import util diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py index cd2c0864..a6789dc2 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_acl import util from capif_acl.models.base_model import Model +from capif_acl import util class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py index 99610c5a..8473fc2b 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_acl import util from capif_acl.models.base_model import Model -from capif_acl.models.invalid_param import InvalidParam # noqa: E501 +from capif_acl.models.invalid_param import InvalidParam +import re +from capif_acl import util +from capif_acl.models.invalid_param import InvalidParam # noqa: E501 +import re # noqa: E501 class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -259,6 +262,6 @@ class ProblemDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py index 5585278a..b9c47240 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_acl import util from capif_acl.models.base_model import Model +from capif_acl import util class TimeRangeList(Model): diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml index 16469310..eebcdfe3 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for access control policy. \n© 2022, 3GPP Organizational Partners\ + description: "API for access control policy. \n© 2024, 3GPP Organizational Partners\ \ (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Access_Control_Policy_API - version: 1.3.0-alpha.1 + version: 1.3.0 externalDocs: - description: 3GPP TS 29.222 V18.0.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/access-control-policy/v1" diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/__init__.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/__init__.py index f70a615e..5d664f82 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/__init__.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/__init__.py @@ -1,9 +1,10 @@ import logging import connexion -from capif_acl.encoder import JSONEncoder from flask_testing import TestCase +from capif_acl.encoder import JSONEncoder + class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/util.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/util.py index 599f221a..9fc4382f 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/util.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/util.py @@ -51,8 +51,6 @@ def dict_to_camel_case(my_dict): return result - - def _deserialize(data, klass): """Deserializes dict, list, str into an object. diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py b/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py index d4234b02..043381ad 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py @@ -30,7 +30,7 @@ setup( entry_points={ 'console_scripts': ['capif_acl=capif_acl.__main__:main']}, long_description="""\ - API for access control policy. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for access control policy. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) -- GitLab From db4e73f700292ee9677f4126f66e32bb1f292a03 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 3 Apr 2025 11:47:37 +0200 Subject: [PATCH 091/157] Invoker management API realease V18.6.0 --- .../.openapi-generator/FILES | 1 + .../.openapi-generator/VERSION | 2 +- .../controllers/default_controller.py | 12 +- ...pi_invoker_enrolment_details_controller.py | 2 +- .../api_invoker_management/models/__init__.py | 47 ++++ .../models/aef_location.py | 7 +- .../models/aef_profile.py | 45 +++- .../models/api_invoker_enrolment_details.py | 13 +- .../api_invoker_enrolment_details_patch.py | 7 +- .../api_invoker_management/models/api_list.py | 6 +- .../models/api_status.py | 3 +- .../models/base_model.py | 1 + .../models/civic_address.py | 3 +- .../models/communication_type.py | 3 +- .../models/custom_operation.py | 7 +- .../models/data_format.py | 3 +- .../models/ellipsoid_arc.py | 9 +- .../models/gad_shape.py | 6 +- .../models/geographic_area.py | 22 +- .../models/geographical_coordinates.py | 3 +- .../models/interface_description.py | 47 +++- .../models/invalid_param.py | 3 +- .../models/ip_addr_range.py | 7 +- .../models/ipv4_address_range.py | 10 +- .../models/ipv6_addr1.py | 3 +- .../models/ipv6_address_range.py | 6 +- .../local2d_point_uncertainty_ellipse.py | 11 +- .../local3d_point_uncertainty_ellipsoid.py | 49 +++- .../models/local_origin.py | 74 +++++- .../models/o_auth_grant_type.py | 34 +++ .../models/onboarding_information.py | 3 +- .../models/onboarding_notification.py | 7 +- .../models/operation.py | 3 +- .../api_invoker_management/models/point.py | 9 +- .../models/point_altitude.py | 9 +- .../models/point_altitude_uncertainty.py | 10 +- .../models/point_uncertainty_circle.py | 9 +- .../models/point_uncertainty_ellipse.py | 10 +- .../api_invoker_management/models/polygon.py | 9 +- .../models/problem_details.py | 11 +- .../api_invoker_management/models/protocol.py | 3 +- .../models/published_api_path.py | 3 +- .../models/relative_cartesian_location.py | 3 +- .../api_invoker_management/models/resource.py | 8 +- .../models/security_method.py | 3 +- .../models/service_api_description.py | 16 +- .../models/service_kpis.py | 14 +- .../models/shareable_information.py | 3 +- .../models/supported_gad_shapes.py | 3 +- .../models/uncertainty_ellipse.py | 3 +- .../models/uncertainty_ellipsoid.py | 3 +- .../api_invoker_management/models/version.py | 7 +- .../models/websock_notif_config.py | 3 +- .../openapi/openapi.yaml | 248 +++++++++++++++++- .../api_invoker_management/test/__init__.py | 3 +- .../test/test_default_controller.py | 9 +- ...pi_invoker_enrolment_details_controller.py | 6 +- .../api_invoker_management/typing_utils.py | 1 + .../api_invoker_management/util.py | 1 - 59 files changed, 740 insertions(+), 126 deletions(-) create mode 100644 services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/o_auth_grant_type.py diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/FILES b/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/FILES index dd0e2a9e..716733b5 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/FILES @@ -37,6 +37,7 @@ api_invoker_management/models/ipv6_address_range.py api_invoker_management/models/local2d_point_uncertainty_ellipse.py api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py api_invoker_management/models/local_origin.py +api_invoker_management/models/o_auth_grant_type.py api_invoker_management/models/onboarding_information.py api_invoker_management/models/onboarding_notification.py api_invoker_management/models/operation.py diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/VERSION index 18bb4182..b23eb275 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.11.0 diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py index c080cd19..118e93fd 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py @@ -12,7 +12,6 @@ from ..models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # invoker_operations = InvokerManagementOperations() valid_user = ControlAccess() - def cert_validation(): def _cert_validation(f): @wraps(f) @@ -47,9 +46,8 @@ def onboarded_invokers_onboarding_id_delete(onboarding_id): # noqa: E501 :param onboarding_id: String identifying an individual on-boarded API invoker resource :type onboarding_id: str - :rtype: None + :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] """ - current_app.logger.info("Removing invoker") res = invoker_operations.remove_apiinvokerenrolmentdetail(onboarding_id) @@ -66,7 +64,7 @@ def onboarded_invokers_onboarding_id_put(onboarding_id, body): # noqa: E501 :param api_invoker_enrolment_details: representation of the API invoker details to be updated in CAPIF core function :type api_invoker_enrolment_details: dict | bytes - :rtype: APIInvokerEnrolmentDetails + :rtype: Union[APIInvokerEnrolmentDetails, Tuple[APIInvokerEnrolmentDetails, int], Tuple[APIInvokerEnrolmentDetails, int, Dict[str, str]] """ current_app.logger.info("Updating invoker") if request.is_json: @@ -76,19 +74,17 @@ def onboarded_invokers_onboarding_id_put(onboarding_id, body): # noqa: E501 return res - @jwt_required() def onboarded_invokers_post(body): # noqa: E501 """onboarded_invokers_post Creates a new individual API Invoker profile. # noqa: E501 - :param api_invoker_enrolment_details: + :param api_invoker_enrolment_details: :type api_invoker_enrolment_details: dict | bytes - :rtype: APIInvokerEnrolmentDetails + :rtype: Union[APIInvokerEnrolmentDetails, Tuple[APIInvokerEnrolmentDetails, int], Tuple[APIInvokerEnrolmentDetails, int, Dict[str, str]] """ - identity = get_jwt_identity() username, uuid = identity.split() diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py index 9cce3a04..bdc1fd92 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py @@ -1,7 +1,7 @@ from api_invoker_management.models.api_invoker_enrolment_details_patch import APIInvokerEnrolmentDetailsPatch # noqa: E501 -def modify_ind_api_invoke_enrolment(onboarding_id, api_invoker_enrolment_details_patch): # noqa: E501 +def modify_ind_api_invoke_enrolment(onboarding_id, body): # noqa: E501 """modify_ind_api_invoke_enrolment Modify an individual API invoker details. # noqa: E501 diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/__init__.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/__init__.py index d036df69..274af8e6 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/__init__.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/__init__.py @@ -1,2 +1,49 @@ # flake8: noqa # import models into model package +from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails +from api_invoker_management.models.api_invoker_enrolment_details_patch import APIInvokerEnrolmentDetailsPatch +from api_invoker_management.models.api_list import APIList +from api_invoker_management.models.aef_location import AefLocation +from api_invoker_management.models.aef_profile import AefProfile +from api_invoker_management.models.api_status import ApiStatus +from api_invoker_management.models.civic_address import CivicAddress +from api_invoker_management.models.communication_type import CommunicationType +from api_invoker_management.models.custom_operation import CustomOperation +from api_invoker_management.models.data_format import DataFormat +from api_invoker_management.models.ellipsoid_arc import EllipsoidArc +from api_invoker_management.models.gad_shape import GADShape +from api_invoker_management.models.geographic_area import GeographicArea +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates +from api_invoker_management.models.interface_description import InterfaceDescription +from api_invoker_management.models.invalid_param import InvalidParam +from api_invoker_management.models.ip_addr_range import IpAddrRange +from api_invoker_management.models.ipv4_address_range import Ipv4AddressRange +from api_invoker_management.models.ipv6_addr1 import Ipv6Addr1 +from api_invoker_management.models.ipv6_address_range import Ipv6AddressRange +from api_invoker_management.models.local2d_point_uncertainty_ellipse import Local2dPointUncertaintyEllipse +from api_invoker_management.models.local3d_point_uncertainty_ellipsoid import Local3dPointUncertaintyEllipsoid +from api_invoker_management.models.local_origin import LocalOrigin +from api_invoker_management.models.o_auth_grant_type import OAuthGrantType +from api_invoker_management.models.onboarding_information import OnboardingInformation +from api_invoker_management.models.onboarding_notification import OnboardingNotification +from api_invoker_management.models.operation import Operation +from api_invoker_management.models.point import Point +from api_invoker_management.models.point_altitude import PointAltitude +from api_invoker_management.models.point_altitude_uncertainty import PointAltitudeUncertainty +from api_invoker_management.models.point_uncertainty_circle import PointUncertaintyCircle +from api_invoker_management.models.point_uncertainty_ellipse import PointUncertaintyEllipse +from api_invoker_management.models.polygon import Polygon +from api_invoker_management.models.problem_details import ProblemDetails +from api_invoker_management.models.protocol import Protocol +from api_invoker_management.models.published_api_path import PublishedApiPath +from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation +from api_invoker_management.models.resource import Resource +from api_invoker_management.models.security_method import SecurityMethod +from api_invoker_management.models.service_api_description import ServiceAPIDescription +from api_invoker_management.models.service_kpis import ServiceKpis +from api_invoker_management.models.shareable_information import ShareableInformation +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse +from api_invoker_management.models.uncertainty_ellipsoid import UncertaintyEllipsoid +from api_invoker_management.models.version import Version +from api_invoker_management.models.websock_notif_config import WebsockNotifConfig diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py index c5b5a7d0..226cef2c 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.civic_address import CivicAddress +from api_invoker_management.models.geographic_area import GeographicArea +from api_invoker_management import util + from api_invoker_management.models.civic_address import CivicAddress # noqa: E501 from api_invoker_management.models.geographic_area import GeographicArea # noqa: E501 - class AefLocation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py index 2556c6ec..d650c30b 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py @@ -1,25 +1,36 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from api_invoker_management.models.base_model import Model +from api_invoker_management.models.aef_location import AefLocation +from api_invoker_management.models.data_format import DataFormat +from api_invoker_management.models.interface_description import InterfaceDescription +from api_invoker_management.models.ip_addr_range import IpAddrRange +from api_invoker_management.models.o_auth_grant_type import OAuthGrantType +from api_invoker_management.models.protocol import Protocol +from api_invoker_management.models.security_method import SecurityMethod +from api_invoker_management.models.service_kpis import ServiceKpis +from api_invoker_management.models.version import Version from api_invoker_management import util + from api_invoker_management.models.aef_location import AefLocation # noqa: E501 -from api_invoker_management.models.base_model import Model from api_invoker_management.models.data_format import DataFormat # noqa: E501 from api_invoker_management.models.interface_description import InterfaceDescription # noqa: E501 from api_invoker_management.models.ip_addr_range import IpAddrRange # noqa: E501 +from api_invoker_management.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from api_invoker_management.models.protocol import Protocol # noqa: E501 from api_invoker_management.models.security_method import SecurityMethod # noqa: E501 from api_invoker_management.models.service_kpis import ServiceKpis # noqa: E501 from api_invoker_management.models.version import Version # noqa: E501 - class AefProfile(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ - def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 + def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, grant_types=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 """AefProfile - a model defined in OpenAPI :param aef_id: The aef_id of this AefProfile. # noqa: E501 @@ -32,6 +43,8 @@ class AefProfile(Model): :type data_format: DataFormat :param security_methods: The security_methods of this AefProfile. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this AefProfile. # noqa: E501 + :type grant_types: List[OAuthGrantType] :param domain_name: The domain_name of this AefProfile. # noqa: E501 :type domain_name: str :param interface_descriptions: The interface_descriptions of this AefProfile. # noqa: E501 @@ -49,6 +62,7 @@ class AefProfile(Model): 'protocol': Protocol, 'data_format': DataFormat, 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType], 'domain_name': str, 'interface_descriptions': List[InterfaceDescription], 'aef_location': AefLocation, @@ -62,6 +76,7 @@ class AefProfile(Model): 'protocol': 'protocol', 'data_format': 'dataFormat', 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes', 'domain_name': 'domainName', 'interface_descriptions': 'interfaceDescriptions', 'aef_location': 'aefLocation', @@ -74,6 +89,7 @@ class AefProfile(Model): self._protocol = protocol self._data_format = data_format self._security_methods = security_methods + self._grant_types = grant_types self._domain_name = domain_name self._interface_descriptions = interface_descriptions self._aef_location = aef_location @@ -210,6 +226,29 @@ class AefProfile(Model): self._security_methods = security_methods + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this AefProfile. + + + :return: The grant_types of this AefProfile. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this AefProfile. + + + :param grant_types: The grant_types of this AefProfile. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types + @property def domain_name(self) -> str: """Gets the domain_name of this AefProfile. diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py index c29d5515..521e6b2c 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py @@ -1,13 +1,18 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from api_invoker_management.models.base_model import Model +from api_invoker_management.models.api_list import APIList +from api_invoker_management.models.onboarding_information import OnboardingInformation +from api_invoker_management.models.websock_notif_config import WebsockNotifConfig +import re from api_invoker_management import util + from api_invoker_management.models.api_list import APIList # noqa: E501 -from api_invoker_management.models.base_model import Model from api_invoker_management.models.onboarding_information import OnboardingInformation # noqa: E501 from api_invoker_management.models.websock_notif_config import WebsockNotifConfig # noqa: E501 - +import re # noqa: E501 class APIInvokerEnrolmentDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -285,6 +290,6 @@ class APIInvokerEnrolmentDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py index 55e0255e..0ac660c7 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from api_invoker_management.models.base_model import Model +from api_invoker_management.models.api_list import APIList +from api_invoker_management.models.onboarding_information import OnboardingInformation from api_invoker_management import util + from api_invoker_management.models.api_list import APIList # noqa: E501 -from api_invoker_management.models.base_model import Model from api_invoker_management.models.onboarding_information import OnboardingInformation # noqa: E501 - class APIInvokerEnrolmentDetailsPatch(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py index 43fccbbe..6054d75c 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.service_api_description import ServiceAPIDescription # noqa: E501 +from api_invoker_management.models.service_api_description import ServiceAPIDescription +from api_invoker_management import util +from api_invoker_management.models.service_api_description import ServiceAPIDescription # noqa: E501 class APIList(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py index 6d199dea..c67e0f6c 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class ApiStatus(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/base_model.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/base_model.py index 19dfa2af..9975e6c9 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/base_model.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/base_model.py @@ -1,4 +1,5 @@ import pprint + import typing from api_invoker_management import util diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/civic_address.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/civic_address.py index 5c09caf9..a70b83c3 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/civic_address.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/civic_address.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class CivicAddress(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/communication_type.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/communication_type.py index 84d3489a..a09339c5 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/communication_type.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/communication_type.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class CommunicationType(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py index f9e7771f..c39874de 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.communication_type import CommunicationType +from api_invoker_management.models.operation import Operation +from api_invoker_management import util + from api_invoker_management.models.communication_type import CommunicationType # noqa: E501 from api_invoker_management.models.operation import Operation # noqa: E501 - class CustomOperation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/data_format.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/data_format.py index ecd02ac5..3b5ef198 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/data_format.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/data_format.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class DataFormat(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py index 7be7c612..48576865 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.gad_shape import GADShape +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management import util + +from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class EllipsoidArc(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py index 74c27870..fdbb7ff5 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management import util +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 class GADShape(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py index 02477e5d..11758707 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py @@ -1,13 +1,31 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.ellipsoid_arc import EllipsoidArc +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates +from api_invoker_management.models.point import Point +from api_invoker_management.models.point_altitude import PointAltitude +from api_invoker_management.models.point_altitude_uncertainty import PointAltitudeUncertainty +from api_invoker_management.models.point_uncertainty_circle import PointUncertaintyCircle +from api_invoker_management.models.point_uncertainty_ellipse import PointUncertaintyEllipse +from api_invoker_management.models.polygon import Polygon +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse +from api_invoker_management import util + +from api_invoker_management.models.ellipsoid_arc import EllipsoidArc # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.point import Point # noqa: E501 +from api_invoker_management.models.point_altitude import PointAltitude # noqa: E501 +from api_invoker_management.models.point_altitude_uncertainty import PointAltitudeUncertainty # noqa: E501 +from api_invoker_management.models.point_uncertainty_circle import PointUncertaintyCircle # noqa: E501 +from api_invoker_management.models.point_uncertainty_ellipse import PointUncertaintyEllipse # noqa: E501 +from api_invoker_management.models.polygon import Polygon # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class GeographicArea(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographical_coordinates.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographical_coordinates.py index c10a7c64..1e82fce5 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographical_coordinates.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographical_coordinates.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class GeographicalCoordinates(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py index 1c4e7192..86301d32 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py @@ -1,11 +1,16 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.security_method import SecurityMethod # noqa: E501 +from api_invoker_management.models.o_auth_grant_type import OAuthGrantType +from api_invoker_management.models.security_method import SecurityMethod +import re +from api_invoker_management import util +from api_invoker_management.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from api_invoker_management.models.security_method import SecurityMethod # noqa: E501 +import re # noqa: E501 class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +18,7 @@ class InterfaceDescription(Model): Do not edit the class manually. """ - def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None): # noqa: E501 + def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None, grant_types=None): # noqa: E501 """InterfaceDescription - a model defined in OpenAPI :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 @@ -28,6 +33,8 @@ class InterfaceDescription(Model): :type api_prefix: str :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this InterfaceDescription. # noqa: E501 + :type grant_types: List[OAuthGrantType] """ self.openapi_types = { 'ipv4_addr': str, @@ -35,7 +42,8 @@ class InterfaceDescription(Model): 'fqdn': str, 'port': int, 'api_prefix': str, - 'security_methods': List[SecurityMethod] + 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType] } self.attribute_map = { @@ -44,7 +52,8 @@ class InterfaceDescription(Model): 'fqdn': 'fqdn', 'port': 'port', 'api_prefix': 'apiPrefix', - 'security_methods': 'securityMethods' + 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes' } self._ipv4_addr = ipv4_addr @@ -53,6 +62,7 @@ class InterfaceDescription(Model): self._port = port self._api_prefix = api_prefix self._security_methods = security_methods + self._grant_types = grant_types @classmethod def from_dict(cls, dikt) -> 'InterfaceDescription': @@ -136,7 +146,7 @@ class InterfaceDescription(Model): if fqdn is not None and len(fqdn) < 4: raise ValueError("Invalid value for `fqdn`, length must be greater than or equal to `4`") # noqa: E501 if fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', fqdn): # noqa: E501 - raise ValueError("Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + raise ValueError(r"Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 self._fqdn = fqdn @@ -214,3 +224,26 @@ class InterfaceDescription(Model): raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 self._security_methods = security_methods + + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this InterfaceDescription. + + + :return: The grant_types of this InterfaceDescription. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this InterfaceDescription. + + + :param grant_types: The grant_types of this InterfaceDescription. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/invalid_param.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/invalid_param.py index 60f94e86..9fd06e46 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/invalid_param.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/invalid_param.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py index 7a8a4bf5..f831d595 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.ipv4_address_range import Ipv4AddressRange +from api_invoker_management.models.ipv6_address_range import Ipv6AddressRange +from api_invoker_management import util + from api_invoker_management.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 from api_invoker_management.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 - class IpAddrRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv4_address_range.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv4_address_range.py index eb609084..bddd1688 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv4_address_range.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv4_address_range.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +import re +from api_invoker_management import util +import re # noqa: E501 class Ipv4AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -67,7 +69,7 @@ class Ipv4AddressRange(Model): if start is None: raise ValueError("Invalid value for `start`, must not be `None`") # noqa: E501 if start is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', start): # noqa: E501 - raise ValueError("Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._start = start @@ -94,6 +96,6 @@ class Ipv4AddressRange(Model): if end is None: raise ValueError("Invalid value for `end`, must not be `None`") # noqa: E501 if end is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', end): # noqa: E501 - raise ValueError("Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._end = end diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_addr1.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_addr1.py index d12cb20c..ac8e6e66 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_addr1.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_addr1.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class Ipv6Addr1(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_address_range.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_address_range.py index 46203297..0b461670 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_address_range.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_address_range.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 +from api_invoker_management.models.ipv6_addr1 import Ipv6Addr1 +from api_invoker_management import util +from api_invoker_management.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 class Ipv6AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py index 50a6d460..b68d5903 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py @@ -1,14 +1,21 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.gad_shape import GADShape +from api_invoker_management.models.local_origin import LocalOrigin +from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse +from api_invoker_management import util + +from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.local_origin import LocalOrigin # noqa: E501 from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class Local2dPointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py index 7c8633fc..1ea64800 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py @@ -1,21 +1,28 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.gad_shape import GADShape +from api_invoker_management.models.local_origin import LocalOrigin +from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management.models.uncertainty_ellipsoid import UncertaintyEllipsoid +from api_invoker_management import util + +from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.local_origin import LocalOrigin # noqa: E501 from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from api_invoker_management.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 - class Local3dPointUncertaintyEllipsoid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ - def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None): # noqa: E501 + def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None, v_confidence=None): # noqa: E501 """Local3dPointUncertaintyEllipsoid - a model defined in OpenAPI :param shape: The shape of this Local3dPointUncertaintyEllipsoid. # noqa: E501 @@ -28,13 +35,16 @@ class Local3dPointUncertaintyEllipsoid(Model): :type uncertainty_ellipsoid: UncertaintyEllipsoid :param confidence: The confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 :type confidence: int + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type v_confidence: int """ self.openapi_types = { 'shape': SupportedGADShapes, 'local_origin': LocalOrigin, 'point': RelativeCartesianLocation, 'uncertainty_ellipsoid': UncertaintyEllipsoid, - 'confidence': int + 'confidence': int, + 'v_confidence': int } self.attribute_map = { @@ -42,7 +52,8 @@ class Local3dPointUncertaintyEllipsoid(Model): 'local_origin': 'localOrigin', 'point': 'point', 'uncertainty_ellipsoid': 'uncertaintyEllipsoid', - 'confidence': 'confidence' + 'confidence': 'confidence', + 'v_confidence': 'vConfidence' } self._shape = shape @@ -50,6 +61,7 @@ class Local3dPointUncertaintyEllipsoid(Model): self._point = point self._uncertainty_ellipsoid = uncertainty_ellipsoid self._confidence = confidence + self._v_confidence = v_confidence @classmethod def from_dict(cls, dikt) -> 'Local3dPointUncertaintyEllipsoid': @@ -182,3 +194,30 @@ class Local3dPointUncertaintyEllipsoid(Model): raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 self._confidence = confidence + + @property + def v_confidence(self) -> int: + """Gets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :return: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :rtype: int + """ + return self._v_confidence + + @v_confidence.setter + def v_confidence(self, v_confidence: int): + """Sets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :type v_confidence: int + """ + if v_confidence is not None and v_confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value less than or equal to `100`") # noqa: E501 + if v_confidence is not None and v_confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._v_confidence = v_confidence diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py index 1313b683..1f5eb93a 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py @@ -1,10 +1,14 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.geographic_area import GeographicArea +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates +from api_invoker_management import util +from api_invoker_management.models.geographic_area import GeographicArea # noqa: E501 +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 class LocalOrigin(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,26 +16,36 @@ class LocalOrigin(Model): Do not edit the class manually. """ - def __init__(self, coordinate_id=None, point=None): # noqa: E501 + def __init__(self, coordinate_id=None, point=None, area=None, horiz_axes_orientation=None): # noqa: E501 """LocalOrigin - a model defined in OpenAPI :param coordinate_id: The coordinate_id of this LocalOrigin. # noqa: E501 :type coordinate_id: str :param point: The point of this LocalOrigin. # noqa: E501 :type point: GeographicalCoordinates + :param area: The area of this LocalOrigin. # noqa: E501 + :type area: GeographicArea + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. # noqa: E501 + :type horiz_axes_orientation: int """ self.openapi_types = { 'coordinate_id': str, - 'point': GeographicalCoordinates + 'point': GeographicalCoordinates, + 'area': GeographicArea, + 'horiz_axes_orientation': int } self.attribute_map = { 'coordinate_id': 'coordinateId', - 'point': 'point' + 'point': 'point', + 'area': 'area', + 'horiz_axes_orientation': 'horizAxesOrientation' } self._coordinate_id = coordinate_id self._point = point + self._area = area + self._horiz_axes_orientation = horiz_axes_orientation @classmethod def from_dict(cls, dikt) -> 'LocalOrigin': @@ -62,6 +76,8 @@ class LocalOrigin(Model): :param coordinate_id: The coordinate_id of this LocalOrigin. :type coordinate_id: str """ + if coordinate_id is None: + raise ValueError("Invalid value for `coordinate_id`, must not be `None`") # noqa: E501 self._coordinate_id = coordinate_id @@ -85,3 +101,51 @@ class LocalOrigin(Model): """ self._point = point + + @property + def area(self) -> GeographicArea: + """Gets the area of this LocalOrigin. + + + :return: The area of this LocalOrigin. + :rtype: GeographicArea + """ + return self._area + + @area.setter + def area(self, area: GeographicArea): + """Sets the area of this LocalOrigin. + + + :param area: The area of this LocalOrigin. + :type area: GeographicArea + """ + + self._area = area + + @property + def horiz_axes_orientation(self) -> int: + """Gets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :return: The horiz_axes_orientation of this LocalOrigin. + :rtype: int + """ + return self._horiz_axes_orientation + + @horiz_axes_orientation.setter + def horiz_axes_orientation(self, horiz_axes_orientation: int): + """Sets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. + :type horiz_axes_orientation: int + """ + if horiz_axes_orientation is not None and horiz_axes_orientation > 3600: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value less than or equal to `3600`") # noqa: E501 + if horiz_axes_orientation is not None and horiz_axes_orientation < 0: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value greater than or equal to `0`") # noqa: E501 + + self._horiz_axes_orientation = horiz_axes_orientation diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/o_auth_grant_type.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/o_auth_grant_type.py new file mode 100644 index 00000000..3bc3a6f8 --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/o_auth_grant_type.py @@ -0,0 +1,34 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from api_invoker_management.models.base_model import Model +from api_invoker_management import util + + +class OAuthGrantType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """OAuthGrantType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'OAuthGrantType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OAuthGrantType of this OAuthGrantType. # noqa: E501 + :rtype: OAuthGrantType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py index b4a93bb7..8b5f6ea8 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class OnboardingInformation(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py index d7ec7e24..95d256ae 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py @@ -1,11 +1,14 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from api_invoker_management.models.base_model import Model +from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails +from api_invoker_management.models.api_list import APIList from api_invoker_management import util + from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # noqa: E501 from api_invoker_management.models.api_list import APIList # noqa: E501 -from api_invoker_management.models.base_model import Model - class OnboardingNotification(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/operation.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/operation.py index 8ebd5c61..846011b5 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/operation.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/operation.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class Operation(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py index 95ce36c2..82fa8c78 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.gad_shape import GADShape +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management import util + +from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class Point(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py index 4533b0cc..514bfe78 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.gad_shape import GADShape +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management import util + +from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class PointAltitude(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py index 4708b9b0..71170148 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py @@ -1,13 +1,19 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.gad_shape import GADShape +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse +from api_invoker_management import util + +from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class PointAltitudeUncertainty(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py index 89dd1c68..2b28dd8f 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.gad_shape import GADShape +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management import util + +from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class PointUncertaintyCircle(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py index 252f7be1..09c55edb 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py @@ -1,13 +1,19 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.gad_shape import GADShape +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse +from api_invoker_management import util + +from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class PointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py index 9b1ea42a..4b939caf 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.gad_shape import GADShape +from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates +from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes +from api_invoker_management import util + +from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class Polygon(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py index bf1b6677..420db0c1 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.invalid_param import InvalidParam # noqa: E501 +from api_invoker_management.models.invalid_param import InvalidParam +import re +from api_invoker_management import util +from api_invoker_management.models.invalid_param import InvalidParam # noqa: E501 +import re # noqa: E501 class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -259,6 +262,6 @@ class ProblemDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/protocol.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/protocol.py index 8322eb2c..efdaa084 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/protocol.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/protocol.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class Protocol(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/published_api_path.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/published_api_path.py index 76b6b93f..64da80c7 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/published_api_path.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/published_api_path.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class PublishedApiPath(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/relative_cartesian_location.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/relative_cartesian_location.py index e5092005..5bdb56a9 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/relative_cartesian_location.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/relative_cartesian_location.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class RelativeCartesianLocation(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py index 1fd97b39..b9b047b0 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.communication_type import CommunicationType +from api_invoker_management.models.custom_operation import CustomOperation +from api_invoker_management.models.operation import Operation +from api_invoker_management import util + from api_invoker_management.models.communication_type import CommunicationType # noqa: E501 from api_invoker_management.models.custom_operation import CustomOperation # noqa: E501 from api_invoker_management.models.operation import Operation # noqa: E501 - class Resource(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/security_method.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/security_method.py index 99a51a85..0a9e7394 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/security_method.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/security_method.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py index 29659b82..17106920 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py @@ -1,14 +1,20 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from api_invoker_management.models.base_model import Model +from api_invoker_management.models.aef_profile import AefProfile +from api_invoker_management.models.api_status import ApiStatus +from api_invoker_management.models.published_api_path import PublishedApiPath +from api_invoker_management.models.shareable_information import ShareableInformation +import re from api_invoker_management import util + from api_invoker_management.models.aef_profile import AefProfile # noqa: E501 from api_invoker_management.models.api_status import ApiStatus # noqa: E501 -from api_invoker_management.models.base_model import Model from api_invoker_management.models.published_api_path import PublishedApiPath # noqa: E501 from api_invoker_management.models.shareable_information import ShareableInformation # noqa: E501 - +import re # noqa: E501 class ServiceAPIDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -236,7 +242,7 @@ class ServiceAPIDescription(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features @@ -305,7 +311,7 @@ class ServiceAPIDescription(Model): :type api_supp_feats: str """ if api_supp_feats is not None and not re.search(r'^[A-Fa-f0-9]*$', api_supp_feats): # noqa: E501 - raise ValueError("Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._api_supp_feats = api_supp_feats diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_kpis.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_kpis.py index 9131233e..e17f70fe 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_kpis.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_kpis.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +import re +from api_invoker_management import util +import re # noqa: E501 class ServiceKpis(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -170,7 +172,7 @@ class ServiceKpis(Model): :type aval_comp: str """ if aval_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_comp): # noqa: E501 - raise ValueError("Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 self._aval_comp = aval_comp @@ -195,7 +197,7 @@ class ServiceKpis(Model): :type aval_gra_comp: str """ if aval_gra_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_gra_comp): # noqa: E501 - raise ValueError("Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 self._aval_gra_comp = aval_gra_comp @@ -220,7 +222,7 @@ class ServiceKpis(Model): :type aval_mem: str """ if aval_mem is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_mem): # noqa: E501 - raise ValueError("Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 self._aval_mem = aval_mem @@ -245,7 +247,7 @@ class ServiceKpis(Model): :type aval_stor: str """ if aval_stor is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_stor): # noqa: E501 - raise ValueError("Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 self._aval_stor = aval_stor diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py index a6f19807..e4f8263e 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class ShareableInformation(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/supported_gad_shapes.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/supported_gad_shapes.py index 4d459b98..5a361e90 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/supported_gad_shapes.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/supported_gad_shapes.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class SupportedGADShapes(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipse.py index b7e74949..6db89075 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipse.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class UncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipsoid.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipsoid.py index 5d41877b..613c6cc8 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipsoid.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class UncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py index dfdc783c..46329299 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.custom_operation import CustomOperation +from api_invoker_management.models.resource import Resource +from api_invoker_management import util + from api_invoker_management.models.custom_operation import CustomOperation # noqa: E501 from api_invoker_management.models.resource import Resource # noqa: E501 - class Version(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/websock_notif_config.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/websock_notif_config.py index 2c38535d..4d3f5d7d 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/websock_notif_config.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/websock_notif_config.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management import util class WebsockNotifConfig(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml index 12715c6e..566379b7 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml @@ -3,9 +3,9 @@ info: description: "API for API invoker management. \n© 2024, 3GPP Organizational Partners\ \ (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_API_Invoker_Management_API - version: 1.3.0-alpha.2 + version: 1.3.0 externalDocs: - description: 3GPP TS 29.222 V18.5.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/api-invoker-management/v1" @@ -18,10 +18,10 @@ paths: post: callbacks: notificationDestination: - '{request.body#/notificationDestination}': + '{$request.body#/notificationDestination}': post: description: Notify the API Invoker about the onboarding completion - operationId: notificationDestination_request_bodyNotificationDestinationPost + operationId: notification_destination_post requestBody: content: application/json: @@ -390,10 +390,10 @@ paths: put: callbacks: notificationDestination: - '{request.body#/notificationDestination}': + '{$request.body#/notificationDestination}': post: description: Notify the API Invoker about the API invoker update completion - operationId: notificationDestination_request_bodyNotificationDestinationPost + operationId: notification_destination_post requestBody: content: application/json: @@ -722,6 +722,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -900,6 +903,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -908,6 +914,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -925,6 +934,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1103,6 +1115,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1111,6 +1126,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1150,6 +1168,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1328,6 +1349,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1336,6 +1360,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1353,6 +1380,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1531,6 +1561,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1539,6 +1572,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1608,6 +1644,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1786,6 +1825,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1794,6 +1836,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1811,6 +1856,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1989,6 +2037,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1997,6 +2048,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2036,6 +2090,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -2214,6 +2271,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2222,6 +2282,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2239,6 +2302,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -2417,6 +2483,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2425,6 +2494,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2527,6 +2599,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -2705,6 +2780,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2713,6 +2791,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2730,6 +2811,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -2908,6 +2992,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2916,6 +3003,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2955,6 +3045,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -3133,6 +3226,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3141,6 +3237,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3158,6 +3257,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -3336,6 +3438,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3344,6 +3449,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3386,6 +3494,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -3564,6 +3675,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3572,6 +3686,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3589,6 +3706,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -3767,6 +3887,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3775,6 +3898,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3814,6 +3940,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -3992,6 +4121,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4000,6 +4132,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4017,6 +4152,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -4195,6 +4333,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4203,6 +4344,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4356,6 +4500,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -4534,6 +4681,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4542,6 +4692,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4559,6 +4712,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -4737,6 +4893,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4745,6 +4904,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4845,6 +5007,9 @@ components: description: Represents the AEF profile data. example: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -5023,6 +5188,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5031,6 +5199,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5048,7 +5219,10 @@ components: maxReqRate: 0 avalGraComp: avalGraComp nullable: true - oneOf: [] + oneOf: + - required: ["domainName"] + - required: ["interfaceDescriptions"] + - {} properties: aefId: description: Identifier of the API exposing function @@ -5072,6 +5246,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array domainName: description: Domain to which API belongs to title: domainName @@ -5365,6 +5545,9 @@ components: description: Represents the description of an API's interface. example: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5373,7 +5556,10 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr nullable: true - oneOf: [] + oneOf: + - required: ["fqdn"] + - required: ["ipv4Addr"] + - required: ["ipv6Addr"] properties: ipv4Addr: description: | @@ -5412,6 +5598,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array title: InterfaceDescription type: object AefLocation: @@ -5651,6 +5843,23 @@ components: nullable: true title: expTime type: string + OAuthGrantType: + anyOf: + - enum: + - CLIENT_CREDENTIALS + - AUTHORIZATION_CODE + - AUTHORIZATION_CODE_WITH_PKCE + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. + type: string + description: "Indicates the supported authorization flow (e.g. client credentials\ + \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ + \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ + \ credentials flow.\n- AUTHORIZATION_CODE: Indicate that the grant type is\ + \ authorization code.\n- AUTHORIZATION_CODE_WITH_PKCE: Indicate that the grant\ + \ type is authorization code with PKCE.\n" + title: OAuthGrantType Ipv4Addr: description: | string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. @@ -6109,8 +6318,26 @@ components: type: string point: $ref: '#/components/schemas/GeographicalCoordinates' + area: + $ref: '#/components/schemas/GeographicArea' + horizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in + 0.1 degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer + required: + - coordinateId title: LocalOrigin type: object + HorizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in 0.1 + degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer RelativeCartesianLocation: description: Relative Cartesian Location properties: @@ -6146,6 +6373,8 @@ components: $ref: '#/components/schemas/UncertaintyEllipsoid' confidence: $ref: '#/components/schemas/Confidence' + vConfidence: + $ref: '#/components/schemas/Confidence' required: - confidence - localOrigin @@ -6245,9 +6474,6 @@ components: title: Ipv6AddressRange type: object Ipv6Addr_1: - allOf: - - pattern: "^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$" - - pattern: "^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$" description: | String identifying an IPv6 address formatted according to clause 4 of RFC5952. The mixed IPv4 IPv6 notation according to clause 5 of RFC5952 shall not be used. example: 2001:db8:85a3::8a2e:370:7334 diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/__init__.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/__init__.py index df1dcccb..6f062ad6 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/__init__.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/__init__.py @@ -1,9 +1,10 @@ import logging import connexion -from api_invoker_management.encoder import JSONEncoder from flask_testing import TestCase +from api_invoker_management.encoder import JSONEncoder + class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py index 5724e7df..a74ac675 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py @@ -1,8 +1,11 @@ import unittest -from api_invoker_management.test import BaseTestCase from flask import json +from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # noqa: E501 +from api_invoker_management.models.problem_details import ProblemDetails # noqa: E501 +from api_invoker_management.test import BaseTestCase + class TestDefaultController(BaseTestCase): """DefaultController integration test stubs""" @@ -27,7 +30,7 @@ class TestDefaultController(BaseTestCase): """ - api_invoker_enrolment_details = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","expTime":"2000-01-23T04:56:07.000+00:00","apiInvokerInformation":"apiInvokerInformation","websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"onboardingInformation":{"apiInvokerPublicKey":"apiInvokerPublicKey","onboardingSecret":"onboardingSecret","apiInvokerCertificate":"apiInvokerCertificate"},"requestTestNotification":True,"apiList":{"serviceAPIDescriptions":[{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}},{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}}]}} + api_invoker_enrolment_details = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","expTime":"2000-01-23T04:56:07.000+00:00","apiInvokerInformation":"apiInvokerInformation","websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"onboardingInformation":{"apiInvokerPublicKey":"apiInvokerPublicKey","onboardingSecret":"onboardingSecret","apiInvokerCertificate":"apiInvokerCertificate"},"requestTestNotification":True,"apiList":{"serviceAPIDescriptions":[{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}},{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}}]}} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', @@ -46,7 +49,7 @@ class TestDefaultController(BaseTestCase): """ - api_invoker_enrolment_details = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","expTime":"2000-01-23T04:56:07.000+00:00","apiInvokerInformation":"apiInvokerInformation","websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"onboardingInformation":{"apiInvokerPublicKey":"apiInvokerPublicKey","onboardingSecret":"onboardingSecret","apiInvokerCertificate":"apiInvokerCertificate"},"requestTestNotification":True,"apiList":{"serviceAPIDescriptions":[{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}},{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}}]}} + api_invoker_enrolment_details = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","expTime":"2000-01-23T04:56:07.000+00:00","apiInvokerInformation":"apiInvokerInformation","websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"onboardingInformation":{"apiInvokerPublicKey":"apiInvokerPublicKey","onboardingSecret":"onboardingSecret","apiInvokerCertificate":"apiInvokerCertificate"},"requestTestNotification":True,"apiList":{"serviceAPIDescriptions":[{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}},{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}}]}} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py index d0cece92..598c8812 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py @@ -1,8 +1,12 @@ import unittest -from api_invoker_management.test import BaseTestCase from flask import json +from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # noqa: E501 +from api_invoker_management.models.api_invoker_enrolment_details_patch import APIInvokerEnrolmentDetailsPatch # noqa: E501 +from api_invoker_management.models.problem_details import ProblemDetails # noqa: E501 +from api_invoker_management.test import BaseTestCase + class TestIndividualAPIInvokerEnrolmentDetailsController(BaseTestCase): """IndividualAPIInvokerEnrolmentDetailsController integration test stubs""" diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/typing_utils.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/typing_utils.py index d21c4f63..74e3c913 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/typing_utils.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/typing_utils.py @@ -1,6 +1,7 @@ import sys if sys.version_info < (3, 7): + import typing def is_generic(klass): """ Determine whether klass is a generic class """ diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/util.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/util.py index cf911e58..c54beede 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/util.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/util.py @@ -2,7 +2,6 @@ import datetime from api_invoker_management import typing_utils - def serialize_clean_camel_case(obj): res = obj.to_dict() res = clean_empty(res) -- GitLab From 22eee7e345af4b66993089edcc058a73a5761da8 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 3 Apr 2025 12:25:50 +0200 Subject: [PATCH 092/157] Provider management API realease V18.6.0 --- .../api_invoker_management/openapi/openapi.yaml | 4 +++- .../.openapi-generator/VERSION | 2 +- .../README.md | 2 +- .../models/api_provider_enrolment_details.py | 11 +++++++---- .../models/api_provider_enrolment_details_patch.py | 6 ++++-- .../models/api_provider_func_role.py | 3 ++- .../models/api_provider_function_details.py | 7 +++++-- .../api_provider_management/models/base_model.py | 1 + .../api_provider_management/models/invalid_param.py | 3 ++- .../api_provider_management/models/problem_details.py | 11 +++++++---- .../models/registration_information.py | 3 ++- .../api_provider_management/openapi/openapi.yaml | 4 ++-- .../api_provider_management/test/__init__.py | 3 ++- .../test/test_default_controller.py | 5 ++++- ...idual_api_provider_enrolment_details_controller.py | 6 +++++- .../api_provider_management/typing_utils.py | 1 + .../api_provider_management/wsgi copy.py | 4 ---- 17 files changed, 49 insertions(+), 27 deletions(-) delete mode 100644 services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/wsgi copy.py diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml index 566379b7..43054968 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml @@ -5726,7 +5726,9 @@ components: title: ServiceKpis type: object IpAddrRange: - anyOf: [] + anyOf: + - required: ["ueIpv4AddrRanges"] + - required: ["ueIpv6AddrRanges"] description: Represents the list of public IP ranges example: ueIpv4AddrRanges: diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_API_Provider_Management_API/.openapi-generator/VERSION index 18bb4182..b23eb275 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_API_Provider_Management_API/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.11.0 diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/README.md b/services/TS29222_CAPIF_API_Provider_Management_API/README.md index 3aa91ec6..c9acf914 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/README.md +++ b/services/TS29222_CAPIF_API_Provider_Management_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m openapi_server +python3 -m api_provider_management ``` and open your browser to here: diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py index 92a63120..da7fb6da 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_provider_management import util -from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails # noqa: E501 from api_provider_management.models.base_model import Model +from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails +import re +from api_provider_management import util +from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails # noqa: E501 +import re # noqa: E501 class APIProviderEnrolmentDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -187,7 +190,7 @@ class APIProviderEnrolmentDetails(Model): :type supp_feat: str """ if supp_feat is not None and not re.search(r'^[A-Fa-f0-9]*$', supp_feat): # noqa: E501 - raise ValueError("Invalid value for `supp_feat`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supp_feat`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supp_feat = supp_feat diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py index a9eeeceb..e16230b9 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_provider_management import util -from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails # noqa: E501 from api_provider_management.models.base_model import Model +from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails +from api_provider_management import util +from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails # noqa: E501 class APIProviderEnrolmentDetailsPatch(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_func_role.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_func_role.py index 20cc6f7e..7f3bb0f7 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_func_role.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_func_role.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_provider_management import util from api_provider_management.models.base_model import Model +from api_provider_management import util class ApiProviderFuncRole(Model): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py index 2646b418..d6989b1a 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from api_provider_management.models.base_model import Model +from api_provider_management.models.api_provider_func_role import ApiProviderFuncRole +from api_provider_management.models.registration_information import RegistrationInformation from api_provider_management import util + from api_provider_management.models.api_provider_func_role import ApiProviderFuncRole # noqa: E501 -from api_provider_management.models.base_model import Model from api_provider_management.models.registration_information import RegistrationInformation # noqa: E501 - class APIProviderFunctionDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/base_model.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/base_model.py index 621b8c7d..4fd1d5c7 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/base_model.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/base_model.py @@ -1,4 +1,5 @@ import pprint + import typing from api_provider_management import util diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/invalid_param.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/invalid_param.py index 6d1bfc15..003aa181 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/invalid_param.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/invalid_param.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_provider_management import util from api_provider_management.models.base_model import Model +from api_provider_management import util class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py index 89e0807f..7b4a267d 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_provider_management import util from api_provider_management.models.base_model import Model -from api_provider_management.models.invalid_param import InvalidParam # noqa: E501 +from api_provider_management.models.invalid_param import InvalidParam +import re +from api_provider_management import util +from api_provider_management.models.invalid_param import InvalidParam # noqa: E501 +import re # noqa: E501 class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -259,6 +262,6 @@ class ProblemDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/registration_information.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/registration_information.py index 5255ef8c..3e4d440c 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/registration_information.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/registration_information.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_provider_management import util from api_provider_management.models.base_model import Model +from api_provider_management import util class RegistrationInformation(Model): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml index 60fd3db1..44e8f63d 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml @@ -4,9 +4,9 @@ info: \ Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights\ \ reserved.\n" title: CAPIF_API_Provider_Management_API - version: 1.2.0-alpha.3 + version: 1.2.0 externalDocs: - description: 3GPP TS 29.222 V18.5.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/api-provider-management/v1" diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/__init__.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/__init__.py index 7be5050e..9853918d 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/__init__.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/__init__.py @@ -1,9 +1,10 @@ import logging import connexion -from api_provider_management.encoder import JSONEncoder from flask_testing import TestCase +from api_provider_management.encoder import JSONEncoder + class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py index 87052d95..2b12ff85 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py @@ -1,8 +1,11 @@ import unittest -from api_provider_management.test import BaseTestCase from flask import json +from api_provider_management.models.api_provider_enrolment_details import APIProviderEnrolmentDetails # noqa: E501 +from api_provider_management.models.problem_details import ProblemDetails # noqa: E501 +from api_provider_management.test import BaseTestCase + class TestDefaultController(BaseTestCase): """DefaultController integration test stubs""" diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py index 6d8533af..463aa435 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py @@ -1,8 +1,12 @@ import unittest -from api_provider_management.test import BaseTestCase from flask import json +from api_provider_management.models.api_provider_enrolment_details import APIProviderEnrolmentDetails # noqa: E501 +from api_provider_management.models.api_provider_enrolment_details_patch import APIProviderEnrolmentDetailsPatch # noqa: E501 +from api_provider_management.models.problem_details import ProblemDetails # noqa: E501 +from api_provider_management.test import BaseTestCase + class TestIndividualAPIProviderEnrolmentDetailsController(BaseTestCase): """IndividualAPIProviderEnrolmentDetailsController integration test stubs""" diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/typing_utils.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/typing_utils.py index d21c4f63..74e3c913 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/typing_utils.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/typing_utils.py @@ -1,6 +1,7 @@ import sys if sys.version_info < (3, 7): + import typing def is_generic(klass): """ Determine whether klass is a generic class """ diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/wsgi copy.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/wsgi copy.py deleted file mode 100644 index 6026b0fa..00000000 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/wsgi copy.py +++ /dev/null @@ -1,4 +0,0 @@ -from app import app - -if __name__ == "__main__": - app.run() -- GitLab From 2ebe25eb8255620ea2977d2a7dafda73f41ff864 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 3 Apr 2025 12:38:51 +0200 Subject: [PATCH 093/157] Auditing API realease V18.6.0 --- .../.openapi-generator/FILES | 1 + .../.openapi-generator/VERSION | 2 +- services/TS29222_CAPIF_Auditing_API/README.md | 2 +- .../logs/controllers/default_controller.py | 1 - .../logs/encoder.py | 2 +- .../logs/models/__init__.py | 11 ++++ .../logs/models/base_model.py | 1 + .../logs/models/interface_description.py | 47 +++++++++++++--- .../logs/models/invalid_param.py | 3 +- .../logs/models/invocation_log.py | 11 ++-- .../logs/models/invocation_logs.py | 11 ++-- .../models/invocation_logs_retrieve_res.py | 14 +++-- .../logs/models/log.py | 8 ++- .../logs/models/o_auth_grant_type.py | 34 ++++++++++++ .../logs/models/operation.py | 3 +- .../logs/models/problem_details.py | 11 ++-- .../logs/models/protocol.py | 3 +- .../logs/models/security_method.py | 3 +- .../logs/openapi/openapi.yaml | 55 +++++++++++++++++-- .../logs/test/__init__.py | 1 + .../logs/test/test_default_controller.py | 7 +++ .../logs/typing_utils.py | 1 + services/TS29222_CAPIF_Auditing_API/setup.py | 3 +- 23 files changed, 197 insertions(+), 38 deletions(-) create mode 100644 services/TS29222_CAPIF_Auditing_API/logs/models/o_auth_grant_type.py diff --git a/services/TS29222_CAPIF_Auditing_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Auditing_API/.openapi-generator/FILES index 684a73b6..bd1da334 100644 --- a/services/TS29222_CAPIF_Auditing_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Auditing_API/.openapi-generator/FILES @@ -19,6 +19,7 @@ logs/models/invocation_log.py logs/models/invocation_logs.py logs/models/invocation_logs_retrieve_res.py logs/models/log.py +logs/models/o_auth_grant_type.py logs/models/operation.py logs/models/problem_details.py logs/models/protocol.py diff --git a/services/TS29222_CAPIF_Auditing_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Auditing_API/.openapi-generator/VERSION index 18bb4182..b23eb275 100644 --- a/services/TS29222_CAPIF_Auditing_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_Auditing_API/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.11.0 diff --git a/services/TS29222_CAPIF_Auditing_API/README.md b/services/TS29222_CAPIF_Auditing_API/README.md index 7f120ad3..17eb857e 100644 --- a/services/TS29222_CAPIF_Auditing_API/README.md +++ b/services/TS29222_CAPIF_Auditing_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m openapi_server +python3 -m logs ``` and open your browser to here: diff --git a/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py b/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py index 87ecabbf..469bff22 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py @@ -46,7 +46,6 @@ def api_invocation_logs_get(aef_id=None, api_invoker_id=None, time_range_start=N :rtype: Union[InvocationLogsRetrieveRes, Tuple[InvocationLogsRetrieveRes, int], Tuple[InvocationLogsRetrieveRes, int, Dict[str, str]] """ - current_app.logger.info("Audit logs") if aef_id is None or api_invoker_id is None: diff --git a/services/TS29222_CAPIF_Auditing_API/logs/encoder.py b/services/TS29222_CAPIF_Auditing_API/logs/encoder.py index a6803052..3c674456 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/encoder.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/encoder.py @@ -16,4 +16,4 @@ class CustomJSONEncoder(JSONEncoder): attr = o.attribute_map[attr] dikt[attr] = value return dikt - return JSONEncoder.default(self, o) + return JSONEncoder.default(self, o) \ No newline at end of file diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/__init__.py b/services/TS29222_CAPIF_Auditing_API/logs/models/__init__.py index d036df69..316dfd92 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/__init__.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/__init__.py @@ -1,2 +1,13 @@ # flake8: noqa # import models into model package +from logs.models.interface_description import InterfaceDescription +from logs.models.invalid_param import InvalidParam +from logs.models.invocation_log import InvocationLog +from logs.models.invocation_logs import InvocationLogs +from logs.models.invocation_logs_retrieve_res import InvocationLogsRetrieveRes +from logs.models.log import Log +from logs.models.o_auth_grant_type import OAuthGrantType +from logs.models.operation import Operation +from logs.models.problem_details import ProblemDetails +from logs.models.protocol import Protocol +from logs.models.security_method import SecurityMethod diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/base_model.py b/services/TS29222_CAPIF_Auditing_API/logs/models/base_model.py index 16381a1d..56493bbf 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/base_model.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/base_model.py @@ -1,4 +1,5 @@ import pprint + import typing from logs import util diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/interface_description.py b/services/TS29222_CAPIF_Auditing_API/logs/models/interface_description.py index f4700962..b2302306 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/interface_description.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/interface_description.py @@ -1,11 +1,16 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from logs import util from logs.models.base_model import Model -from logs.models.security_method import SecurityMethod # noqa: E501 +from logs.models.o_auth_grant_type import OAuthGrantType +from logs.models.security_method import SecurityMethod +import re +from logs import util +from logs.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from logs.models.security_method import SecurityMethod # noqa: E501 +import re # noqa: E501 class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +18,7 @@ class InterfaceDescription(Model): Do not edit the class manually. """ - def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None): # noqa: E501 + def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None, grant_types=None): # noqa: E501 """InterfaceDescription - a model defined in OpenAPI :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 @@ -28,6 +33,8 @@ class InterfaceDescription(Model): :type api_prefix: str :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this InterfaceDescription. # noqa: E501 + :type grant_types: List[OAuthGrantType] """ self.openapi_types = { 'ipv4_addr': str, @@ -35,7 +42,8 @@ class InterfaceDescription(Model): 'fqdn': str, 'port': int, 'api_prefix': str, - 'security_methods': List[SecurityMethod] + 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType] } self.attribute_map = { @@ -44,7 +52,8 @@ class InterfaceDescription(Model): 'fqdn': 'fqdn', 'port': 'port', 'api_prefix': 'apiPrefix', - 'security_methods': 'securityMethods' + 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes' } self._ipv4_addr = ipv4_addr @@ -53,6 +62,7 @@ class InterfaceDescription(Model): self._port = port self._api_prefix = api_prefix self._security_methods = security_methods + self._grant_types = grant_types @classmethod def from_dict(cls, dikt) -> 'InterfaceDescription': @@ -136,7 +146,7 @@ class InterfaceDescription(Model): if fqdn is not None and len(fqdn) < 4: raise ValueError("Invalid value for `fqdn`, length must be greater than or equal to `4`") # noqa: E501 if fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', fqdn): # noqa: E501 - raise ValueError("Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + raise ValueError(r"Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 self._fqdn = fqdn @@ -214,3 +224,26 @@ class InterfaceDescription(Model): raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 self._security_methods = security_methods + + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this InterfaceDescription. + + + :return: The grant_types of this InterfaceDescription. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this InterfaceDescription. + + + :param grant_types: The grant_types of this InterfaceDescription. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/invalid_param.py b/services/TS29222_CAPIF_Auditing_API/logs/models/invalid_param.py index a7c83e71..7da75a55 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/invalid_param.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/invalid_param.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from logs import util from logs.models.base_model import Model +from logs import util class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_log.py b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_log.py index f5d5e0ec..26d42ad5 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_log.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_log.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from logs import util from logs.models.base_model import Model -from logs.models.log import Log # noqa: E501 +from logs.models.log import Log +import re +from logs import util +from logs.models.log import Log # noqa: E501 +import re # noqa: E501 class InvocationLog(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -153,6 +156,6 @@ class InvocationLog(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs.py b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs.py index a4fe7ca4..f1ed39c0 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from logs import util from logs.models.base_model import Model -from logs.models.invocation_log import InvocationLog # noqa: E501 +from logs.models.invocation_log import InvocationLog +import re +from logs import util +from logs.models.invocation_log import InvocationLog # noqa: E501 +import re # noqa: E501 class InvocationLogs(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -91,6 +94,6 @@ class InvocationLogs(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs_retrieve_res.py b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs_retrieve_res.py index b26a62f2..4ebdec7c 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs_retrieve_res.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs_retrieve_res.py @@ -1,12 +1,18 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from logs import util from logs.models.base_model import Model +from logs.models.invocation_log import InvocationLog +from logs.models.invocation_logs import InvocationLogs +from logs.models.log import Log +import re +from logs import util + from logs.models.invocation_log import InvocationLog # noqa: E501 +from logs.models.invocation_logs import InvocationLogs # noqa: E501 from logs.models.log import Log # noqa: E501 - +import re # noqa: E501 class InvocationLogsRetrieveRes(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -159,7 +165,7 @@ class InvocationLogsRetrieveRes(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/log.py b/services/TS29222_CAPIF_Auditing_API/logs/models/log.py index 2fb185c6..ef5604a6 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/log.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/log.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from logs import util from logs.models.base_model import Model +from logs.models.interface_description import InterfaceDescription +from logs.models.operation import Operation +from logs.models.protocol import Protocol +from logs import util + from logs.models.interface_description import InterfaceDescription # noqa: E501 from logs.models.operation import Operation # noqa: E501 from logs.models.protocol import Protocol # noqa: E501 - class Log(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Auditing_API/logs/models/o_auth_grant_type.py new file mode 100644 index 00000000..280b8ef7 --- /dev/null +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/o_auth_grant_type.py @@ -0,0 +1,34 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from logs.models.base_model import Model +from logs import util + + +class OAuthGrantType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """OAuthGrantType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'OAuthGrantType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OAuthGrantType of this OAuthGrantType. # noqa: E501 + :rtype: OAuthGrantType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/operation.py b/services/TS29222_CAPIF_Auditing_API/logs/models/operation.py index d36a4e88..a8efafdc 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/operation.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/operation.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from logs import util from logs.models.base_model import Model +from logs import util class Operation(Model): diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/problem_details.py b/services/TS29222_CAPIF_Auditing_API/logs/models/problem_details.py index beca8ffd..2a77eb97 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/problem_details.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/problem_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from logs import util from logs.models.base_model import Model -from logs.models.invalid_param import InvalidParam # noqa: E501 +from logs.models.invalid_param import InvalidParam +import re +from logs import util +from logs.models.invalid_param import InvalidParam # noqa: E501 +import re # noqa: E501 class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -259,6 +262,6 @@ class ProblemDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/protocol.py b/services/TS29222_CAPIF_Auditing_API/logs/models/protocol.py index db5cdc90..989d9e4c 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/protocol.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/protocol.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from logs import util from logs.models.base_model import Model +from logs import util class Protocol(Model): diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/security_method.py b/services/TS29222_CAPIF_Auditing_API/logs/models/security_method.py index db5311a1..b32bbf5b 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/security_method.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/security_method.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from logs import util from logs.models.base_model import Model +from logs import util class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml b/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml index 7a2cfcd0..298ad8a4 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for auditing. \n© 2023, 3GPP Organizational Partners (ARIB, ATIS,\ + description: "API for auditing. \n© 2024, 3GPP Organizational Partners (ARIB, ATIS,\ \ CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Auditing_API - version: 1.3.0-alpha.2 + version: 1.3.0 externalDocs: - description: 3GPP TS 29.222 V18.1.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/logs/v1" @@ -359,6 +359,9 @@ components: description: Represents the description of an API's interface. example: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -367,7 +370,10 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr nullable: true - oneOf: [] + oneOf: + - required: ["fqdn"] + - required: ["ipv4Addr"] + - required: ["ipv6Addr"] properties: ipv4Addr: description: | @@ -406,6 +412,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array title: InterfaceDescription type: object SecurityMethod: @@ -508,6 +520,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -525,6 +540,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -539,6 +557,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -556,6 +577,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -602,6 +626,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -619,6 +646,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -724,3 +754,20 @@ components: minimum: 0 title: Port type: integer + OAuthGrantType: + anyOf: + - enum: + - CLIENT_CREDENTIALS + - AUTHORIZATION_CODE + - AUTHORIZATION_CODE_WITH_PKCE + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. + type: string + description: "Indicates the supported authorization flow (e.g. client credentials\ + \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ + \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ + \ credentials flow.\n- AUTHORIZATION_CODE: Indicate that the grant type is\ + \ authorization code.\n- AUTHORIZATION_CODE_WITH_PKCE: Indicate that the grant\ + \ type is authorization code with PKCE.\n" + title: OAuthGrantType diff --git a/services/TS29222_CAPIF_Auditing_API/logs/test/__init__.py b/services/TS29222_CAPIF_Auditing_API/logs/test/__init__.py index 9209767d..a3e8ced6 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/test/__init__.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/test/__init__.py @@ -2,6 +2,7 @@ import logging import connexion from flask_testing import TestCase + from logs.encoder import JSONEncoder diff --git a/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py b/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py index 3223c999..edeb6213 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py @@ -1,5 +1,12 @@ import unittest +from flask import json + +from logs.models.interface_description import InterfaceDescription # noqa: E501 +from logs.models.invocation_logs_retrieve_res import InvocationLogsRetrieveRes # noqa: E501 +from logs.models.operation import Operation # noqa: E501 +from logs.models.problem_details import ProblemDetails # noqa: E501 +from logs.models.protocol import Protocol # noqa: E501 from logs.test import BaseTestCase diff --git a/services/TS29222_CAPIF_Auditing_API/logs/typing_utils.py b/services/TS29222_CAPIF_Auditing_API/logs/typing_utils.py index d21c4f63..74e3c913 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/typing_utils.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/typing_utils.py @@ -1,6 +1,7 @@ import sys if sys.version_info < (3, 7): + import typing def is_generic(klass): """ Determine whether klass is a generic class """ diff --git a/services/TS29222_CAPIF_Auditing_API/setup.py b/services/TS29222_CAPIF_Auditing_API/setup.py index c593a412..9e2a513e 100644 --- a/services/TS29222_CAPIF_Auditing_API/setup.py +++ b/services/TS29222_CAPIF_Auditing_API/setup.py @@ -1,3 +1,4 @@ +import sys from setuptools import setup, find_packages NAME = "logs" @@ -30,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['logs=logs.__main__:main']}, long_description="""\ - API for auditing. © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for auditing. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) -- GitLab From 1ebf18690e32939a7cf8cf4e9834f8cc3ebfcb5f Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 3 Apr 2025 13:09:07 +0200 Subject: [PATCH 094/157] Discover API realease V18.7.0 --- .../.openapi-generator/FILES | 3 + .../.openapi-generator/VERSION | 2 +- .../README.md | 2 +- .../controllers/default_controller.py | 7 +- .../service_apis/models/__init__.py | 43 +++++ .../service_apis/models/aef_location.py | 7 +- .../service_apis/models/aef_profile.py | 45 ++++- .../service_apis/models/api_status.py | 3 +- .../service_apis/models/base_model.py | 1 + .../service_apis/models/civic_address.py | 3 +- .../service_apis/models/communication_type.py | 3 +- .../service_apis/models/custom_operation.py | 7 +- .../service_apis/models/data_format.py | 3 +- .../service_apis/models/discovered_apis.py | 48 +++++- .../service_apis/models/ellipsoid_arc.py | 9 +- .../service_apis/models/gad_shape.py | 6 +- .../service_apis/models/geographic_area.py | 22 ++- .../models/geographical_coordinates.py | 3 +- .../models/interface_description.py | 47 ++++- .../service_apis/models/invalid_param.py | 3 +- .../service_apis/models/ip_addr_info.py | 3 +- .../service_apis/models/ip_addr_range.py | 7 +- .../service_apis/models/ipv4_address_range.py | 10 +- .../service_apis/models/ipv6_addr1.py | 3 +- .../service_apis/models/ipv6_address_range.py | 6 +- .../local2d_point_uncertainty_ellipse.py | 11 +- .../local3d_point_uncertainty_ellipsoid.py | 49 +++++- .../service_apis/models/local_origin.py | 74 +++++++- .../service_apis/models/o_auth_grant_type.py | 34 ++++ .../service_apis/models/operation.py | 3 +- .../service_apis/models/point.py | 9 +- .../service_apis/models/point_altitude.py | 9 +- .../models/point_altitude_uncertainty.py | 10 +- .../models/point_uncertainty_circle.py | 9 +- .../models/point_uncertainty_ellipse.py | 10 +- .../service_apis/models/polygon.py | 9 +- .../service_apis/models/problem_details.py | 11 +- .../service_apis/models/protocol.py | 3 +- .../service_apis/models/published_api_path.py | 3 +- .../models/relative_cartesian_location.py | 3 +- .../service_apis/models/resource.py | 8 +- .../service_apis/models/security_method.py | 3 +- .../models/service_api_description.py | 16 +- .../service_apis/models/service_kpis.py | 14 +- .../models/shareable_information.py | 3 +- .../models/supported_gad_shapes.py | 3 +- .../models/uncertainty_ellipse.py | 3 +- .../models/uncertainty_ellipsoid.py | 3 +- .../service_apis/models/version.py | 7 +- .../service_apis/openapi/openapi.yaml | 162 ++++++++++++++++-- .../service_apis/test/__init__.py | 1 + .../test/test_default_controller.py | 14 +- .../service_apis/typing_utils.py | 1 + .../setup.py | 3 +- .../test-requirements.txt | 2 +- 55 files changed, 671 insertions(+), 115 deletions(-) create mode 100644 services/TS29222_CAPIF_Discover_Service_API/service_apis/models/o_auth_grant_type.py diff --git a/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/FILES index a2f706dd..58bf0487 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/FILES @@ -1,5 +1,6 @@ .dockerignore .gitignore +.openapi-generator-ignore .travis.yml Dockerfile README.md @@ -34,6 +35,7 @@ service_apis/models/ipv6_address_range.py service_apis/models/local2d_point_uncertainty_ellipse.py service_apis/models/local3d_point_uncertainty_ellipsoid.py service_apis/models/local_origin.py +service_apis/models/o_auth_grant_type.py service_apis/models/operation.py service_apis/models/point.py service_apis/models/point_altitude.py @@ -56,6 +58,7 @@ service_apis/models/uncertainty_ellipsoid.py service_apis/models/version.py service_apis/openapi/openapi.yaml service_apis/test/__init__.py +service_apis/test/test_default_controller.py service_apis/typing_utils.py service_apis/util.py requirements.txt diff --git a/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/VERSION index 18bb4182..b23eb275 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.11.0 diff --git a/services/TS29222_CAPIF_Discover_Service_API/README.md b/services/TS29222_CAPIF_Discover_Service_API/README.md index d27fa9b3..f522a7de 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/README.md +++ b/services/TS29222_CAPIF_Discover_Service_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m openapi_server +python3 -m service_apis ``` and open your browser to here: diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py index fbe0640a..694d6f4a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py @@ -1,5 +1,3 @@ -from service_apis.models.discovered_apis import DiscoveredAPIs # noqa: E501 - import json from flask import request, current_app @@ -10,7 +8,7 @@ from ..core.discoveredapis import DiscoverApisOperations, return_negotiated_supp discover_apis = DiscoverApisOperations() -def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_type=None, protocol=None, aef_id=None, data_format=None, api_cat=None, preferred_aef_loc=None, req_api_prov_name=None, supported_features=None, api_supported_features=None, ue_ip_addr=None, service_kpis=None): # noqa: E501 +def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_type=None, protocol=None, aef_id=None, data_format=None, api_cat=None, preferred_aef_loc=None, req_api_prov_name=None, supported_features=None, api_supported_features=None, ue_ip_addr=None, service_kpis=None, grant_types=None): # noqa: E501 """all_service_apis_get Discover published service APIs and retrieve a collection of APIs according to certain filter criteria. # noqa: E501 @@ -43,10 +41,11 @@ def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_t :type ue_ip_addr: dict | bytes :param service_kpis: Contains iInformation about service characteristics provided by the targeted service API(s). :type service_kpis: dict | bytes + :param grant_types: Contains the OAuth grant types that need to be supported. + :type grant_types: list | bytes :rtype: Union[DiscoveredAPIs, Tuple[DiscoveredAPIs, int], Tuple[DiscoveredAPIs, int, Dict[str, str]] """ - current_app.logger.info("Discovering service apis") query_params = {"api_name": api_name, "api_version": api_version, "comm_type": comm_type, diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/__init__.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/__init__.py index d036df69..8451433a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/__init__.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/__init__.py @@ -1,2 +1,45 @@ # flake8: noqa # import models into model package +from service_apis.models.aef_location import AefLocation +from service_apis.models.aef_profile import AefProfile +from service_apis.models.api_status import ApiStatus +from service_apis.models.civic_address import CivicAddress +from service_apis.models.communication_type import CommunicationType +from service_apis.models.custom_operation import CustomOperation +from service_apis.models.data_format import DataFormat +from service_apis.models.discovered_apis import DiscoveredAPIs +from service_apis.models.ellipsoid_arc import EllipsoidArc +from service_apis.models.gad_shape import GADShape +from service_apis.models.geographic_area import GeographicArea +from service_apis.models.geographical_coordinates import GeographicalCoordinates +from service_apis.models.interface_description import InterfaceDescription +from service_apis.models.invalid_param import InvalidParam +from service_apis.models.ip_addr_info import IpAddrInfo +from service_apis.models.ip_addr_range import IpAddrRange +from service_apis.models.ipv4_address_range import Ipv4AddressRange +from service_apis.models.ipv6_addr1 import Ipv6Addr1 +from service_apis.models.ipv6_address_range import Ipv6AddressRange +from service_apis.models.local2d_point_uncertainty_ellipse import Local2dPointUncertaintyEllipse +from service_apis.models.local3d_point_uncertainty_ellipsoid import Local3dPointUncertaintyEllipsoid +from service_apis.models.local_origin import LocalOrigin +from service_apis.models.o_auth_grant_type import OAuthGrantType +from service_apis.models.operation import Operation +from service_apis.models.point import Point +from service_apis.models.point_altitude import PointAltitude +from service_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty +from service_apis.models.point_uncertainty_circle import PointUncertaintyCircle +from service_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse +from service_apis.models.polygon import Polygon +from service_apis.models.problem_details import ProblemDetails +from service_apis.models.protocol import Protocol +from service_apis.models.published_api_path import PublishedApiPath +from service_apis.models.relative_cartesian_location import RelativeCartesianLocation +from service_apis.models.resource import Resource +from service_apis.models.security_method import SecurityMethod +from service_apis.models.service_api_description import ServiceAPIDescription +from service_apis.models.service_kpis import ServiceKpis +from service_apis.models.shareable_information import ShareableInformation +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis.models.uncertainty_ellipse import UncertaintyEllipse +from service_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid +from service_apis.models.version import Version diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_location.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_location.py index 1174800e..25fe56a3 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_location.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_location.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.civic_address import CivicAddress +from service_apis.models.geographic_area import GeographicArea +from service_apis import util + from service_apis.models.civic_address import CivicAddress # noqa: E501 from service_apis.models.geographic_area import GeographicArea # noqa: E501 - class AefLocation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py index 4c1ce31d..78ff868a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py @@ -1,25 +1,36 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from service_apis.models.base_model import Model +from service_apis.models.aef_location import AefLocation +from service_apis.models.data_format import DataFormat +from service_apis.models.interface_description import InterfaceDescription +from service_apis.models.ip_addr_range import IpAddrRange +from service_apis.models.o_auth_grant_type import OAuthGrantType +from service_apis.models.protocol import Protocol +from service_apis.models.security_method import SecurityMethod +from service_apis.models.service_kpis import ServiceKpis +from service_apis.models.version import Version from service_apis import util + from service_apis.models.aef_location import AefLocation # noqa: E501 -from service_apis.models.base_model import Model from service_apis.models.data_format import DataFormat # noqa: E501 from service_apis.models.interface_description import InterfaceDescription # noqa: E501 from service_apis.models.ip_addr_range import IpAddrRange # noqa: E501 +from service_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from service_apis.models.protocol import Protocol # noqa: E501 from service_apis.models.security_method import SecurityMethod # noqa: E501 from service_apis.models.service_kpis import ServiceKpis # noqa: E501 from service_apis.models.version import Version # noqa: E501 - class AefProfile(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ - def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 + def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, grant_types=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 """AefProfile - a model defined in OpenAPI :param aef_id: The aef_id of this AefProfile. # noqa: E501 @@ -32,6 +43,8 @@ class AefProfile(Model): :type data_format: DataFormat :param security_methods: The security_methods of this AefProfile. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this AefProfile. # noqa: E501 + :type grant_types: List[OAuthGrantType] :param domain_name: The domain_name of this AefProfile. # noqa: E501 :type domain_name: str :param interface_descriptions: The interface_descriptions of this AefProfile. # noqa: E501 @@ -49,6 +62,7 @@ class AefProfile(Model): 'protocol': Protocol, 'data_format': DataFormat, 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType], 'domain_name': str, 'interface_descriptions': List[InterfaceDescription], 'aef_location': AefLocation, @@ -62,6 +76,7 @@ class AefProfile(Model): 'protocol': 'protocol', 'data_format': 'dataFormat', 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes', 'domain_name': 'domainName', 'interface_descriptions': 'interfaceDescriptions', 'aef_location': 'aefLocation', @@ -74,6 +89,7 @@ class AefProfile(Model): self._protocol = protocol self._data_format = data_format self._security_methods = security_methods + self._grant_types = grant_types self._domain_name = domain_name self._interface_descriptions = interface_descriptions self._aef_location = aef_location @@ -210,6 +226,29 @@ class AefProfile(Model): self._security_methods = security_methods + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this AefProfile. + + + :return: The grant_types of this AefProfile. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this AefProfile. + + + :param grant_types: The grant_types of this AefProfile. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types + @property def domain_name(self) -> str: """Gets the domain_name of this AefProfile. diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py index 2cb1a216..81815062 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class ApiStatus(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/base_model.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/base_model.py index a083ea94..7951efc4 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/base_model.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/base_model.py @@ -1,4 +1,5 @@ import pprint + import typing from service_apis import util diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/civic_address.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/civic_address.py index 5e8fb961..67c1a70f 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/civic_address.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/civic_address.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class CivicAddress(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/communication_type.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/communication_type.py index e6b697a1..04b99a70 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/communication_type.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/communication_type.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class CommunicationType(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py index 7c93f551..b98c3dc9 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.communication_type import CommunicationType +from service_apis.models.operation import Operation +from service_apis import util + from service_apis.models.communication_type import CommunicationType # noqa: E501 from service_apis.models.operation import Operation # noqa: E501 - class CustomOperation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/data_format.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/data_format.py index 9cbf6ff5..875a9539 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/data_format.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/data_format.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class DataFormat(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py index 1d943904..36a7889a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py @@ -1,10 +1,14 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.service_api_description import ServiceAPIDescription # noqa: E501 +from service_apis.models.service_api_description import ServiceAPIDescription +import re +from service_apis import util +from service_apis.models.service_api_description import ServiceAPIDescription # noqa: E501 +import re # noqa: E501 class DiscoveredAPIs(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,21 +16,26 @@ class DiscoveredAPIs(Model): Do not edit the class manually. """ - def __init__(self, service_api_descriptions=None): # noqa: E501 + def __init__(self, service_api_descriptions=None, supp_feat=None): # noqa: E501 """DiscoveredAPIs - a model defined in OpenAPI :param service_api_descriptions: The service_api_descriptions of this DiscoveredAPIs. # noqa: E501 :type service_api_descriptions: List[ServiceAPIDescription] + :param supp_feat: The supp_feat of this DiscoveredAPIs. # noqa: E501 + :type supp_feat: str """ self.openapi_types = { - 'service_api_descriptions': List[ServiceAPIDescription] + 'service_api_descriptions': List[ServiceAPIDescription], + 'supp_feat': str } self.attribute_map = { - 'service_api_descriptions': 'serviceAPIDescriptions' + 'service_api_descriptions': 'serviceAPIDescriptions', + 'supp_feat': 'suppFeat' } self._service_api_descriptions = service_api_descriptions + self._supp_feat = supp_feat @classmethod def from_dict(cls, dikt) -> 'DiscoveredAPIs': @@ -43,7 +52,7 @@ class DiscoveredAPIs(Model): def service_api_descriptions(self) -> List[ServiceAPIDescription]: """Gets the service_api_descriptions of this DiscoveredAPIs. - Description of the service API as published by the service. Each service API description shall include AEF profiles matching the filter criteria. # noqa: E501 + Description of the service API as published by the service. Each service API information shall include AEF profiles matching the filter criteria. # noqa: E501 :return: The service_api_descriptions of this DiscoveredAPIs. :rtype: List[ServiceAPIDescription] @@ -54,7 +63,7 @@ class DiscoveredAPIs(Model): def service_api_descriptions(self, service_api_descriptions: List[ServiceAPIDescription]): """Sets the service_api_descriptions of this DiscoveredAPIs. - Description of the service API as published by the service. Each service API description shall include AEF profiles matching the filter criteria. # noqa: E501 + Description of the service API as published by the service. Each service API information shall include AEF profiles matching the filter criteria. # noqa: E501 :param service_api_descriptions: The service_api_descriptions of this DiscoveredAPIs. :type service_api_descriptions: List[ServiceAPIDescription] @@ -63,3 +72,28 @@ class DiscoveredAPIs(Model): raise ValueError("Invalid value for `service_api_descriptions`, number of items must be greater than or equal to `1`") # noqa: E501 self._service_api_descriptions = service_api_descriptions + + @property + def supp_feat(self) -> str: + """Gets the supp_feat of this DiscoveredAPIs. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :return: The supp_feat of this DiscoveredAPIs. + :rtype: str + """ + return self._supp_feat + + @supp_feat.setter + def supp_feat(self, supp_feat: str): + """Sets the supp_feat of this DiscoveredAPIs. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :param supp_feat: The supp_feat of this DiscoveredAPIs. + :type supp_feat: str + """ + if supp_feat is not None and not re.search(r'^[A-Fa-f0-9]*$', supp_feat): # noqa: E501 + raise ValueError(r"Invalid value for `supp_feat`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._supp_feat = supp_feat diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py index 98745d95..9f6206bc 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.gad_shape import GADShape +from service_apis.models.geographical_coordinates import GeographicalCoordinates +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis import util + +from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class EllipsoidArc(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py index 7e4f7c4a..21e0ee19 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis import util +from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 class GADShape(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py index bc7034d3..dafc9960 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py @@ -1,13 +1,31 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.ellipsoid_arc import EllipsoidArc +from service_apis.models.geographical_coordinates import GeographicalCoordinates +from service_apis.models.point import Point +from service_apis.models.point_altitude import PointAltitude +from service_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty +from service_apis.models.point_uncertainty_circle import PointUncertaintyCircle +from service_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse +from service_apis.models.polygon import Polygon +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis.models.uncertainty_ellipse import UncertaintyEllipse +from service_apis import util + +from service_apis.models.ellipsoid_arc import EllipsoidArc # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from service_apis.models.point import Point # noqa: E501 +from service_apis.models.point_altitude import PointAltitude # noqa: E501 +from service_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty # noqa: E501 +from service_apis.models.point_uncertainty_circle import PointUncertaintyCircle # noqa: E501 +from service_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse # noqa: E501 +from service_apis.models.polygon import Polygon # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class GeographicArea(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographical_coordinates.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographical_coordinates.py index c07d138f..4eae80d3 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographical_coordinates.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographical_coordinates.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class GeographicalCoordinates(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/interface_description.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/interface_description.py index 74bf6544..da6cd574 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/interface_description.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/interface_description.py @@ -1,11 +1,16 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.security_method import SecurityMethod # noqa: E501 +from service_apis.models.o_auth_grant_type import OAuthGrantType +from service_apis.models.security_method import SecurityMethod +import re +from service_apis import util +from service_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from service_apis.models.security_method import SecurityMethod # noqa: E501 +import re # noqa: E501 class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +18,7 @@ class InterfaceDescription(Model): Do not edit the class manually. """ - def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None): # noqa: E501 + def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None, grant_types=None): # noqa: E501 """InterfaceDescription - a model defined in OpenAPI :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 @@ -28,6 +33,8 @@ class InterfaceDescription(Model): :type api_prefix: str :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this InterfaceDescription. # noqa: E501 + :type grant_types: List[OAuthGrantType] """ self.openapi_types = { 'ipv4_addr': str, @@ -35,7 +42,8 @@ class InterfaceDescription(Model): 'fqdn': str, 'port': int, 'api_prefix': str, - 'security_methods': List[SecurityMethod] + 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType] } self.attribute_map = { @@ -44,7 +52,8 @@ class InterfaceDescription(Model): 'fqdn': 'fqdn', 'port': 'port', 'api_prefix': 'apiPrefix', - 'security_methods': 'securityMethods' + 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes' } self._ipv4_addr = ipv4_addr @@ -53,6 +62,7 @@ class InterfaceDescription(Model): self._port = port self._api_prefix = api_prefix self._security_methods = security_methods + self._grant_types = grant_types @classmethod def from_dict(cls, dikt) -> 'InterfaceDescription': @@ -136,7 +146,7 @@ class InterfaceDescription(Model): if fqdn is not None and len(fqdn) < 4: raise ValueError("Invalid value for `fqdn`, length must be greater than or equal to `4`") # noqa: E501 if fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', fqdn): # noqa: E501 - raise ValueError("Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + raise ValueError(r"Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 self._fqdn = fqdn @@ -214,3 +224,26 @@ class InterfaceDescription(Model): raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 self._security_methods = security_methods + + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this InterfaceDescription. + + + :return: The grant_types of this InterfaceDescription. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this InterfaceDescription. + + + :param grant_types: The grant_types of this InterfaceDescription. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/invalid_param.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/invalid_param.py index 75965c05..67c79e30 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/invalid_param.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/invalid_param.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_info.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_info.py index 3f40627b..3cb739c6 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_info.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_info.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class IpAddrInfo(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py index 7d19e339..4b86f968 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.ipv4_address_range import Ipv4AddressRange +from service_apis.models.ipv6_address_range import Ipv6AddressRange +from service_apis import util + from service_apis.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 from service_apis.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 - class IpAddrRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv4_address_range.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv4_address_range.py index a7e40ff6..9d500949 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv4_address_range.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv4_address_range.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +import re +from service_apis import util +import re # noqa: E501 class Ipv4AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -67,7 +69,7 @@ class Ipv4AddressRange(Model): if start is None: raise ValueError("Invalid value for `start`, must not be `None`") # noqa: E501 if start is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', start): # noqa: E501 - raise ValueError("Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._start = start @@ -94,6 +96,6 @@ class Ipv4AddressRange(Model): if end is None: raise ValueError("Invalid value for `end`, must not be `None`") # noqa: E501 if end is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', end): # noqa: E501 - raise ValueError("Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._end = end diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_addr1.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_addr1.py index b7af560a..d8164b5f 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_addr1.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_addr1.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class Ipv6Addr1(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_address_range.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_address_range.py index 841f7dad..e9fc81ec 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_address_range.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_address_range.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 +from service_apis.models.ipv6_addr1 import Ipv6Addr1 +from service_apis import util +from service_apis.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 class Ipv6AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py index 1d99c36b..23464399 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py @@ -1,14 +1,21 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.gad_shape import GADShape +from service_apis.models.local_origin import LocalOrigin +from service_apis.models.relative_cartesian_location import RelativeCartesianLocation +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis.models.uncertainty_ellipse import UncertaintyEllipse +from service_apis import util + +from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.local_origin import LocalOrigin # noqa: E501 from service_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class Local2dPointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py index 4ab20c6b..4d9cb7bb 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py @@ -1,21 +1,28 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.gad_shape import GADShape +from service_apis.models.local_origin import LocalOrigin +from service_apis.models.relative_cartesian_location import RelativeCartesianLocation +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid +from service_apis import util + +from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.local_origin import LocalOrigin # noqa: E501 from service_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from service_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 - class Local3dPointUncertaintyEllipsoid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ - def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None): # noqa: E501 + def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None, v_confidence=None): # noqa: E501 """Local3dPointUncertaintyEllipsoid - a model defined in OpenAPI :param shape: The shape of this Local3dPointUncertaintyEllipsoid. # noqa: E501 @@ -28,13 +35,16 @@ class Local3dPointUncertaintyEllipsoid(Model): :type uncertainty_ellipsoid: UncertaintyEllipsoid :param confidence: The confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 :type confidence: int + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type v_confidence: int """ self.openapi_types = { 'shape': SupportedGADShapes, 'local_origin': LocalOrigin, 'point': RelativeCartesianLocation, 'uncertainty_ellipsoid': UncertaintyEllipsoid, - 'confidence': int + 'confidence': int, + 'v_confidence': int } self.attribute_map = { @@ -42,7 +52,8 @@ class Local3dPointUncertaintyEllipsoid(Model): 'local_origin': 'localOrigin', 'point': 'point', 'uncertainty_ellipsoid': 'uncertaintyEllipsoid', - 'confidence': 'confidence' + 'confidence': 'confidence', + 'v_confidence': 'vConfidence' } self._shape = shape @@ -50,6 +61,7 @@ class Local3dPointUncertaintyEllipsoid(Model): self._point = point self._uncertainty_ellipsoid = uncertainty_ellipsoid self._confidence = confidence + self._v_confidence = v_confidence @classmethod def from_dict(cls, dikt) -> 'Local3dPointUncertaintyEllipsoid': @@ -182,3 +194,30 @@ class Local3dPointUncertaintyEllipsoid(Model): raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 self._confidence = confidence + + @property + def v_confidence(self) -> int: + """Gets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :return: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :rtype: int + """ + return self._v_confidence + + @v_confidence.setter + def v_confidence(self, v_confidence: int): + """Sets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :type v_confidence: int + """ + if v_confidence is not None and v_confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value less than or equal to `100`") # noqa: E501 + if v_confidence is not None and v_confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._v_confidence = v_confidence diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py index f7e3fc58..bf20a6d3 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py @@ -1,10 +1,14 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from service_apis.models.geographic_area import GeographicArea +from service_apis.models.geographical_coordinates import GeographicalCoordinates +from service_apis import util +from service_apis.models.geographic_area import GeographicArea # noqa: E501 +from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 class LocalOrigin(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,26 +16,36 @@ class LocalOrigin(Model): Do not edit the class manually. """ - def __init__(self, coordinate_id=None, point=None): # noqa: E501 + def __init__(self, coordinate_id=None, point=None, area=None, horiz_axes_orientation=None): # noqa: E501 """LocalOrigin - a model defined in OpenAPI :param coordinate_id: The coordinate_id of this LocalOrigin. # noqa: E501 :type coordinate_id: str :param point: The point of this LocalOrigin. # noqa: E501 :type point: GeographicalCoordinates + :param area: The area of this LocalOrigin. # noqa: E501 + :type area: GeographicArea + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. # noqa: E501 + :type horiz_axes_orientation: int """ self.openapi_types = { 'coordinate_id': str, - 'point': GeographicalCoordinates + 'point': GeographicalCoordinates, + 'area': GeographicArea, + 'horiz_axes_orientation': int } self.attribute_map = { 'coordinate_id': 'coordinateId', - 'point': 'point' + 'point': 'point', + 'area': 'area', + 'horiz_axes_orientation': 'horizAxesOrientation' } self._coordinate_id = coordinate_id self._point = point + self._area = area + self._horiz_axes_orientation = horiz_axes_orientation @classmethod def from_dict(cls, dikt) -> 'LocalOrigin': @@ -62,6 +76,8 @@ class LocalOrigin(Model): :param coordinate_id: The coordinate_id of this LocalOrigin. :type coordinate_id: str """ + if coordinate_id is None: + raise ValueError("Invalid value for `coordinate_id`, must not be `None`") # noqa: E501 self._coordinate_id = coordinate_id @@ -85,3 +101,51 @@ class LocalOrigin(Model): """ self._point = point + + @property + def area(self) -> GeographicArea: + """Gets the area of this LocalOrigin. + + + :return: The area of this LocalOrigin. + :rtype: GeographicArea + """ + return self._area + + @area.setter + def area(self, area: GeographicArea): + """Sets the area of this LocalOrigin. + + + :param area: The area of this LocalOrigin. + :type area: GeographicArea + """ + + self._area = area + + @property + def horiz_axes_orientation(self) -> int: + """Gets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :return: The horiz_axes_orientation of this LocalOrigin. + :rtype: int + """ + return self._horiz_axes_orientation + + @horiz_axes_orientation.setter + def horiz_axes_orientation(self, horiz_axes_orientation: int): + """Sets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. + :type horiz_axes_orientation: int + """ + if horiz_axes_orientation is not None and horiz_axes_orientation > 3600: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value less than or equal to `3600`") # noqa: E501 + if horiz_axes_orientation is not None and horiz_axes_orientation < 0: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value greater than or equal to `0`") # noqa: E501 + + self._horiz_axes_orientation = horiz_axes_orientation diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/o_auth_grant_type.py new file mode 100644 index 00000000..fc93ba2e --- /dev/null +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/o_auth_grant_type.py @@ -0,0 +1,34 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from service_apis.models.base_model import Model +from service_apis import util + + +class OAuthGrantType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """OAuthGrantType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'OAuthGrantType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OAuthGrantType of this OAuthGrantType. # noqa: E501 + :rtype: OAuthGrantType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/operation.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/operation.py index db7461ed..6e0b387e 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/operation.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/operation.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class Operation(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py index 4dd203f4..a258d339 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.gad_shape import GADShape +from service_apis.models.geographical_coordinates import GeographicalCoordinates +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis import util + +from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class Point(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py index c692296e..3245960e 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.gad_shape import GADShape +from service_apis.models.geographical_coordinates import GeographicalCoordinates +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis import util + +from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class PointAltitude(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py index 8cb287ae..aadbd510 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py @@ -1,13 +1,19 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.gad_shape import GADShape +from service_apis.models.geographical_coordinates import GeographicalCoordinates +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis.models.uncertainty_ellipse import UncertaintyEllipse +from service_apis import util + +from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class PointAltitudeUncertainty(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py index aa0d9101..271b19bf 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.gad_shape import GADShape +from service_apis.models.geographical_coordinates import GeographicalCoordinates +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis import util + +from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class PointUncertaintyCircle(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py index 498296e3..7e7499cf 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py @@ -1,13 +1,19 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.gad_shape import GADShape +from service_apis.models.geographical_coordinates import GeographicalCoordinates +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis.models.uncertainty_ellipse import UncertaintyEllipse +from service_apis import util + +from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class PointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py index e8c152b2..421b7c36 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.gad_shape import GADShape +from service_apis.models.geographical_coordinates import GeographicalCoordinates +from service_apis.models.supported_gad_shapes import SupportedGADShapes +from service_apis import util + +from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class Polygon(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/problem_details.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/problem_details.py index 371d6452..f1e1241d 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/problem_details.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/problem_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.invalid_param import InvalidParam # noqa: E501 +from service_apis.models.invalid_param import InvalidParam +import re +from service_apis import util +from service_apis.models.invalid_param import InvalidParam # noqa: E501 +import re # noqa: E501 class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -259,6 +262,6 @@ class ProblemDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/protocol.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/protocol.py index bd8783f2..6cc058a0 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/protocol.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/protocol.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class Protocol(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/published_api_path.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/published_api_path.py index 5135c5a7..a8210648 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/published_api_path.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/published_api_path.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class PublishedApiPath(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/relative_cartesian_location.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/relative_cartesian_location.py index b40cde6b..ee5b860a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/relative_cartesian_location.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/relative_cartesian_location.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class RelativeCartesianLocation(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py index 6e0a6c35..f530875d 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.communication_type import CommunicationType +from service_apis.models.custom_operation import CustomOperation +from service_apis.models.operation import Operation +from service_apis import util + from service_apis.models.communication_type import CommunicationType # noqa: E501 from service_apis.models.custom_operation import CustomOperation # noqa: E501 from service_apis.models.operation import Operation # noqa: E501 - class Resource(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/security_method.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/security_method.py index 62ebc962..3215ddaa 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/security_method.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/security_method.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py index 339b35c6..743c1081 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py @@ -1,14 +1,20 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from service_apis.models.base_model import Model +from service_apis.models.aef_profile import AefProfile +from service_apis.models.api_status import ApiStatus +from service_apis.models.published_api_path import PublishedApiPath +from service_apis.models.shareable_information import ShareableInformation +import re from service_apis import util + from service_apis.models.aef_profile import AefProfile # noqa: E501 from service_apis.models.api_status import ApiStatus # noqa: E501 -from service_apis.models.base_model import Model from service_apis.models.published_api_path import PublishedApiPath # noqa: E501 from service_apis.models.shareable_information import ShareableInformation # noqa: E501 - +import re # noqa: E501 class ServiceAPIDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -236,7 +242,7 @@ class ServiceAPIDescription(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features @@ -305,7 +311,7 @@ class ServiceAPIDescription(Model): :type api_supp_feats: str """ if api_supp_feats is not None and not re.search(r'^[A-Fa-f0-9]*$', api_supp_feats): # noqa: E501 - raise ValueError("Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._api_supp_feats = api_supp_feats diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_kpis.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_kpis.py index b8024ec9..de72ad5b 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_kpis.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_kpis.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +import re +from service_apis import util +import re # noqa: E501 class ServiceKpis(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -170,7 +172,7 @@ class ServiceKpis(Model): :type aval_comp: str """ if aval_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_comp): # noqa: E501 - raise ValueError("Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 self._aval_comp = aval_comp @@ -195,7 +197,7 @@ class ServiceKpis(Model): :type aval_gra_comp: str """ if aval_gra_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_gra_comp): # noqa: E501 - raise ValueError("Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 self._aval_gra_comp = aval_gra_comp @@ -220,7 +222,7 @@ class ServiceKpis(Model): :type aval_mem: str """ if aval_mem is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_mem): # noqa: E501 - raise ValueError("Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 self._aval_mem = aval_mem @@ -245,7 +247,7 @@ class ServiceKpis(Model): :type aval_stor: str """ if aval_stor is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_stor): # noqa: E501 - raise ValueError("Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 self._aval_stor = aval_stor diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py index 6970e3da..8d21330b 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class ShareableInformation(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/supported_gad_shapes.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/supported_gad_shapes.py index 2f2a6aea..0f035470 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/supported_gad_shapes.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/supported_gad_shapes.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class SupportedGADShapes(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipse.py index 0250ace1..03672693 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipse.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class UncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipsoid.py index 07792596..6e598a1a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipsoid.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis import util class UncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/version.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/version.py index 3e4f6efa..e0a21cc0 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/version.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/version.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from service_apis import util from service_apis.models.base_model import Model +from service_apis.models.custom_operation import CustomOperation +from service_apis.models.resource import Resource +from service_apis import util + from service_apis.models.custom_operation import CustomOperation # noqa: E501 from service_apis.models.resource import Resource # noqa: E501 - class Version(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml b/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml index c0c26088..68dd3e4e 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for discovering service APIs. \n© 2023, 3GPP Organizational Partners\ + description: "API for discovering service APIs. \n© 2024, 3GPP Organizational Partners\ \ (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Discover_Service_API - version: 1.3.0-alpha.2 + version: 1.3.1 externalDocs: - description: 3GPP TS 29.222 V18.4.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V18.7.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/service-apis/v1" @@ -138,6 +138,17 @@ paths: schema: $ref: '#/components/schemas/ServiceKpis' style: form + - content: + application/json: + schema: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + type: array + description: Contains the OAuth grant types that need to be supported. + in: query + name: grant-types + required: false responses: "200": content: @@ -318,6 +329,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -496,6 +510,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -504,6 +521,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -521,6 +541,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -699,6 +722,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -707,6 +733,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -746,6 +775,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -924,6 +956,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -932,6 +967,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -949,6 +987,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1127,6 +1168,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1135,6 +1179,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1155,21 +1202,30 @@ components: ccfIds: - ccfIds - ccfIds + suppFeat: suppFeat properties: serviceAPIDescriptions: description: | - Description of the service API as published by the service. Each service API description shall include AEF profiles matching the filter criteria. + Description of the service API as published by the service. Each service API information shall include AEF profiles matching the filter criteria. items: $ref: '#/components/schemas/ServiceAPIDescription' minItems: 1 title: serviceAPIDescriptions type: array + suppFeat: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string title: DiscoveredAPIs type: object IpAddrInfo: description: Represents the UE IP address information. nullable: true - oneOf: [] + oneOf: + - required: ["ipv4Addr"] + - required: ["ipv6Addr"] properties: ipv4Addr: description: | @@ -1356,6 +1412,23 @@ components: type: integer title: ServiceKpis type: object + OAuthGrantType: + anyOf: + - enum: + - CLIENT_CREDENTIALS + - AUTHORIZATION_CODE + - AUTHORIZATION_CODE_WITH_PKCE + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. + type: string + description: "Indicates the supported authorization flow (e.g. client credentials\ + \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ + \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ + \ credentials flow.\n- AUTHORIZATION_CODE: Indicate that the grant type is\ + \ authorization code.\n- AUTHORIZATION_CODE_WITH_PKCE: Indicate that the grant\ + \ type is authorization code with PKCE.\n" + title: OAuthGrantType ProblemDetails: description: Represents additional information and details on an error response. properties: @@ -1446,6 +1519,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1624,6 +1700,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1632,6 +1711,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1649,6 +1731,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1827,6 +1912,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1835,6 +1923,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1935,6 +2026,9 @@ components: description: Represents the AEF profile data. example: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -2113,6 +2207,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2121,6 +2218,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2138,7 +2238,10 @@ components: maxReqRate: 0 avalGraComp: avalGraComp nullable: true - oneOf: [] + oneOf: + - required: ["domainName"] + - required: ["interfaceDescriptions"] + - {} properties: aefId: description: Identifier of the API exposing function @@ -2162,6 +2265,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array domainName: description: Domain to which API belongs to title: domainName @@ -2409,6 +2518,9 @@ components: description: Represents the description of an API's interface. example: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2417,7 +2529,10 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr nullable: true - oneOf: [] + oneOf: + - required: ["fqdn"] + - required: ["ipv4Addr"] + - required: ["ipv6Addr"] properties: ipv4Addr: description: | @@ -2456,10 +2571,18 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array title: InterfaceDescription type: object IpAddrRange: - anyOf: [] + anyOf: + - required: ["ueIpv4AddrRanges"] + - required: ["ueIpv6AddrRanges"] description: Represents the list of public IP ranges example: ueIpv4AddrRanges: @@ -2978,8 +3101,26 @@ components: type: string point: $ref: '#/components/schemas/GeographicalCoordinates' + area: + $ref: '#/components/schemas/GeographicArea' + horizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in + 0.1 degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer + required: + - coordinateId title: LocalOrigin type: object + HorizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in 0.1 + degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer RelativeCartesianLocation: description: Relative Cartesian Location properties: @@ -3015,6 +3156,8 @@ components: $ref: '#/components/schemas/UncertaintyEllipsoid' confidence: $ref: '#/components/schemas/Confidence' + vConfidence: + $ref: '#/components/schemas/Confidence' required: - confidence - localOrigin @@ -3133,9 +3276,6 @@ components: title: Ipv6AddressRange type: object Ipv6Addr_1: - allOf: - - pattern: "^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$" - - pattern: "^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$" description: | String identifying an IPv6 address formatted according to clause 4 of RFC5952. The mixed IPv4 IPv6 notation according to clause 5 of RFC5952 shall not be used. example: 2001:db8:85a3::8a2e:370:7334 diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/__init__.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/__init__.py index 8b9b70a8..b0510f7c 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/__init__.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/__init__.py @@ -2,6 +2,7 @@ import logging import connexion from flask_testing import TestCase + from service_apis.encoder import JSONEncoder diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py index 3d4afdbc..39959238 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py @@ -1,5 +1,16 @@ import unittest +from flask import json + +from service_apis.models.aef_location import AefLocation # noqa: E501 +from service_apis.models.communication_type import CommunicationType # noqa: E501 +from service_apis.models.data_format import DataFormat # noqa: E501 +from service_apis.models.discovered_apis import DiscoveredAPIs # noqa: E501 +from service_apis.models.ip_addr_info import IpAddrInfo # noqa: E501 +from service_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from service_apis.models.problem_details import ProblemDetails # noqa: E501 +from service_apis.models.protocol import Protocol # noqa: E501 +from service_apis.models.service_kpis import ServiceKpis # noqa: E501 from service_apis.test import BaseTestCase @@ -24,7 +35,8 @@ class TestDefaultController(BaseTestCase): ('supported-features', 'supported_features_example'), ('api-supported-features', 'api_supported_features_example'), ('ue-ip-addr', openapi_server.IpAddrInfo()), - ('service-kpis', openapi_server.ServiceKpis())] + ('service-kpis', openapi_server.ServiceKpis()), + ('grant-types', [openapi_server.OAuthGrantType()])] headers = { 'Accept': 'application/json', } diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/typing_utils.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/typing_utils.py index d21c4f63..74e3c913 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/typing_utils.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/typing_utils.py @@ -1,6 +1,7 @@ import sys if sys.version_info < (3, 7): + import typing def is_generic(klass): """ Determine whether klass is a generic class """ diff --git a/services/TS29222_CAPIF_Discover_Service_API/setup.py b/services/TS29222_CAPIF_Discover_Service_API/setup.py index 3594e776..824ebbaa 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/setup.py +++ b/services/TS29222_CAPIF_Discover_Service_API/setup.py @@ -1,3 +1,4 @@ +import sys from setuptools import setup, find_packages NAME = "service_apis" @@ -30,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['service_apis=service_apis.__main__:main']}, long_description="""\ - API for discovering service APIs. © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for discovering service APIs. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/TS29222_CAPIF_Discover_Service_API/test-requirements.txt b/services/TS29222_CAPIF_Discover_Service_API/test-requirements.txt index 6952c4e2..58f51d6a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/test-requirements.txt +++ b/services/TS29222_CAPIF_Discover_Service_API/test-requirements.txt @@ -1,4 +1,4 @@ pytest~=7.1.0 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 +pytest-randomly>=1.2.3 Flask-Testing==0.8.1 -- GitLab From 8a820ec93023f329194497d729d7c1911f4200ab Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 3 Apr 2025 13:39:42 +0200 Subject: [PATCH 095/157] Events API realease V18.6.0 --- .../.openapi-generator/FILES | 3 + .../.openapi-generator/VERSION | 2 +- services/TS29222_CAPIF_Events_API/README.md | 2 +- .../capif_events/models/__init__.py | 66 ++++ .../models/access_control_policy_list.py | 6 +- .../models/access_control_policy_list_ext.py | 6 +- .../capif_events/models/aef_location.py | 7 +- .../capif_events/models/aef_profile.py | 45 ++- .../capif_events/models/api_invoker_policy.py | 6 +- .../capif_events/models/api_status.py | 3 +- .../capif_events/models/base_model.py | 1 + .../models/buffered_notifications_action.py | 3 +- .../capif_events/models/capif_event.py | 3 +- .../capif_events/models/capif_event_detail.py | 9 +- .../capif_events/models/capif_event_filter.py | 3 +- .../capif_events/models/civic_address.py | 3 +- .../capif_events/models/communication_type.py | 3 +- .../capif_events/models/custom_operation.py | 7 +- .../capif_events/models/data_format.py | 3 +- .../capif_events/models/ellipsoid_arc.py | 9 +- .../capif_events/models/event_notification.py | 7 +- .../capif_events/models/event_subscription.py | 18 +- .../models/event_subscription_patch.py | 8 +- .../capif_events/models/gad_shape.py | 6 +- .../capif_events/models/geographic_area.py | 22 +- .../models/geographical_coordinates.py | 3 +- .../models/interface_description.py | 47 ++- .../capif_events/models/invalid_param.py | 3 +- .../capif_events/models/invocation_log.py | 11 +- .../capif_events/models/ip_addr_range.py | 7 +- .../capif_events/models/ipv4_address_range.py | 10 +- .../models/ipv4_address_range1.py | 10 +- .../capif_events/models/ipv6_addr1.py | 3 +- .../capif_events/models/ipv6_address_range.py | 3 +- .../models/ipv6_address_range1.py | 6 +- .../local2d_point_uncertainty_ellipse.py | 11 +- .../local3d_point_uncertainty_ellipsoid.py | 49 ++- .../capif_events/models/local_origin.py | 74 +++- .../capif_events/models/log.py | 8 +- .../models/muting_exception_instructions.py | 7 +- .../models/muting_notifications_settings.py | 3 +- .../capif_events/models/notification_flag.py | 3 +- .../models/notification_method.py | 3 +- .../capif_events/models/o_auth_grant_type.py | 34 ++ .../capif_events/models/operation.py | 3 +- .../models/partitioning_criteria.py | 3 +- .../capif_events/models/point.py | 9 +- .../capif_events/models/point_altitude.py | 9 +- .../models/point_altitude_uncertainty.py | 10 +- .../models/point_uncertainty_circle.py | 9 +- .../models/point_uncertainty_ellipse.py | 10 +- .../capif_events/models/polygon.py | 9 +- .../capif_events/models/problem_details.py | 11 +- .../capif_events/models/protocol.py | 3 +- .../capif_events/models/published_api_path.py | 3 +- .../models/relative_cartesian_location.py | 3 +- .../models/reporting_information.py | 10 +- .../capif_events/models/resource.py | 8 +- .../capif_events/models/routing_rule.py | 8 +- .../capif_events/models/security_method.py | 3 +- .../models/service_api_description.py | 16 +- .../capif_events/models/service_kpis.py | 14 +- .../models/shareable_information.py | 3 +- .../models/subscription_action.py | 3 +- .../models/supported_gad_shapes.py | 3 +- .../capif_events/models/time_range_list.py | 3 +- .../capif_events/models/topology_hiding.py | 6 +- .../models/uncertainty_ellipse.py | 3 +- .../models/uncertainty_ellipsoid.py | 3 +- .../capif_events/models/version.py | 7 +- .../models/websock_notif_config.py | 3 +- .../capif_events/openapi/openapi.yaml | 317 ++++++++++++++++-- .../capif_events/test/__init__.py | 3 +- .../test/test_default_controller.py | 6 +- .../capif_events/typing_utils.py | 1 + services/TS29222_CAPIF_Events_API/setup.py | 3 +- .../test-requirements.txt | 6 +- 77 files changed, 894 insertions(+), 163 deletions(-) create mode 100644 services/TS29222_CAPIF_Events_API/capif_events/models/o_auth_grant_type.py diff --git a/services/TS29222_CAPIF_Events_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Events_API/.openapi-generator/FILES index 54c709f6..2bcc916b 100644 --- a/services/TS29222_CAPIF_Events_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Events_API/.openapi-generator/FILES @@ -1,5 +1,6 @@ .dockerignore .gitignore +.openapi-generator-ignore .travis.yml Dockerfile README.md @@ -50,6 +51,7 @@ capif_events/models/muting_exception_instructions.py capif_events/models/muting_notifications_settings.py capif_events/models/notification_flag.py capif_events/models/notification_method.py +capif_events/models/o_auth_grant_type.py capif_events/models/operation.py capif_events/models/partitioning_criteria.py capif_events/models/point.py @@ -79,6 +81,7 @@ capif_events/models/version.py capif_events/models/websock_notif_config.py capif_events/openapi/openapi.yaml capif_events/test/__init__.py +capif_events/test/test_default_controller.py capif_events/typing_utils.py capif_events/util.py requirements.txt diff --git a/services/TS29222_CAPIF_Events_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Events_API/.openapi-generator/VERSION index 18bb4182..b23eb275 100644 --- a/services/TS29222_CAPIF_Events_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_Events_API/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.11.0 diff --git a/services/TS29222_CAPIF_Events_API/README.md b/services/TS29222_CAPIF_Events_API/README.md index e6189d53..9f89fecd 100644 --- a/services/TS29222_CAPIF_Events_API/README.md +++ b/services/TS29222_CAPIF_Events_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m openapi_server +python3 -m capif_events ``` and open your browser to here: diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/__init__.py b/services/TS29222_CAPIF_Events_API/capif_events/models/__init__.py index d036df69..537f7993 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/__init__.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/__init__.py @@ -1,2 +1,68 @@ # flake8: noqa # import models into model package +from capif_events.models.access_control_policy_list import AccessControlPolicyList +from capif_events.models.access_control_policy_list_ext import AccessControlPolicyListExt +from capif_events.models.aef_location import AefLocation +from capif_events.models.aef_profile import AefProfile +from capif_events.models.api_invoker_policy import ApiInvokerPolicy +from capif_events.models.api_status import ApiStatus +from capif_events.models.buffered_notifications_action import BufferedNotificationsAction +from capif_events.models.capif_event import CAPIFEvent +from capif_events.models.capif_event_detail import CAPIFEventDetail +from capif_events.models.capif_event_filter import CAPIFEventFilter +from capif_events.models.civic_address import CivicAddress +from capif_events.models.communication_type import CommunicationType +from capif_events.models.custom_operation import CustomOperation +from capif_events.models.data_format import DataFormat +from capif_events.models.ellipsoid_arc import EllipsoidArc +from capif_events.models.event_notification import EventNotification +from capif_events.models.event_subscription import EventSubscription +from capif_events.models.event_subscription_patch import EventSubscriptionPatch +from capif_events.models.gad_shape import GADShape +from capif_events.models.geographic_area import GeographicArea +from capif_events.models.geographical_coordinates import GeographicalCoordinates +from capif_events.models.interface_description import InterfaceDescription +from capif_events.models.invalid_param import InvalidParam +from capif_events.models.invocation_log import InvocationLog +from capif_events.models.ip_addr_range import IpAddrRange +from capif_events.models.ipv4_address_range import Ipv4AddressRange +from capif_events.models.ipv4_address_range1 import Ipv4AddressRange1 +from capif_events.models.ipv6_addr1 import Ipv6Addr1 +from capif_events.models.ipv6_address_range import Ipv6AddressRange +from capif_events.models.ipv6_address_range1 import Ipv6AddressRange1 +from capif_events.models.local2d_point_uncertainty_ellipse import Local2dPointUncertaintyEllipse +from capif_events.models.local3d_point_uncertainty_ellipsoid import Local3dPointUncertaintyEllipsoid +from capif_events.models.local_origin import LocalOrigin +from capif_events.models.log import Log +from capif_events.models.muting_exception_instructions import MutingExceptionInstructions +from capif_events.models.muting_notifications_settings import MutingNotificationsSettings +from capif_events.models.notification_flag import NotificationFlag +from capif_events.models.notification_method import NotificationMethod +from capif_events.models.o_auth_grant_type import OAuthGrantType +from capif_events.models.operation import Operation +from capif_events.models.partitioning_criteria import PartitioningCriteria +from capif_events.models.point import Point +from capif_events.models.point_altitude import PointAltitude +from capif_events.models.point_altitude_uncertainty import PointAltitudeUncertainty +from capif_events.models.point_uncertainty_circle import PointUncertaintyCircle +from capif_events.models.point_uncertainty_ellipse import PointUncertaintyEllipse +from capif_events.models.polygon import Polygon +from capif_events.models.problem_details import ProblemDetails +from capif_events.models.protocol import Protocol +from capif_events.models.published_api_path import PublishedApiPath +from capif_events.models.relative_cartesian_location import RelativeCartesianLocation +from capif_events.models.reporting_information import ReportingInformation +from capif_events.models.resource import Resource +from capif_events.models.routing_rule import RoutingRule +from capif_events.models.security_method import SecurityMethod +from capif_events.models.service_api_description import ServiceAPIDescription +from capif_events.models.service_kpis import ServiceKpis +from capif_events.models.shareable_information import ShareableInformation +from capif_events.models.subscription_action import SubscriptionAction +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events.models.time_range_list import TimeRangeList +from capif_events.models.topology_hiding import TopologyHiding +from capif_events.models.uncertainty_ellipse import UncertaintyEllipse +from capif_events.models.uncertainty_ellipsoid import UncertaintyEllipsoid +from capif_events.models.version import Version +from capif_events.models.websock_notif_config import WebsockNotifConfig diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py index 95e986c1..a64c3841 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util -from capif_events.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 from capif_events.models.base_model import Model +from capif_events.models.api_invoker_policy import ApiInvokerPolicy +from capif_events import util +from capif_events.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 class AccessControlPolicyList(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py index 2492b928..e99c495c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util -from capif_events.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 from capif_events.models.base_model import Model +from capif_events.models.api_invoker_policy import ApiInvokerPolicy +from capif_events import util +from capif_events.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 class AccessControlPolicyListExt(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/aef_location.py b/services/TS29222_CAPIF_Events_API/capif_events/models/aef_location.py index 3487b6f3..1f85dba5 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/aef_location.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/aef_location.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.civic_address import CivicAddress +from capif_events.models.geographic_area import GeographicArea +from capif_events import util + from capif_events.models.civic_address import CivicAddress # noqa: E501 from capif_events.models.geographic_area import GeographicArea # noqa: E501 - class AefLocation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py b/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py index c59fc51f..02ae4b48 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py @@ -1,25 +1,36 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from capif_events.models.base_model import Model +from capif_events.models.aef_location import AefLocation +from capif_events.models.data_format import DataFormat +from capif_events.models.interface_description import InterfaceDescription +from capif_events.models.ip_addr_range import IpAddrRange +from capif_events.models.o_auth_grant_type import OAuthGrantType +from capif_events.models.protocol import Protocol +from capif_events.models.security_method import SecurityMethod +from capif_events.models.service_kpis import ServiceKpis +from capif_events.models.version import Version from capif_events import util + from capif_events.models.aef_location import AefLocation # noqa: E501 -from capif_events.models.base_model import Model from capif_events.models.data_format import DataFormat # noqa: E501 from capif_events.models.interface_description import InterfaceDescription # noqa: E501 from capif_events.models.ip_addr_range import IpAddrRange # noqa: E501 +from capif_events.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from capif_events.models.protocol import Protocol # noqa: E501 from capif_events.models.security_method import SecurityMethod # noqa: E501 from capif_events.models.service_kpis import ServiceKpis # noqa: E501 from capif_events.models.version import Version # noqa: E501 - class AefProfile(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ - def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 + def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, grant_types=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 """AefProfile - a model defined in OpenAPI :param aef_id: The aef_id of this AefProfile. # noqa: E501 @@ -32,6 +43,8 @@ class AefProfile(Model): :type data_format: DataFormat :param security_methods: The security_methods of this AefProfile. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this AefProfile. # noqa: E501 + :type grant_types: List[OAuthGrantType] :param domain_name: The domain_name of this AefProfile. # noqa: E501 :type domain_name: str :param interface_descriptions: The interface_descriptions of this AefProfile. # noqa: E501 @@ -49,6 +62,7 @@ class AefProfile(Model): 'protocol': Protocol, 'data_format': DataFormat, 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType], 'domain_name': str, 'interface_descriptions': List[InterfaceDescription], 'aef_location': AefLocation, @@ -62,6 +76,7 @@ class AefProfile(Model): 'protocol': 'protocol', 'data_format': 'dataFormat', 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes', 'domain_name': 'domainName', 'interface_descriptions': 'interfaceDescriptions', 'aef_location': 'aefLocation', @@ -74,6 +89,7 @@ class AefProfile(Model): self._protocol = protocol self._data_format = data_format self._security_methods = security_methods + self._grant_types = grant_types self._domain_name = domain_name self._interface_descriptions = interface_descriptions self._aef_location = aef_location @@ -210,6 +226,29 @@ class AefProfile(Model): self._security_methods = security_methods + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this AefProfile. + + + :return: The grant_types of this AefProfile. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this AefProfile. + + + :param grant_types: The grant_types of this AefProfile. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types + @property def domain_name(self) -> str: """Gets the domain_name of this AefProfile. diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py b/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py index 30c021c2..4d2075bc 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.time_range_list import TimeRangeList # noqa: E501 +from capif_events.models.time_range_list import TimeRangeList +from capif_events import util +from capif_events.models.time_range_list import TimeRangeList # noqa: E501 class ApiInvokerPolicy(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py b/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py index c088f5bd..3ea72ce9 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class ApiStatus(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/base_model.py b/services/TS29222_CAPIF_Events_API/capif_events/models/base_model.py index 336bc44c..41797264 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/base_model.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/base_model.py @@ -1,4 +1,5 @@ import pprint + import typing from capif_events import util diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/buffered_notifications_action.py b/services/TS29222_CAPIF_Events_API/capif_events/models/buffered_notifications_action.py index 4275f290..eca65477 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/buffered_notifications_action.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/buffered_notifications_action.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class BufferedNotificationsAction(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event.py b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event.py index 381df838..fa3a9828 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class CAPIFEvent(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py index ebc44655..c15ad4c8 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py @@ -1,14 +1,19 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from capif_events.models.base_model import Model +from capif_events.models.access_control_policy_list_ext import AccessControlPolicyListExt +from capif_events.models.invocation_log import InvocationLog +from capif_events.models.service_api_description import ServiceAPIDescription +from capif_events.models.topology_hiding import TopologyHiding from capif_events import util + from capif_events.models.access_control_policy_list_ext import AccessControlPolicyListExt # noqa: E501 -from capif_events.models.base_model import Model from capif_events.models.invocation_log import InvocationLog # noqa: E501 from capif_events.models.service_api_description import ServiceAPIDescription # noqa: E501 from capif_events.models.topology_hiding import TopologyHiding # noqa: E501 - class CAPIFEventDetail(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py index 6db6dce0..e9c1638d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class CAPIFEventFilter(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/civic_address.py b/services/TS29222_CAPIF_Events_API/capif_events/models/civic_address.py index 34b6e912..5819d5f2 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/civic_address.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/civic_address.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class CivicAddress(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/communication_type.py b/services/TS29222_CAPIF_Events_API/capif_events/models/communication_type.py index 93fb3275..e5203eb6 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/communication_type.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/communication_type.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class CommunicationType(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py b/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py index 57deea3b..5676f216 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.communication_type import CommunicationType +from capif_events.models.operation import Operation +from capif_events import util + from capif_events.models.communication_type import CommunicationType # noqa: E501 from capif_events.models.operation import Operation # noqa: E501 - class CustomOperation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/data_format.py b/services/TS29222_CAPIF_Events_API/capif_events/models/data_format.py index 751627ee..adec690a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/data_format.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/data_format.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class DataFormat(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py index 05a4ea3e..b5be85b2 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.gad_shape import GADShape +from capif_events.models.geographical_coordinates import GeographicalCoordinates +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events import util + +from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class EllipsoidArc(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py b/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py index e59efbbc..9200e1bc 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.capif_event import CAPIFEvent +from capif_events.models.capif_event_detail import CAPIFEventDetail +from capif_events import util + from capif_events.models.capif_event import CAPIFEvent # noqa: E501 from capif_events.models.capif_event_detail import CAPIFEventDetail # noqa: E501 - class EventNotification(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py index fef52865..aed779ab 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py @@ -1,14 +1,20 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.capif_event import CAPIFEvent +from capif_events.models.capif_event_filter import CAPIFEventFilter +from capif_events.models.reporting_information import ReportingInformation +from capif_events.models.websock_notif_config import WebsockNotifConfig +import re +from capif_events import util + from capif_events.models.capif_event import CAPIFEvent # noqa: E501 from capif_events.models.capif_event_filter import CAPIFEventFilter # noqa: E501 from capif_events.models.reporting_information import ReportingInformation # noqa: E501 from capif_events.models.websock_notif_config import WebsockNotifConfig # noqa: E501 - +import re # noqa: E501 class EventSubscription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -61,7 +67,7 @@ class EventSubscription(Model): self._request_test_notification = request_test_notification self._websock_notif_config = websock_notif_config self._supported_features = supported_features - + @classmethod def return_supp_feat_dict(cls, supp_feat): TOTAL_FEATURES=4 @@ -74,7 +80,7 @@ class EventSubscription(Model): "EnhancedEventReport": True if supp_feat_in_bin[2] == "1" else False, "ApiStatusMonitoring": True if supp_feat_in_bin[3] == "1" else False } - + @classmethod def from_dict(cls, dikt) -> 'EventSubscription': """Returns the dict as a model @@ -249,6 +255,6 @@ class EventSubscription(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py index 401b92e5..51be7cd3 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.capif_event import CAPIFEvent +from capif_events.models.capif_event_filter import CAPIFEventFilter +from capif_events.models.reporting_information import ReportingInformation +from capif_events import util + from capif_events.models.capif_event import CAPIFEvent # noqa: E501 from capif_events.models.capif_event_filter import CAPIFEventFilter # noqa: E501 from capif_events.models.reporting_information import ReportingInformation # noqa: E501 - class EventSubscriptionPatch(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py b/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py index 568a10bf..f669a853 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events import util +from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 class GADShape(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py b/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py index 69ee22da..45c7018d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py @@ -1,13 +1,31 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.ellipsoid_arc import EllipsoidArc +from capif_events.models.geographical_coordinates import GeographicalCoordinates +from capif_events.models.point import Point +from capif_events.models.point_altitude import PointAltitude +from capif_events.models.point_altitude_uncertainty import PointAltitudeUncertainty +from capif_events.models.point_uncertainty_circle import PointUncertaintyCircle +from capif_events.models.point_uncertainty_ellipse import PointUncertaintyEllipse +from capif_events.models.polygon import Polygon +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events.models.uncertainty_ellipse import UncertaintyEllipse +from capif_events import util + +from capif_events.models.ellipsoid_arc import EllipsoidArc # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from capif_events.models.point import Point # noqa: E501 +from capif_events.models.point_altitude import PointAltitude # noqa: E501 +from capif_events.models.point_altitude_uncertainty import PointAltitudeUncertainty # noqa: E501 +from capif_events.models.point_uncertainty_circle import PointUncertaintyCircle # noqa: E501 +from capif_events.models.point_uncertainty_ellipse import PointUncertaintyEllipse # noqa: E501 +from capif_events.models.polygon import Polygon # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class GeographicArea(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/geographical_coordinates.py b/services/TS29222_CAPIF_Events_API/capif_events/models/geographical_coordinates.py index 8337fc1b..38210506 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/geographical_coordinates.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/geographical_coordinates.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class GeographicalCoordinates(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/interface_description.py b/services/TS29222_CAPIF_Events_API/capif_events/models/interface_description.py index 42ddd5f0..e31b30d2 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/interface_description.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/interface_description.py @@ -1,11 +1,16 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.security_method import SecurityMethod # noqa: E501 +from capif_events.models.o_auth_grant_type import OAuthGrantType +from capif_events.models.security_method import SecurityMethod +import re +from capif_events import util +from capif_events.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from capif_events.models.security_method import SecurityMethod # noqa: E501 +import re # noqa: E501 class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +18,7 @@ class InterfaceDescription(Model): Do not edit the class manually. """ - def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None): # noqa: E501 + def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None, grant_types=None): # noqa: E501 """InterfaceDescription - a model defined in OpenAPI :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 @@ -28,6 +33,8 @@ class InterfaceDescription(Model): :type api_prefix: str :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this InterfaceDescription. # noqa: E501 + :type grant_types: List[OAuthGrantType] """ self.openapi_types = { 'ipv4_addr': str, @@ -35,7 +42,8 @@ class InterfaceDescription(Model): 'fqdn': str, 'port': int, 'api_prefix': str, - 'security_methods': List[SecurityMethod] + 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType] } self.attribute_map = { @@ -44,7 +52,8 @@ class InterfaceDescription(Model): 'fqdn': 'fqdn', 'port': 'port', 'api_prefix': 'apiPrefix', - 'security_methods': 'securityMethods' + 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes' } self._ipv4_addr = ipv4_addr @@ -53,6 +62,7 @@ class InterfaceDescription(Model): self._port = port self._api_prefix = api_prefix self._security_methods = security_methods + self._grant_types = grant_types @classmethod def from_dict(cls, dikt) -> 'InterfaceDescription': @@ -136,7 +146,7 @@ class InterfaceDescription(Model): if fqdn is not None and len(fqdn) < 4: raise ValueError("Invalid value for `fqdn`, length must be greater than or equal to `4`") # noqa: E501 if fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', fqdn): # noqa: E501 - raise ValueError("Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + raise ValueError(r"Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 self._fqdn = fqdn @@ -214,3 +224,26 @@ class InterfaceDescription(Model): raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 self._security_methods = security_methods + + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this InterfaceDescription. + + + :return: The grant_types of this InterfaceDescription. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this InterfaceDescription. + + + :param grant_types: The grant_types of this InterfaceDescription. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/invalid_param.py b/services/TS29222_CAPIF_Events_API/capif_events/models/invalid_param.py index 795b8890..9f3557f5 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/invalid_param.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/invalid_param.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/invocation_log.py b/services/TS29222_CAPIF_Events_API/capif_events/models/invocation_log.py index 1762fbc7..b67a3978 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/invocation_log.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/invocation_log.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.log import Log # noqa: E501 +from capif_events.models.log import Log +import re +from capif_events import util +from capif_events.models.log import Log # noqa: E501 +import re # noqa: E501 class InvocationLog(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -153,6 +156,6 @@ class InvocationLog(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py index f2b3d3b0..f633723b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.ipv4_address_range import Ipv4AddressRange +from capif_events.models.ipv6_address_range1 import Ipv6AddressRange1 +from capif_events import util + from capif_events.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 from capif_events.models.ipv6_address_range1 import Ipv6AddressRange1 # noqa: E501 - class IpAddrRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range.py index a76dee21..10e51773 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +import re +from capif_events import util +import re # noqa: E501 class Ipv4AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -67,7 +69,7 @@ class Ipv4AddressRange(Model): if start is None: raise ValueError("Invalid value for `start`, must not be `None`") # noqa: E501 if start is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', start): # noqa: E501 - raise ValueError("Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._start = start @@ -94,6 +96,6 @@ class Ipv4AddressRange(Model): if end is None: raise ValueError("Invalid value for `end`, must not be `None`") # noqa: E501 if end is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', end): # noqa: E501 - raise ValueError("Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._end = end diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range1.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range1.py index 6773c80c..c0291053 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range1.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range1.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +import re +from capif_events import util +import re # noqa: E501 class Ipv4AddressRange1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -65,7 +67,7 @@ class Ipv4AddressRange1(Model): :type start: str """ if start is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', start): # noqa: E501 - raise ValueError("Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._start = start @@ -90,6 +92,6 @@ class Ipv4AddressRange1(Model): :type end: str """ if end is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', end): # noqa: E501 - raise ValueError("Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._end = end diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_addr1.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_addr1.py index 01cf6762..d07d4876 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_addr1.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_addr1.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class Ipv6Addr1(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range.py index 3d7e5c83..17f20cdd 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class Ipv6AddressRange(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range1.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range1.py index 4eff20b6..4d678058 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range1.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range1.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 +from capif_events.models.ipv6_addr1 import Ipv6Addr1 +from capif_events import util +from capif_events.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 class Ipv6AddressRange1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py index 588ecb63..694b07d0 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py @@ -1,14 +1,21 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.gad_shape import GADShape +from capif_events.models.local_origin import LocalOrigin +from capif_events.models.relative_cartesian_location import RelativeCartesianLocation +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events.models.uncertainty_ellipse import UncertaintyEllipse +from capif_events import util + +from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.local_origin import LocalOrigin # noqa: E501 from capif_events.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class Local2dPointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py index a70f1a00..7f164c4d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py @@ -1,21 +1,28 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.gad_shape import GADShape +from capif_events.models.local_origin import LocalOrigin +from capif_events.models.relative_cartesian_location import RelativeCartesianLocation +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events.models.uncertainty_ellipsoid import UncertaintyEllipsoid +from capif_events import util + +from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.local_origin import LocalOrigin # noqa: E501 from capif_events.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_events.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 - class Local3dPointUncertaintyEllipsoid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ - def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None): # noqa: E501 + def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None, v_confidence=None): # noqa: E501 """Local3dPointUncertaintyEllipsoid - a model defined in OpenAPI :param shape: The shape of this Local3dPointUncertaintyEllipsoid. # noqa: E501 @@ -28,13 +35,16 @@ class Local3dPointUncertaintyEllipsoid(Model): :type uncertainty_ellipsoid: UncertaintyEllipsoid :param confidence: The confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 :type confidence: int + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type v_confidence: int """ self.openapi_types = { 'shape': SupportedGADShapes, 'local_origin': LocalOrigin, 'point': RelativeCartesianLocation, 'uncertainty_ellipsoid': UncertaintyEllipsoid, - 'confidence': int + 'confidence': int, + 'v_confidence': int } self.attribute_map = { @@ -42,7 +52,8 @@ class Local3dPointUncertaintyEllipsoid(Model): 'local_origin': 'localOrigin', 'point': 'point', 'uncertainty_ellipsoid': 'uncertaintyEllipsoid', - 'confidence': 'confidence' + 'confidence': 'confidence', + 'v_confidence': 'vConfidence' } self._shape = shape @@ -50,6 +61,7 @@ class Local3dPointUncertaintyEllipsoid(Model): self._point = point self._uncertainty_ellipsoid = uncertainty_ellipsoid self._confidence = confidence + self._v_confidence = v_confidence @classmethod def from_dict(cls, dikt) -> 'Local3dPointUncertaintyEllipsoid': @@ -182,3 +194,30 @@ class Local3dPointUncertaintyEllipsoid(Model): raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 self._confidence = confidence + + @property + def v_confidence(self) -> int: + """Gets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :return: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :rtype: int + """ + return self._v_confidence + + @v_confidence.setter + def v_confidence(self, v_confidence: int): + """Sets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :type v_confidence: int + """ + if v_confidence is not None and v_confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value less than or equal to `100`") # noqa: E501 + if v_confidence is not None and v_confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._v_confidence = v_confidence diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py b/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py index 4cb83ca6..f5b69773 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py @@ -1,10 +1,14 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from capif_events.models.geographic_area import GeographicArea +from capif_events.models.geographical_coordinates import GeographicalCoordinates +from capif_events import util +from capif_events.models.geographic_area import GeographicArea # noqa: E501 +from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 class LocalOrigin(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,26 +16,36 @@ class LocalOrigin(Model): Do not edit the class manually. """ - def __init__(self, coordinate_id=None, point=None): # noqa: E501 + def __init__(self, coordinate_id=None, point=None, area=None, horiz_axes_orientation=None): # noqa: E501 """LocalOrigin - a model defined in OpenAPI :param coordinate_id: The coordinate_id of this LocalOrigin. # noqa: E501 :type coordinate_id: str :param point: The point of this LocalOrigin. # noqa: E501 :type point: GeographicalCoordinates + :param area: The area of this LocalOrigin. # noqa: E501 + :type area: GeographicArea + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. # noqa: E501 + :type horiz_axes_orientation: int """ self.openapi_types = { 'coordinate_id': str, - 'point': GeographicalCoordinates + 'point': GeographicalCoordinates, + 'area': GeographicArea, + 'horiz_axes_orientation': int } self.attribute_map = { 'coordinate_id': 'coordinateId', - 'point': 'point' + 'point': 'point', + 'area': 'area', + 'horiz_axes_orientation': 'horizAxesOrientation' } self._coordinate_id = coordinate_id self._point = point + self._area = area + self._horiz_axes_orientation = horiz_axes_orientation @classmethod def from_dict(cls, dikt) -> 'LocalOrigin': @@ -62,6 +76,8 @@ class LocalOrigin(Model): :param coordinate_id: The coordinate_id of this LocalOrigin. :type coordinate_id: str """ + if coordinate_id is None: + raise ValueError("Invalid value for `coordinate_id`, must not be `None`") # noqa: E501 self._coordinate_id = coordinate_id @@ -85,3 +101,51 @@ class LocalOrigin(Model): """ self._point = point + + @property + def area(self) -> GeographicArea: + """Gets the area of this LocalOrigin. + + + :return: The area of this LocalOrigin. + :rtype: GeographicArea + """ + return self._area + + @area.setter + def area(self, area: GeographicArea): + """Sets the area of this LocalOrigin. + + + :param area: The area of this LocalOrigin. + :type area: GeographicArea + """ + + self._area = area + + @property + def horiz_axes_orientation(self) -> int: + """Gets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :return: The horiz_axes_orientation of this LocalOrigin. + :rtype: int + """ + return self._horiz_axes_orientation + + @horiz_axes_orientation.setter + def horiz_axes_orientation(self, horiz_axes_orientation: int): + """Sets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. + :type horiz_axes_orientation: int + """ + if horiz_axes_orientation is not None and horiz_axes_orientation > 3600: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value less than or equal to `3600`") # noqa: E501 + if horiz_axes_orientation is not None and horiz_axes_orientation < 0: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value greater than or equal to `0`") # noqa: E501 + + self._horiz_axes_orientation = horiz_axes_orientation diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/log.py b/services/TS29222_CAPIF_Events_API/capif_events/models/log.py index 5b9f5bb7..bfb21f73 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/log.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/log.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.interface_description import InterfaceDescription +from capif_events.models.operation import Operation +from capif_events.models.protocol import Protocol +from capif_events import util + from capif_events.models.interface_description import InterfaceDescription # noqa: E501 from capif_events.models.operation import Operation # noqa: E501 from capif_events.models.protocol import Protocol # noqa: E501 - class Log(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py b/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py index d8882bfb..00839244 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.buffered_notifications_action import BufferedNotificationsAction +from capif_events.models.subscription_action import SubscriptionAction +from capif_events import util + from capif_events.models.buffered_notifications_action import BufferedNotificationsAction # noqa: E501 from capif_events.models.subscription_action import SubscriptionAction # noqa: E501 - class MutingExceptionInstructions(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/muting_notifications_settings.py b/services/TS29222_CAPIF_Events_API/capif_events/models/muting_notifications_settings.py index 902cf193..ac4ea3d6 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/muting_notifications_settings.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/muting_notifications_settings.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class MutingNotificationsSettings(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/notification_flag.py b/services/TS29222_CAPIF_Events_API/capif_events/models/notification_flag.py index 17eff44a..fa4d5259 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/notification_flag.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/notification_flag.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class NotificationFlag(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/notification_method.py b/services/TS29222_CAPIF_Events_API/capif_events/models/notification_method.py index f8676038..b87ce0b5 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/notification_method.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/notification_method.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class NotificationMethod(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Events_API/capif_events/models/o_auth_grant_type.py new file mode 100644 index 00000000..5d4c4ba6 --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/o_auth_grant_type.py @@ -0,0 +1,34 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from capif_events.models.base_model import Model +from capif_events import util + + +class OAuthGrantType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """OAuthGrantType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'OAuthGrantType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OAuthGrantType of this OAuthGrantType. # noqa: E501 + :rtype: OAuthGrantType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/operation.py b/services/TS29222_CAPIF_Events_API/capif_events/models/operation.py index 1a8a1f97..01c08428 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/operation.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/operation.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class Operation(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/partitioning_criteria.py b/services/TS29222_CAPIF_Events_API/capif_events/models/partitioning_criteria.py index 40a8bf7b..1fed743c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/partitioning_criteria.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/partitioning_criteria.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class PartitioningCriteria(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point.py index 3f9f2e23..25e5dcef 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.gad_shape import GADShape +from capif_events.models.geographical_coordinates import GeographicalCoordinates +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events import util + +from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class Point(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py index 64134eca..e1fbee8d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.gad_shape import GADShape +from capif_events.models.geographical_coordinates import GeographicalCoordinates +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events import util + +from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class PointAltitude(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py index f45227d1..965fd431 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py @@ -1,13 +1,19 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.gad_shape import GADShape +from capif_events.models.geographical_coordinates import GeographicalCoordinates +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events.models.uncertainty_ellipse import UncertaintyEllipse +from capif_events import util + +from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class PointAltitudeUncertainty(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py index a62a475c..8ea7284c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.gad_shape import GADShape +from capif_events.models.geographical_coordinates import GeographicalCoordinates +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events import util + +from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class PointUncertaintyCircle(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py index 618bb46d..07f77277 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py @@ -1,13 +1,19 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.gad_shape import GADShape +from capif_events.models.geographical_coordinates import GeographicalCoordinates +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events.models.uncertainty_ellipse import UncertaintyEllipse +from capif_events import util + +from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class PointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py b/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py index 7d89244d..8804de2c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.gad_shape import GADShape +from capif_events.models.geographical_coordinates import GeographicalCoordinates +from capif_events.models.supported_gad_shapes import SupportedGADShapes +from capif_events import util + +from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class Polygon(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/problem_details.py b/services/TS29222_CAPIF_Events_API/capif_events/models/problem_details.py index bbf92452..4cd85b68 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/problem_details.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/problem_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.invalid_param import InvalidParam # noqa: E501 +from capif_events.models.invalid_param import InvalidParam +import re +from capif_events import util +from capif_events.models.invalid_param import InvalidParam # noqa: E501 +import re # noqa: E501 class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -259,6 +262,6 @@ class ProblemDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/protocol.py b/services/TS29222_CAPIF_Events_API/capif_events/models/protocol.py index a92a428a..437f5b2a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/protocol.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/protocol.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class Protocol(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/published_api_path.py b/services/TS29222_CAPIF_Events_API/capif_events/models/published_api_path.py index 6f2ae662..f341f1c9 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/published_api_path.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/published_api_path.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class PublishedApiPath(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/relative_cartesian_location.py b/services/TS29222_CAPIF_Events_API/capif_events/models/relative_cartesian_location.py index e6c06126..5a994928 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/relative_cartesian_location.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/relative_cartesian_location.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class RelativeCartesianLocation(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py b/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py index cb2fcfe9..08e387b0 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py @@ -1,15 +1,21 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.muting_exception_instructions import MutingExceptionInstructions +from capif_events.models.muting_notifications_settings import MutingNotificationsSettings +from capif_events.models.notification_flag import NotificationFlag +from capif_events.models.notification_method import NotificationMethod +from capif_events.models.partitioning_criteria import PartitioningCriteria +from capif_events import util + from capif_events.models.muting_exception_instructions import MutingExceptionInstructions # noqa: E501 from capif_events.models.muting_notifications_settings import MutingNotificationsSettings # noqa: E501 from capif_events.models.notification_flag import NotificationFlag # noqa: E501 from capif_events.models.notification_method import NotificationMethod # noqa: E501 from capif_events.models.partitioning_criteria import PartitioningCriteria # noqa: E501 - class ReportingInformation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py b/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py index 9ab8c771..8493f59d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.communication_type import CommunicationType +from capif_events.models.custom_operation import CustomOperation +from capif_events.models.operation import Operation +from capif_events import util + from capif_events.models.communication_type import CommunicationType # noqa: E501 from capif_events.models.custom_operation import CustomOperation # noqa: E501 from capif_events.models.operation import Operation # noqa: E501 - class Resource(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py b/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py index 0560f90f..b59d1dd7 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from capif_events.models.base_model import Model +from capif_events.models.aef_profile import AefProfile +from capif_events.models.ipv4_address_range1 import Ipv4AddressRange1 +from capif_events.models.ipv6_address_range import Ipv6AddressRange from capif_events import util + from capif_events.models.aef_profile import AefProfile # noqa: E501 -from capif_events.models.base_model import Model from capif_events.models.ipv4_address_range1 import Ipv4AddressRange1 # noqa: E501 from capif_events.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 - class RoutingRule(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/security_method.py b/services/TS29222_CAPIF_Events_API/capif_events/models/security_method.py index fa70435c..ff87e785 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/security_method.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/security_method.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py b/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py index ac3bb242..6616b8f4 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py @@ -1,14 +1,20 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from capif_events.models.base_model import Model +from capif_events.models.aef_profile import AefProfile +from capif_events.models.api_status import ApiStatus +from capif_events.models.published_api_path import PublishedApiPath +from capif_events.models.shareable_information import ShareableInformation +import re from capif_events import util + from capif_events.models.aef_profile import AefProfile # noqa: E501 from capif_events.models.api_status import ApiStatus # noqa: E501 -from capif_events.models.base_model import Model from capif_events.models.published_api_path import PublishedApiPath # noqa: E501 from capif_events.models.shareable_information import ShareableInformation # noqa: E501 - +import re # noqa: E501 class ServiceAPIDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -236,7 +242,7 @@ class ServiceAPIDescription(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features @@ -305,7 +311,7 @@ class ServiceAPIDescription(Model): :type api_supp_feats: str """ if api_supp_feats is not None and not re.search(r'^[A-Fa-f0-9]*$', api_supp_feats): # noqa: E501 - raise ValueError("Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._api_supp_feats = api_supp_feats diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/service_kpis.py b/services/TS29222_CAPIF_Events_API/capif_events/models/service_kpis.py index 1bbabf84..7a4789dd 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/service_kpis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/service_kpis.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +import re +from capif_events import util +import re # noqa: E501 class ServiceKpis(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -170,7 +172,7 @@ class ServiceKpis(Model): :type aval_comp: str """ if aval_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_comp): # noqa: E501 - raise ValueError("Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 self._aval_comp = aval_comp @@ -195,7 +197,7 @@ class ServiceKpis(Model): :type aval_gra_comp: str """ if aval_gra_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_gra_comp): # noqa: E501 - raise ValueError("Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 self._aval_gra_comp = aval_gra_comp @@ -220,7 +222,7 @@ class ServiceKpis(Model): :type aval_mem: str """ if aval_mem is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_mem): # noqa: E501 - raise ValueError("Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 self._aval_mem = aval_mem @@ -245,7 +247,7 @@ class ServiceKpis(Model): :type aval_stor: str """ if aval_stor is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_stor): # noqa: E501 - raise ValueError("Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 self._aval_stor = aval_stor diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py b/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py index 05210269..7b16c081 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class ShareableInformation(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/subscription_action.py b/services/TS29222_CAPIF_Events_API/capif_events/models/subscription_action.py index 99f4aab2..99ae834d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/subscription_action.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/subscription_action.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class SubscriptionAction(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/supported_gad_shapes.py b/services/TS29222_CAPIF_Events_API/capif_events/models/supported_gad_shapes.py index e78e057a..38ff4d53 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/supported_gad_shapes.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/supported_gad_shapes.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class SupportedGADShapes(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/time_range_list.py b/services/TS29222_CAPIF_Events_API/capif_events/models/time_range_list.py index ad689a13..9a6b6267 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/time_range_list.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/time_range_list.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class TimeRangeList(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/topology_hiding.py b/services/TS29222_CAPIF_Events_API/capif_events/models/topology_hiding.py index 7f56cc9f..0a028785 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/topology_hiding.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/topology_hiding.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.routing_rule import RoutingRule # noqa: E501 +from capif_events.models.routing_rule import RoutingRule +from capif_events import util +from capif_events.models.routing_rule import RoutingRule # noqa: E501 class TopologyHiding(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipse.py index c10203df..627eb52b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipse.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class UncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipsoid.py index e1a4a1f2..f10fac8f 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipsoid.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class UncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/version.py b/services/TS29222_CAPIF_Events_API/capif_events/models/version.py index 5777e684..709e34ce 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/version.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/version.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.custom_operation import CustomOperation +from capif_events.models.resource import Resource +from capif_events import util + from capif_events.models.custom_operation import CustomOperation # noqa: E501 from capif_events.models.resource import Resource # noqa: E501 - class Version(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/websock_notif_config.py b/services/TS29222_CAPIF_Events_API/capif_events/models/websock_notif_config.py index f1ceeb00..0077354d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/websock_notif_config.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/websock_notif_config.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_events import util from capif_events.models.base_model import Model +from capif_events import util class WebsockNotifConfig(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml b/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml index 892a7a2b..cc8ed018 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for event subscription management. \n© 2023, 3GPP Organizational\ + description: "API for event subscription management. \n© 2024, 3GPP Organizational\ \ Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Events_API - version: 1.3.0-alpha.4 + version: 1.3.0 externalDocs: - description: 3GPP TS 29.222 V18.4.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/capif-events/v1" @@ -18,9 +18,9 @@ paths: post: callbacks: notificationDestination: - '{request.body#/notificationDestination}': + '{$request.body#/notificationDestination}': post: - operationId: notificationDestination_request_bodyNotificationDestinationPost + operationId: notification_destination_post requestBody: content: application/json: @@ -673,6 +673,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -690,6 +693,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -704,6 +710,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -721,6 +730,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -739,6 +751,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -756,6 +771,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -770,6 +788,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -787,6 +808,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -807,6 +831,9 @@ components: end: end aefProfile: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -985,6 +1012,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -993,6 +1023,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1021,6 +1054,9 @@ components: end: end aefProfile: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1199,6 +1235,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1207,6 +1246,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1267,6 +1309,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1445,6 +1490,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1453,6 +1501,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1470,6 +1521,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1648,6 +1702,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1656,6 +1713,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1695,6 +1755,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1873,6 +1936,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1881,6 +1947,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1898,6 +1967,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -2076,6 +2148,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2084,6 +2159,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2174,6 +2252,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2191,6 +2272,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2205,6 +2289,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2222,6 +2309,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2240,6 +2330,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2257,6 +2350,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2271,6 +2367,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2288,6 +2387,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2308,6 +2410,9 @@ components: end: end aefProfile: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -2486,6 +2591,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2494,6 +2602,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2522,6 +2633,9 @@ components: end: end aefProfile: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -2700,6 +2814,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2708,6 +2825,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2768,6 +2888,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -2946,6 +3069,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2954,6 +3080,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -2971,6 +3100,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -3149,6 +3281,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3157,6 +3292,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3196,6 +3334,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -3374,6 +3515,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3382,6 +3526,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3399,6 +3546,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -3577,6 +3727,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3585,6 +3738,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3685,6 +3841,9 @@ components: end: end aefProfile: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -3863,6 +4022,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3871,6 +4033,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -3899,6 +4064,9 @@ components: end: end aefProfile: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -4077,6 +4245,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4085,6 +4256,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4376,6 +4550,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -4554,6 +4731,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4562,6 +4742,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4579,6 +4762,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -4757,6 +4943,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4765,6 +4954,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -4865,6 +5057,9 @@ components: description: Represents the AEF profile data. example: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -5043,6 +5238,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5051,6 +5249,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5068,13 +5269,10 @@ components: maxReqRate: 0 avalGraComp: avalGraComp nullable: true - oneOf: - - required: - - ipv4Addr - - required: - - ipv6Addr - - required: - - fqdn + oneOf: + - required: ["domainName"] + - required: ["interfaceDescriptions"] + - {} properties: aefId: description: Identifier of the API exposing function @@ -5098,6 +5296,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array domainName: description: Domain to which API belongs to title: domainName @@ -5391,6 +5595,9 @@ components: description: Represents the description of an API's interface. example: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5399,11 +5606,10 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr nullable: true - oneOf: - - required: - - domainName - - required: - - interfaceDescriptions + oneOf: + - required: ["fqdn"] + - required: ["ipv4Addr"] + - required: ["ipv6Addr"] properties: ipv4Addr: description: | @@ -5442,6 +5648,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array title: InterfaceDescription type: object AefLocation: @@ -5564,7 +5776,9 @@ components: title: ServiceKpis type: object IpAddrRange: - anyOf: [] + anyOf: + - required: ["ueIpv4AddrRanges"] + - required: ["ueIpv6AddrRanges"] description: Represents the list of public IP ranges example: ueIpv4AddrRanges: @@ -5651,6 +5865,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5668,6 +5885,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5682,6 +5902,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5699,6 +5922,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5745,6 +5971,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5762,6 +5991,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -5923,6 +6155,9 @@ components: end: end aefProfile: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -6101,6 +6336,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -6109,6 +6347,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -6292,6 +6533,23 @@ components: type: integer title: MutingNotificationsSettings type: object + OAuthGrantType: + anyOf: + - enum: + - CLIENT_CREDENTIALS + - AUTHORIZATION_CODE + - AUTHORIZATION_CODE_WITH_PKCE + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. + type: string + description: "Indicates the supported authorization flow (e.g. client credentials\ + \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ + \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ + \ credentials flow.\n- AUTHORIZATION_CODE: Indicate that the grant type is\ + \ authorization code.\n- AUTHORIZATION_CODE_WITH_PKCE: Indicate that the grant\ + \ type is authorization code with PKCE.\n" + title: OAuthGrantType DateTime_1: description: string with format "date-time" as defined in OpenAPI. format: date-time @@ -6755,8 +7013,26 @@ components: type: string point: $ref: '#/components/schemas/GeographicalCoordinates' + area: + $ref: '#/components/schemas/GeographicArea' + horizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in + 0.1 degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer + required: + - coordinateId title: LocalOrigin type: object + HorizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in 0.1 + degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer RelativeCartesianLocation: description: Relative Cartesian Location properties: @@ -6792,6 +7068,8 @@ components: $ref: '#/components/schemas/UncertaintyEllipsoid' confidence: $ref: '#/components/schemas/Confidence' + vConfidence: + $ref: '#/components/schemas/Confidence' required: - confidence - localOrigin @@ -6886,9 +7164,6 @@ components: title: Ipv6AddressRange_1 type: object Ipv6Addr_1: - allOf: - - pattern: "^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$" - - pattern: "^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$" description: | String identifying an IPv6 address formatted according to clause 4 of RFC5952. The mixed IPv4 IPv6 notation according to clause 5 of RFC5952 shall not be used. example: 2001:db8:85a3::8a2e:370:7334 diff --git a/services/TS29222_CAPIF_Events_API/capif_events/test/__init__.py b/services/TS29222_CAPIF_Events_API/capif_events/test/__init__.py index 8da9951b..c55e721a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/test/__init__.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/test/__init__.py @@ -1,9 +1,10 @@ import logging import connexion -from capif_events.encoder import JSONEncoder from flask_testing import TestCase +from capif_events.encoder import JSONEncoder + class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py b/services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py index b724d9ae..7e06036b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py @@ -1,8 +1,12 @@ import unittest -from capif_events.test import BaseTestCase from flask import json +from capif_events.models.event_subscription import EventSubscription # noqa: E501 +from capif_events.models.event_subscription_patch import EventSubscriptionPatch # noqa: E501 +from capif_events.models.problem_details import ProblemDetails # noqa: E501 +from capif_events.test import BaseTestCase + class TestDefaultController(BaseTestCase): """DefaultController integration test stubs""" diff --git a/services/TS29222_CAPIF_Events_API/capif_events/typing_utils.py b/services/TS29222_CAPIF_Events_API/capif_events/typing_utils.py index d21c4f63..74e3c913 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/typing_utils.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/typing_utils.py @@ -1,6 +1,7 @@ import sys if sys.version_info < (3, 7): + import typing def is_generic(klass): """ Determine whether klass is a generic class """ diff --git a/services/TS29222_CAPIF_Events_API/setup.py b/services/TS29222_CAPIF_Events_API/setup.py index defed2cc..f6e3cc23 100644 --- a/services/TS29222_CAPIF_Events_API/setup.py +++ b/services/TS29222_CAPIF_Events_API/setup.py @@ -1,3 +1,4 @@ +import sys from setuptools import setup, find_packages NAME = "capif_events" @@ -30,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['capif_events=capif_events.__main__:main']}, long_description="""\ - API for event subscription management. © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for event subscription management. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/TS29222_CAPIF_Events_API/test-requirements.txt b/services/TS29222_CAPIF_Events_API/test-requirements.txt index 202a684f..58f51d6a 100644 --- a/services/TS29222_CAPIF_Events_API/test-requirements.txt +++ b/services/TS29222_CAPIF_Events_API/test-requirements.txt @@ -1,4 +1,4 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=7.1.0 pytest-cov>=2.8.1 -pytest-randomly == 1.2.3 # needed for python 2.7+3.4 -Flask-Testing == 0.8.0 +pytest-randomly>=1.2.3 +Flask-Testing==0.8.1 -- GitLab From 9cb0ea0de8f497615b2a26715dd1fd3eeeb0edf9 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Thu, 3 Apr 2025 14:55:16 +0300 Subject: [PATCH 096/157] Migrate from gunicorn 22 to 23, except helper service --- .../TS29222_CAPIF_API_Invoker_Management_API/requirements.txt | 2 +- .../TS29222_CAPIF_API_Provider_Management_API/requirements.txt | 2 +- .../TS29222_CAPIF_Access_Control_Policy_API/requirements.txt | 2 +- services/TS29222_CAPIF_Auditing_API/requirements.txt | 2 +- services/TS29222_CAPIF_Discover_Service_API/requirements.txt | 2 +- services/TS29222_CAPIF_Events_API/requirements.txt | 2 +- .../TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt | 2 +- services/TS29222_CAPIF_Publish_Service_API/requirements.txt | 2 +- services/TS29222_CAPIF_Routing_Info_API/requirements.txt | 2 +- services/TS29222_CAPIF_Security_API/requirements.txt | 2 +- services/register/requirements.txt | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt b/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt index c28e5fb6..9e154c60 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt @@ -21,5 +21,5 @@ opentelemetry-sdk == 1.20.0 flask_executor == 1.0.0 Flask-APScheduler == 1.13.1 werkzeug == 3.0.6 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 \ No newline at end of file diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt b/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt index 0b5ec10e..9d79f084 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt +++ b/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt @@ -19,5 +19,5 @@ opentelemetry-api == 1.19.0 opentelemetry-sdk == 1.19.0 flask_executor == 1.0.0 werkzeug == 3.0.4 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt b/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt index e38f272c..9524b428 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt @@ -20,5 +20,5 @@ opentelemetry-sdk == 1.19.0 flask_executor == 1.0.0 Flask-APScheduler == 1.13.1 Flask-Script == 2.0.6 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 \ No newline at end of file diff --git a/services/TS29222_CAPIF_Auditing_API/requirements.txt b/services/TS29222_CAPIF_Auditing_API/requirements.txt index da3a4c51..40ed48bc 100644 --- a/services/TS29222_CAPIF_Auditing_API/requirements.txt +++ b/services/TS29222_CAPIF_Auditing_API/requirements.txt @@ -20,5 +20,5 @@ opentelemetry-sdk == 1.19.0 flask_executor == 1.0.0 werkzeug == 3.0.4 pyopenssl == 24.1.0 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Discover_Service_API/requirements.txt b/services/TS29222_CAPIF_Discover_Service_API/requirements.txt index 32a15be2..04ff0c77 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/requirements.txt +++ b/services/TS29222_CAPIF_Discover_Service_API/requirements.txt @@ -20,5 +20,5 @@ opentelemetry-api == 1.19.0 opentelemetry-sdk == 1.19.0 flask_executor == 1.0.0 werkzeug == 3.0.4 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Events_API/requirements.txt b/services/TS29222_CAPIF_Events_API/requirements.txt index bfe2e17c..1edc40a9 100644 --- a/services/TS29222_CAPIF_Events_API/requirements.txt +++ b/services/TS29222_CAPIF_Events_API/requirements.txt @@ -24,5 +24,5 @@ aiohttp == 3.10.5 async-timeout == 4.0.3 werkzeug == 3.0.4 pyopenssl == 24.2.1 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 \ No newline at end of file diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt b/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt index e5640804..7abd4609 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt @@ -21,5 +21,5 @@ opentelemetry-sdk == 1.19.0 flask_executor == 1.0.0 werkzeug == 3.0.4 pyopenssl == 24.1.0 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Publish_Service_API/requirements.txt b/services/TS29222_CAPIF_Publish_Service_API/requirements.txt index 0496b8e4..73be6c5f 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/requirements.txt +++ b/services/TS29222_CAPIF_Publish_Service_API/requirements.txt @@ -20,6 +20,6 @@ opentelemetry-sdk == 1.17.0 flask_executor == 1.0.0 Flask-APScheduler == 1.13.1 werkzeug == 3.0.4 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Routing_Info_API/requirements.txt b/services/TS29222_CAPIF_Routing_Info_API/requirements.txt index 0ecdd1f3..9c190938 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/requirements.txt +++ b/services/TS29222_CAPIF_Routing_Info_API/requirements.txt @@ -4,5 +4,5 @@ python_dateutil >= 2.6.0 setuptools == 74.0.0 Flask == 3.0.3 werkzeug == 3.0.4 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Security_API/requirements.txt b/services/TS29222_CAPIF_Security_API/requirements.txt index b3fd4f79..cfd57783 100644 --- a/services/TS29222_CAPIF_Security_API/requirements.txt +++ b/services/TS29222_CAPIF_Security_API/requirements.txt @@ -21,5 +21,5 @@ opentelemetry-sdk == 1.19.0 Flask-APScheduler == 1.13.1 flask_executor == 1.0.0 werkzeug == 3.0.4 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 \ No newline at end of file diff --git a/services/register/requirements.txt b/services/register/requirements.txt index 1c1cb217..15c8c083 100644 --- a/services/register/requirements.txt +++ b/services/register/requirements.txt @@ -8,5 +8,5 @@ pyyaml == 6.0.1 requests == 2.32.2 bcrypt == 4.0.1 flask_httpauth == 4.8.0 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 -- GitLab From 1ace7e84beb7b28a3511a2590daf7bbac7e307c8 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Mon, 7 Apr 2025 11:51:43 +0200 Subject: [PATCH 097/157] Logging API realease V18.6.0 --- .../.openapi-generator/FILES | 1 + .../.openapi-generator/VERSION | 2 +- .../README.md | 2 +- .../api_invocation_logs/models/__init__.py | 9 +++ .../api_invocation_logs/models/base_model.py | 1 + .../models/interface_description.py | 47 ++++++++++++--- .../models/invalid_param.py | 3 +- .../models/invocation_log.py | 11 ++-- .../api_invocation_logs/models/log.py | 8 ++- .../models/o_auth_grant_type.py | 34 +++++++++++ .../api_invocation_logs/models/operation.py | 3 +- .../models/problem_details.py | 11 ++-- .../api_invocation_logs/models/protocol.py | 3 +- .../models/security_method.py | 3 +- .../api_invocation_logs/openapi/openapi.yaml | 59 ++++++++++++++++--- .../api_invocation_logs/test/__init__.py | 3 +- .../test/test_default_controller.py | 7 ++- .../api_invocation_logs/typing_utils.py | 1 + .../setup.py | 3 +- 19 files changed, 175 insertions(+), 36 deletions(-) create mode 100644 services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/o_auth_grant_type.py diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES index 691fa78c..fd69e2e1 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES @@ -17,6 +17,7 @@ api_invocation_logs/models/interface_description.py api_invocation_logs/models/invalid_param.py api_invocation_logs/models/invocation_log.py api_invocation_logs/models/log.py +api_invocation_logs/models/o_auth_grant_type.py api_invocation_logs/models/operation.py api_invocation_logs/models/problem_details.py api_invocation_logs/models/protocol.py diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/VERSION index 18bb4182..b23eb275 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.11.0 diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/README.md b/services/TS29222_CAPIF_Logging_API_Invocation_API/README.md index 9d330236..4c9ab923 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/README.md +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m openapi_server +python3 -m api_invocation_logs ``` and open your browser to here: diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py index d036df69..cfc7e59c 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py @@ -1,2 +1,11 @@ # flake8: noqa # import models into model package +from api_invocation_logs.models.interface_description import InterfaceDescription +from api_invocation_logs.models.invalid_param import InvalidParam +from api_invocation_logs.models.invocation_log import InvocationLog +from api_invocation_logs.models.log import Log +from api_invocation_logs.models.o_auth_grant_type import OAuthGrantType +from api_invocation_logs.models.operation import Operation +from api_invocation_logs.models.problem_details import ProblemDetails +from api_invocation_logs.models.protocol import Protocol +from api_invocation_logs.models.security_method import SecurityMethod diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py index d7f252ca..642d94a3 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py @@ -1,4 +1,5 @@ import pprint + import typing from api_invocation_logs import util diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py index cffe68d5..10e8ad15 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py @@ -1,11 +1,16 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invocation_logs import util from api_invocation_logs.models.base_model import Model -from api_invocation_logs.models.security_method import SecurityMethod # noqa: E501 +from api_invocation_logs.models.o_auth_grant_type import OAuthGrantType +from api_invocation_logs.models.security_method import SecurityMethod +import re +from api_invocation_logs import util +from api_invocation_logs.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from api_invocation_logs.models.security_method import SecurityMethod # noqa: E501 +import re # noqa: E501 class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +18,7 @@ class InterfaceDescription(Model): Do not edit the class manually. """ - def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None): # noqa: E501 + def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None, grant_types=None): # noqa: E501 """InterfaceDescription - a model defined in OpenAPI :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 @@ -28,6 +33,8 @@ class InterfaceDescription(Model): :type api_prefix: str :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this InterfaceDescription. # noqa: E501 + :type grant_types: List[OAuthGrantType] """ self.openapi_types = { 'ipv4_addr': str, @@ -35,7 +42,8 @@ class InterfaceDescription(Model): 'fqdn': str, 'port': int, 'api_prefix': str, - 'security_methods': List[SecurityMethod] + 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType] } self.attribute_map = { @@ -44,7 +52,8 @@ class InterfaceDescription(Model): 'fqdn': 'fqdn', 'port': 'port', 'api_prefix': 'apiPrefix', - 'security_methods': 'securityMethods' + 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes' } self._ipv4_addr = ipv4_addr @@ -53,6 +62,7 @@ class InterfaceDescription(Model): self._port = port self._api_prefix = api_prefix self._security_methods = security_methods + self._grant_types = grant_types @classmethod def from_dict(cls, dikt) -> 'InterfaceDescription': @@ -136,7 +146,7 @@ class InterfaceDescription(Model): if fqdn is not None and len(fqdn) < 4: raise ValueError("Invalid value for `fqdn`, length must be greater than or equal to `4`") # noqa: E501 if fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', fqdn): # noqa: E501 - raise ValueError("Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + raise ValueError(r"Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 self._fqdn = fqdn @@ -214,3 +224,26 @@ class InterfaceDescription(Model): raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 self._security_methods = security_methods + + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this InterfaceDescription. + + + :return: The grant_types of this InterfaceDescription. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this InterfaceDescription. + + + :param grant_types: The grant_types of this InterfaceDescription. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py index cabf7c8a..d7ec5735 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invocation_logs import util from api_invocation_logs.models.base_model import Model +from api_invocation_logs import util class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py index 2ecb4d63..6110fce8 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invocation_logs import util from api_invocation_logs.models.base_model import Model -from api_invocation_logs.models.log import Log # noqa: E501 +from api_invocation_logs.models.log import Log +import re +from api_invocation_logs import util +from api_invocation_logs.models.log import Log # noqa: E501 +import re # noqa: E501 class InvocationLog(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -153,6 +156,6 @@ class InvocationLog(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py index 657d6a72..41076a09 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invocation_logs import util from api_invocation_logs.models.base_model import Model +from api_invocation_logs.models.interface_description import InterfaceDescription +from api_invocation_logs.models.operation import Operation +from api_invocation_logs.models.protocol import Protocol +from api_invocation_logs import util + from api_invocation_logs.models.interface_description import InterfaceDescription # noqa: E501 from api_invocation_logs.models.operation import Operation # noqa: E501 from api_invocation_logs.models.protocol import Protocol # noqa: E501 - class Log(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/o_auth_grant_type.py new file mode 100644 index 00000000..1165483f --- /dev/null +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/o_auth_grant_type.py @@ -0,0 +1,34 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from api_invocation_logs.models.base_model import Model +from api_invocation_logs import util + + +class OAuthGrantType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """OAuthGrantType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'OAuthGrantType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OAuthGrantType of this OAuthGrantType. # noqa: E501 + :rtype: OAuthGrantType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py index 87835c09..513f6d00 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invocation_logs import util from api_invocation_logs.models.base_model import Model +from api_invocation_logs import util class Operation(Model): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py index 0a10c19d..1ab0e54c 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invocation_logs import util from api_invocation_logs.models.base_model import Model -from api_invocation_logs.models.invalid_param import InvalidParam # noqa: E501 +from api_invocation_logs.models.invalid_param import InvalidParam +import re +from api_invocation_logs import util +from api_invocation_logs.models.invalid_param import InvalidParam # noqa: E501 +import re # noqa: E501 class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -259,6 +262,6 @@ class ProblemDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py index 708e8bc4..ec4bf3b2 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invocation_logs import util from api_invocation_logs.models.base_model import Model +from api_invocation_logs import util class Protocol(Model): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py index fe2fcfe3..b47fd3ef 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from api_invocation_logs import util from api_invocation_logs.models.base_model import Model +from api_invocation_logs import util class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml index f1a93904..66babaf9 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for invocation logs. \n© 2022, 3GPP Organizational Partners (ARIB,\ + description: "API for invocation logs. \n© 2024, 3GPP Organizational Partners (ARIB,\ \ ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Logging_API_Invocation_API - version: 1.3.0-alpha.1 + version: 1.3.0 externalDocs: - description: 3GPP TS 29.222 V18.0.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/api-invocation-logs/v1" @@ -192,6 +192,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -209,6 +212,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -223,6 +229,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -240,6 +249,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -286,6 +298,9 @@ components: invocationTime: 2000-01-23T04:56:07.000+00:00 srcInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -303,6 +318,9 @@ components: apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -499,6 +517,9 @@ components: description: Represents the description of an API's interface. example: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -508,12 +529,9 @@ components: ipv4Addr: ipv4Addr nullable: true oneOf: - - required: - - ipv4Addr - - required: - - ipv6Addr - - required: - - fqdn + - required: ["fqdn"] + - required: ["ipv4Addr"] + - required: ["ipv6Addr"] properties: ipv4Addr: description: | @@ -552,6 +570,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array title: InterfaceDescription type: object SecurityMethod: @@ -593,3 +617,20 @@ components: minimum: 0 title: Port type: integer + OAuthGrantType: + anyOf: + - enum: + - CLIENT_CREDENTIALS + - AUTHORIZATION_CODE + - AUTHORIZATION_CODE_WITH_PKCE + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. + type: string + description: "Indicates the supported authorization flow (e.g. client credentials\ + \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ + \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ + \ credentials flow.\n- AUTHORIZATION_CODE: Indicate that the grant type is\ + \ authorization code.\n- AUTHORIZATION_CODE_WITH_PKCE: Indicate that the grant\ + \ type is authorization code with PKCE.\n" + title: OAuthGrantType diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py index 5282c992..52299ec8 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py @@ -1,9 +1,10 @@ import logging import connexion -from api_invocation_logs.encoder import JSONEncoder from flask_testing import TestCase +from api_invocation_logs.encoder import JSONEncoder + class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py index f5c22b45..a7819930 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py @@ -1,8 +1,11 @@ import unittest -from api_invocation_logs.test import BaseTestCase from flask import json +from api_invocation_logs.models.invocation_log import InvocationLog # noqa: E501 +from api_invocation_logs.models.problem_details import ProblemDetails # noqa: E501 +from api_invocation_logs.test import BaseTestCase + class TestDefaultController(BaseTestCase): """DefaultController integration test stubs""" @@ -12,7 +15,7 @@ class TestDefaultController(BaseTestCase): """ - invocation_log = {"supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","aefId":"aefId","logs":[{"apiName":"apiName","invocationTime":"2000-01-23T04:56:07.000+00:00","srcInterface":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"fwdInterface":"fwdInterface","resourceName":"resourceName","uri":"uri","inputParameters":"","invocationLatency":0,"result":"result","protocol":"HTTP_1_1","apiVersion":"apiVersion","destInterface":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"operation":"GET","apiId":"apiId","outputParameters":""},{"apiName":"apiName","invocationTime":"2000-01-23T04:56:07.000+00:00","srcInterface":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"fwdInterface":"fwdInterface","resourceName":"resourceName","uri":"uri","inputParameters":"","invocationLatency":0,"result":"result","protocol":"HTTP_1_1","apiVersion":"apiVersion","destInterface":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"operation":"GET","apiId":"apiId","outputParameters":""}]} + invocation_log = {"supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","aefId":"aefId","logs":[{"apiName":"apiName","invocationTime":"2000-01-23T04:56:07.000+00:00","srcInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"fwdInterface":"fwdInterface","resourceName":"resourceName","uri":"uri","inputParameters":"","invocationLatency":0,"result":"result","protocol":"HTTP_1_1","apiVersion":"apiVersion","destInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"operation":"GET","apiId":"apiId","outputParameters":""},{"apiName":"apiName","invocationTime":"2000-01-23T04:56:07.000+00:00","srcInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"fwdInterface":"fwdInterface","resourceName":"resourceName","uri":"uri","inputParameters":"","invocationLatency":0,"result":"result","protocol":"HTTP_1_1","apiVersion":"apiVersion","destInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"operation":"GET","apiId":"apiId","outputParameters":""}]} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/typing_utils.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/typing_utils.py index d21c4f63..74e3c913 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/typing_utils.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/typing_utils.py @@ -1,6 +1,7 @@ import sys if sys.version_info < (3, 7): + import typing def is_generic(klass): """ Determine whether klass is a generic class """ diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py index 2edd1f35..46725d89 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py @@ -1,3 +1,4 @@ +import sys from setuptools import setup, find_packages NAME = "api_invocation_logs" @@ -30,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['api_invocation_logs=api_invocation_logs.__main__:main']}, long_description="""\ - API for invocation logs. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for invocation logs. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) -- GitLab From 0b8c3aea9825dec622870ea0302b8c1fd24164ac Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Mon, 7 Apr 2025 12:42:51 +0200 Subject: [PATCH 098/157] Publish API realease V18.7.0 --- .../.openapi-generator/FILES | 1 + .../.openapi-generator/VERSION | 2 +- .../README.md | 2 +- .../controllers/default_controller.py | 6 - .../controllers/security_controller.py | 2 +- .../published_apis/models/__init__.py | 42 +++++++ .../published_apis/models/aef_location.py | 7 +- .../published_apis/models/aef_profile.py | 45 +++++++- .../published_apis/models/api_status.py | 3 +- .../published_apis/models/base_model.py | 1 + .../published_apis/models/civic_address.py | 3 +- .../models/communication_type.py | 3 +- .../published_apis/models/custom_operation.py | 7 +- .../published_apis/models/data_format.py | 3 +- .../published_apis/models/ellipsoid_arc.py | 9 +- .../published_apis/models/gad_shape.py | 6 +- .../published_apis/models/geographic_area.py | 22 +++- .../models/geographical_coordinates.py | 3 +- .../models/interface_description.py | 47 ++++++-- .../published_apis/models/invalid_param.py | 3 +- .../published_apis/models/ip_addr_range.py | 7 +- .../models/ipv4_address_range.py | 10 +- .../published_apis/models/ipv6_addr1.py | 3 +- .../models/ipv6_address_range.py | 6 +- .../local2d_point_uncertainty_ellipse.py | 11 +- .../local3d_point_uncertainty_ellipsoid.py | 49 +++++++- .../published_apis/models/local_origin.py | 74 +++++++++++- .../models/o_auth_grant_type.py | 34 ++++++ .../published_apis/models/operation.py | 3 +- .../published_apis/models/point.py | 9 +- .../published_apis/models/point_altitude.py | 9 +- .../models/point_altitude_uncertainty.py | 10 +- .../models/point_uncertainty_circle.py | 9 +- .../models/point_uncertainty_ellipse.py | 10 +- .../published_apis/models/polygon.py | 9 +- .../published_apis/models/problem_details.py | 11 +- .../published_apis/models/protocol.py | 3 +- .../models/published_api_path.py | 3 +- .../models/relative_cartesian_location.py | 3 +- .../published_apis/models/resource.py | 8 +- .../published_apis/models/security_method.py | 3 +- .../models/service_api_description.py | 17 ++- .../models/service_api_description_patch.py | 14 ++- .../published_apis/models/service_kpis.py | 14 ++- .../models/shareable_information.py | 3 +- .../models/supported_gad_shapes.py | 3 +- .../models/uncertainty_ellipse.py | 3 +- .../models/uncertainty_ellipsoid.py | 3 +- .../published_apis/models/version.py | 7 +- .../published_apis/openapi/openapi.yaml | 109 +++++++++++++++--- .../published_apis/test/__init__.py | 1 + .../test/test_default_controller.py | 7 +- ...individual_apf_published_api_controller.py | 4 + .../published_apis/typing_utils.py | 1 + .../published_apis/util.py | 1 + .../setup.py | 1 + 56 files changed, 569 insertions(+), 120 deletions(-) create mode 100644 services/TS29222_CAPIF_Publish_Service_API/published_apis/models/o_auth_grant_type.py diff --git a/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/FILES index a238cf9c..44333b51 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/FILES @@ -34,6 +34,7 @@ published_apis/models/ipv6_address_range.py published_apis/models/local2d_point_uncertainty_ellipse.py published_apis/models/local3d_point_uncertainty_ellipsoid.py published_apis/models/local_origin.py +published_apis/models/o_auth_grant_type.py published_apis/models/operation.py published_apis/models/point.py published_apis/models/point_altitude.py diff --git a/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/VERSION index 18bb4182..b23eb275 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.11.0 diff --git a/services/TS29222_CAPIF_Publish_Service_API/README.md b/services/TS29222_CAPIF_Publish_Service_API/README.md index a8ee2575..60ff8b06 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/README.md +++ b/services/TS29222_CAPIF_Publish_Service_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m openapi_server +python3 -m published_apis ``` and open your browser to here: diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py index 695b3ae2..4f43631c 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py @@ -14,7 +14,6 @@ service_operations = PublishServiceOperations() valid_user = ControlAccess() - def cert_validation(): def _cert_validation(f): @wraps(f) @@ -51,7 +50,6 @@ def cert_validation(): return __cert_validation return _cert_validation - @cert_validation() def apf_id_service_apis_get(apf_id): # noqa: E501 """apf_id_service_apis_get @@ -68,7 +66,6 @@ def apf_id_service_apis_get(apf_id): # noqa: E501 return res - @cert_validation() def apf_id_service_apis_post(apf_id, body): # noqa: E501 """apf_id_service_apis_post @@ -114,7 +111,6 @@ def apf_id_service_apis_post(apf_id, body): # noqa: E501 return res - @cert_validation() def apf_id_service_apis_service_api_id_delete(service_api_id, apf_id): # noqa: E501 """apf_id_service_apis_service_api_id_delete @@ -134,7 +130,6 @@ def apf_id_service_apis_service_api_id_delete(service_api_id, apf_id): # noqa: return res - @cert_validation() def apf_id_service_apis_service_api_id_get(service_api_id, apf_id): # noqa: E501 """apf_id_service_apis_service_api_id_get @@ -153,7 +148,6 @@ def apf_id_service_apis_service_api_id_get(service_api_id, apf_id): # noqa: E50 return res - @cert_validation() def apf_id_service_apis_service_api_id_put(service_api_id, apf_id, body): # noqa: E501 """apf_id_service_apis_service_api_id_put diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/security_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/security_controller.py index 139597f9..6d294ffd 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/security_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/security_controller.py @@ -1,2 +1,2 @@ - +from typing import List diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/__init__.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/__init__.py index d036df69..809cf1b1 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/__init__.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/__init__.py @@ -1,2 +1,44 @@ # flake8: noqa # import models into model package +from published_apis.models.aef_location import AefLocation +from published_apis.models.aef_profile import AefProfile +from published_apis.models.api_status import ApiStatus +from published_apis.models.civic_address import CivicAddress +from published_apis.models.communication_type import CommunicationType +from published_apis.models.custom_operation import CustomOperation +from published_apis.models.data_format import DataFormat +from published_apis.models.ellipsoid_arc import EllipsoidArc +from published_apis.models.gad_shape import GADShape +from published_apis.models.geographic_area import GeographicArea +from published_apis.models.geographical_coordinates import GeographicalCoordinates +from published_apis.models.interface_description import InterfaceDescription +from published_apis.models.invalid_param import InvalidParam +from published_apis.models.ip_addr_range import IpAddrRange +from published_apis.models.ipv4_address_range import Ipv4AddressRange +from published_apis.models.ipv6_addr1 import Ipv6Addr1 +from published_apis.models.ipv6_address_range import Ipv6AddressRange +from published_apis.models.local2d_point_uncertainty_ellipse import Local2dPointUncertaintyEllipse +from published_apis.models.local3d_point_uncertainty_ellipsoid import Local3dPointUncertaintyEllipsoid +from published_apis.models.local_origin import LocalOrigin +from published_apis.models.o_auth_grant_type import OAuthGrantType +from published_apis.models.operation import Operation +from published_apis.models.point import Point +from published_apis.models.point_altitude import PointAltitude +from published_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty +from published_apis.models.point_uncertainty_circle import PointUncertaintyCircle +from published_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse +from published_apis.models.polygon import Polygon +from published_apis.models.problem_details import ProblemDetails +from published_apis.models.protocol import Protocol +from published_apis.models.published_api_path import PublishedApiPath +from published_apis.models.relative_cartesian_location import RelativeCartesianLocation +from published_apis.models.resource import Resource +from published_apis.models.security_method import SecurityMethod +from published_apis.models.service_api_description import ServiceAPIDescription +from published_apis.models.service_api_description_patch import ServiceAPIDescriptionPatch +from published_apis.models.service_kpis import ServiceKpis +from published_apis.models.shareable_information import ShareableInformation +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis.models.uncertainty_ellipse import UncertaintyEllipse +from published_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid +from published_apis.models.version import Version diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_location.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_location.py index 40e90aa6..ccc48596 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_location.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_location.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.civic_address import CivicAddress +from published_apis.models.geographic_area import GeographicArea +from published_apis import util + from published_apis.models.civic_address import CivicAddress # noqa: E501 from published_apis.models.geographic_area import GeographicArea # noqa: E501 - class AefLocation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py index 8d8ae470..249c595e 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py @@ -1,25 +1,36 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from published_apis.models.base_model import Model +from published_apis.models.aef_location import AefLocation +from published_apis.models.data_format import DataFormat +from published_apis.models.interface_description import InterfaceDescription +from published_apis.models.ip_addr_range import IpAddrRange +from published_apis.models.o_auth_grant_type import OAuthGrantType +from published_apis.models.protocol import Protocol +from published_apis.models.security_method import SecurityMethod +from published_apis.models.service_kpis import ServiceKpis +from published_apis.models.version import Version from published_apis import util + from published_apis.models.aef_location import AefLocation # noqa: E501 -from published_apis.models.base_model import Model from published_apis.models.data_format import DataFormat # noqa: E501 from published_apis.models.interface_description import InterfaceDescription # noqa: E501 from published_apis.models.ip_addr_range import IpAddrRange # noqa: E501 +from published_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from published_apis.models.protocol import Protocol # noqa: E501 from published_apis.models.security_method import SecurityMethod # noqa: E501 from published_apis.models.service_kpis import ServiceKpis # noqa: E501 from published_apis.models.version import Version # noqa: E501 - class AefProfile(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ - def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 + def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, grant_types=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 """AefProfile - a model defined in OpenAPI :param aef_id: The aef_id of this AefProfile. # noqa: E501 @@ -32,6 +43,8 @@ class AefProfile(Model): :type data_format: DataFormat :param security_methods: The security_methods of this AefProfile. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this AefProfile. # noqa: E501 + :type grant_types: List[OAuthGrantType] :param domain_name: The domain_name of this AefProfile. # noqa: E501 :type domain_name: str :param interface_descriptions: The interface_descriptions of this AefProfile. # noqa: E501 @@ -49,6 +62,7 @@ class AefProfile(Model): 'protocol': Protocol, 'data_format': DataFormat, 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType], 'domain_name': str, 'interface_descriptions': List[InterfaceDescription], 'aef_location': AefLocation, @@ -62,6 +76,7 @@ class AefProfile(Model): 'protocol': 'protocol', 'data_format': 'dataFormat', 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes', 'domain_name': 'domainName', 'interface_descriptions': 'interfaceDescriptions', 'aef_location': 'aefLocation', @@ -74,6 +89,7 @@ class AefProfile(Model): self._protocol = protocol self._data_format = data_format self._security_methods = security_methods + self._grant_types = grant_types self._domain_name = domain_name self._interface_descriptions = interface_descriptions self._aef_location = aef_location @@ -210,6 +226,29 @@ class AefProfile(Model): self._security_methods = security_methods + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this AefProfile. + + + :return: The grant_types of this AefProfile. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this AefProfile. + + + :param grant_types: The grant_types of this AefProfile. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types + @property def domain_name(self) -> str: """Gets the domain_name of this AefProfile. diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py index 14b0d36b..0492b259 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class ApiStatus(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/base_model.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/base_model.py index d4fac36d..ae24c559 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/base_model.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/base_model.py @@ -1,4 +1,5 @@ import pprint + import typing from published_apis import util diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/civic_address.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/civic_address.py index 94b868be..b4fa7c06 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/civic_address.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/civic_address.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class CivicAddress(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/communication_type.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/communication_type.py index d69e24ba..a91645f4 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/communication_type.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/communication_type.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class CommunicationType(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py index f99e4aed..1f4a66a6 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.communication_type import CommunicationType +from published_apis.models.operation import Operation +from published_apis import util + from published_apis.models.communication_type import CommunicationType # noqa: E501 from published_apis.models.operation import Operation # noqa: E501 - class CustomOperation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/data_format.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/data_format.py index b8892d62..5c6c9072 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/data_format.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/data_format.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class DataFormat(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py index 550649e4..ca81b714 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.gad_shape import GADShape +from published_apis.models.geographical_coordinates import GeographicalCoordinates +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis import util + +from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class EllipsoidArc(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py index 1bee0024..f4754606 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis import util +from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 class GADShape(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py index 4c88245f..0fa074cd 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py @@ -1,13 +1,31 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.ellipsoid_arc import EllipsoidArc +from published_apis.models.geographical_coordinates import GeographicalCoordinates +from published_apis.models.point import Point +from published_apis.models.point_altitude import PointAltitude +from published_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty +from published_apis.models.point_uncertainty_circle import PointUncertaintyCircle +from published_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse +from published_apis.models.polygon import Polygon +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis.models.uncertainty_ellipse import UncertaintyEllipse +from published_apis import util + +from published_apis.models.ellipsoid_arc import EllipsoidArc # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from published_apis.models.point import Point # noqa: E501 +from published_apis.models.point_altitude import PointAltitude # noqa: E501 +from published_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty # noqa: E501 +from published_apis.models.point_uncertainty_circle import PointUncertaintyCircle # noqa: E501 +from published_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse # noqa: E501 +from published_apis.models.polygon import Polygon # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class GeographicArea(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographical_coordinates.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographical_coordinates.py index 7ef6a2cd..49c59769 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographical_coordinates.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographical_coordinates.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class GeographicalCoordinates(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py index dec95962..9dc53d39 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py @@ -1,11 +1,16 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.security_method import SecurityMethod # noqa: E501 +from published_apis.models.o_auth_grant_type import OAuthGrantType +from published_apis.models.security_method import SecurityMethod +import re +from published_apis import util +from published_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from published_apis.models.security_method import SecurityMethod # noqa: E501 +import re # noqa: E501 class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +18,7 @@ class InterfaceDescription(Model): Do not edit the class manually. """ - def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None): # noqa: E501 + def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None, grant_types=None): # noqa: E501 """InterfaceDescription - a model defined in OpenAPI :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 @@ -28,6 +33,8 @@ class InterfaceDescription(Model): :type api_prefix: str :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this InterfaceDescription. # noqa: E501 + :type grant_types: List[OAuthGrantType] """ self.openapi_types = { 'ipv4_addr': str, @@ -35,7 +42,8 @@ class InterfaceDescription(Model): 'fqdn': str, 'port': int, 'api_prefix': str, - 'security_methods': List[SecurityMethod] + 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType] } self.attribute_map = { @@ -44,7 +52,8 @@ class InterfaceDescription(Model): 'fqdn': 'fqdn', 'port': 'port', 'api_prefix': 'apiPrefix', - 'security_methods': 'securityMethods' + 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes' } self._ipv4_addr = ipv4_addr @@ -53,6 +62,7 @@ class InterfaceDescription(Model): self._port = port self._api_prefix = api_prefix self._security_methods = security_methods + self._grant_types = grant_types @classmethod def from_dict(cls, dikt) -> 'InterfaceDescription': @@ -136,7 +146,7 @@ class InterfaceDescription(Model): if fqdn is not None and len(fqdn) < 4: raise ValueError("Invalid value for `fqdn`, length must be greater than or equal to `4`") # noqa: E501 if fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', fqdn): # noqa: E501 - raise ValueError("Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + raise ValueError(r"Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 self._fqdn = fqdn @@ -214,3 +224,26 @@ class InterfaceDescription(Model): raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 self._security_methods = security_methods + + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this InterfaceDescription. + + + :return: The grant_types of this InterfaceDescription. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this InterfaceDescription. + + + :param grant_types: The grant_types of this InterfaceDescription. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/invalid_param.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/invalid_param.py index 4dd00c7a..16472ecc 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/invalid_param.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/invalid_param.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py index e4bffa1c..7934c226 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.ipv4_address_range import Ipv4AddressRange +from published_apis.models.ipv6_address_range import Ipv6AddressRange +from published_apis import util + from published_apis.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 from published_apis.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 - class IpAddrRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv4_address_range.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv4_address_range.py index bfca85a7..f72ef00e 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv4_address_range.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv4_address_range.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +import re +from published_apis import util +import re # noqa: E501 class Ipv4AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -67,7 +69,7 @@ class Ipv4AddressRange(Model): if start is None: raise ValueError("Invalid value for `start`, must not be `None`") # noqa: E501 if start is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', start): # noqa: E501 - raise ValueError("Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._start = start @@ -94,6 +96,6 @@ class Ipv4AddressRange(Model): if end is None: raise ValueError("Invalid value for `end`, must not be `None`") # noqa: E501 if end is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', end): # noqa: E501 - raise ValueError("Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._end = end diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_addr1.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_addr1.py index 082fbaf1..268ec666 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_addr1.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_addr1.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class Ipv6Addr1(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_address_range.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_address_range.py index 3270bfc5..37f319c8 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_address_range.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_address_range.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 +from published_apis.models.ipv6_addr1 import Ipv6Addr1 +from published_apis import util +from published_apis.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 class Ipv6AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py index 777b98ed..2c575408 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py @@ -1,14 +1,21 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.gad_shape import GADShape +from published_apis.models.local_origin import LocalOrigin +from published_apis.models.relative_cartesian_location import RelativeCartesianLocation +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis.models.uncertainty_ellipse import UncertaintyEllipse +from published_apis import util + +from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.local_origin import LocalOrigin # noqa: E501 from published_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class Local2dPointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py index 728f69a9..2dfe87ae 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py @@ -1,21 +1,28 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.gad_shape import GADShape +from published_apis.models.local_origin import LocalOrigin +from published_apis.models.relative_cartesian_location import RelativeCartesianLocation +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid +from published_apis import util + +from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.local_origin import LocalOrigin # noqa: E501 from published_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from published_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 - class Local3dPointUncertaintyEllipsoid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ - def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None): # noqa: E501 + def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None, v_confidence=None): # noqa: E501 """Local3dPointUncertaintyEllipsoid - a model defined in OpenAPI :param shape: The shape of this Local3dPointUncertaintyEllipsoid. # noqa: E501 @@ -28,13 +35,16 @@ class Local3dPointUncertaintyEllipsoid(Model): :type uncertainty_ellipsoid: UncertaintyEllipsoid :param confidence: The confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 :type confidence: int + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type v_confidence: int """ self.openapi_types = { 'shape': SupportedGADShapes, 'local_origin': LocalOrigin, 'point': RelativeCartesianLocation, 'uncertainty_ellipsoid': UncertaintyEllipsoid, - 'confidence': int + 'confidence': int, + 'v_confidence': int } self.attribute_map = { @@ -42,7 +52,8 @@ class Local3dPointUncertaintyEllipsoid(Model): 'local_origin': 'localOrigin', 'point': 'point', 'uncertainty_ellipsoid': 'uncertaintyEllipsoid', - 'confidence': 'confidence' + 'confidence': 'confidence', + 'v_confidence': 'vConfidence' } self._shape = shape @@ -50,6 +61,7 @@ class Local3dPointUncertaintyEllipsoid(Model): self._point = point self._uncertainty_ellipsoid = uncertainty_ellipsoid self._confidence = confidence + self._v_confidence = v_confidence @classmethod def from_dict(cls, dikt) -> 'Local3dPointUncertaintyEllipsoid': @@ -182,3 +194,30 @@ class Local3dPointUncertaintyEllipsoid(Model): raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 self._confidence = confidence + + @property + def v_confidence(self) -> int: + """Gets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :return: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :rtype: int + """ + return self._v_confidence + + @v_confidence.setter + def v_confidence(self, v_confidence: int): + """Sets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :type v_confidence: int + """ + if v_confidence is not None and v_confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value less than or equal to `100`") # noqa: E501 + if v_confidence is not None and v_confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._v_confidence = v_confidence diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py index 82df6391..6686d14d 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py @@ -1,10 +1,14 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from published_apis.models.geographic_area import GeographicArea +from published_apis.models.geographical_coordinates import GeographicalCoordinates +from published_apis import util +from published_apis.models.geographic_area import GeographicArea # noqa: E501 +from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 class LocalOrigin(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,26 +16,36 @@ class LocalOrigin(Model): Do not edit the class manually. """ - def __init__(self, coordinate_id=None, point=None): # noqa: E501 + def __init__(self, coordinate_id=None, point=None, area=None, horiz_axes_orientation=None): # noqa: E501 """LocalOrigin - a model defined in OpenAPI :param coordinate_id: The coordinate_id of this LocalOrigin. # noqa: E501 :type coordinate_id: str :param point: The point of this LocalOrigin. # noqa: E501 :type point: GeographicalCoordinates + :param area: The area of this LocalOrigin. # noqa: E501 + :type area: GeographicArea + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. # noqa: E501 + :type horiz_axes_orientation: int """ self.openapi_types = { 'coordinate_id': str, - 'point': GeographicalCoordinates + 'point': GeographicalCoordinates, + 'area': GeographicArea, + 'horiz_axes_orientation': int } self.attribute_map = { 'coordinate_id': 'coordinateId', - 'point': 'point' + 'point': 'point', + 'area': 'area', + 'horiz_axes_orientation': 'horizAxesOrientation' } self._coordinate_id = coordinate_id self._point = point + self._area = area + self._horiz_axes_orientation = horiz_axes_orientation @classmethod def from_dict(cls, dikt) -> 'LocalOrigin': @@ -62,6 +76,8 @@ class LocalOrigin(Model): :param coordinate_id: The coordinate_id of this LocalOrigin. :type coordinate_id: str """ + if coordinate_id is None: + raise ValueError("Invalid value for `coordinate_id`, must not be `None`") # noqa: E501 self._coordinate_id = coordinate_id @@ -85,3 +101,51 @@ class LocalOrigin(Model): """ self._point = point + + @property + def area(self) -> GeographicArea: + """Gets the area of this LocalOrigin. + + + :return: The area of this LocalOrigin. + :rtype: GeographicArea + """ + return self._area + + @area.setter + def area(self, area: GeographicArea): + """Sets the area of this LocalOrigin. + + + :param area: The area of this LocalOrigin. + :type area: GeographicArea + """ + + self._area = area + + @property + def horiz_axes_orientation(self) -> int: + """Gets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :return: The horiz_axes_orientation of this LocalOrigin. + :rtype: int + """ + return self._horiz_axes_orientation + + @horiz_axes_orientation.setter + def horiz_axes_orientation(self, horiz_axes_orientation: int): + """Sets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. + :type horiz_axes_orientation: int + """ + if horiz_axes_orientation is not None and horiz_axes_orientation > 3600: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value less than or equal to `3600`") # noqa: E501 + if horiz_axes_orientation is not None and horiz_axes_orientation < 0: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value greater than or equal to `0`") # noqa: E501 + + self._horiz_axes_orientation = horiz_axes_orientation diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/o_auth_grant_type.py new file mode 100644 index 00000000..d957daf8 --- /dev/null +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/o_auth_grant_type.py @@ -0,0 +1,34 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from published_apis.models.base_model import Model +from published_apis import util + + +class OAuthGrantType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """OAuthGrantType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'OAuthGrantType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OAuthGrantType of this OAuthGrantType. # noqa: E501 + :rtype: OAuthGrantType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/operation.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/operation.py index c59a6702..0923ce76 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/operation.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/operation.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class Operation(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py index 433aa9e8..d16cbaaa 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.gad_shape import GADShape +from published_apis.models.geographical_coordinates import GeographicalCoordinates +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis import util + +from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class Point(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py index 7bfb24ae..0fb374f7 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.gad_shape import GADShape +from published_apis.models.geographical_coordinates import GeographicalCoordinates +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis import util + +from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class PointAltitude(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py index 9bc6dbd5..cf96f55d 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py @@ -1,13 +1,19 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.gad_shape import GADShape +from published_apis.models.geographical_coordinates import GeographicalCoordinates +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis.models.uncertainty_ellipse import UncertaintyEllipse +from published_apis import util + +from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class PointAltitudeUncertainty(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py index 7b15b671..3b773f51 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.gad_shape import GADShape +from published_apis.models.geographical_coordinates import GeographicalCoordinates +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis import util + +from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class PointUncertaintyCircle(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py index 13c8e1b7..ea57f68d 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py @@ -1,13 +1,19 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.gad_shape import GADShape +from published_apis.models.geographical_coordinates import GeographicalCoordinates +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis.models.uncertainty_ellipse import UncertaintyEllipse +from published_apis import util + +from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class PointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py index d4ce9418..8a3f6baa 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.gad_shape import GADShape +from published_apis.models.geographical_coordinates import GeographicalCoordinates +from published_apis.models.supported_gad_shapes import SupportedGADShapes +from published_apis import util + +from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class Polygon(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/problem_details.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/problem_details.py index ac7c9ee9..41b69ae8 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/problem_details.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/problem_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.invalid_param import InvalidParam # noqa: E501 +from published_apis.models.invalid_param import InvalidParam +import re +from published_apis import util +from published_apis.models.invalid_param import InvalidParam # noqa: E501 +import re # noqa: E501 class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -259,6 +262,6 @@ class ProblemDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/protocol.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/protocol.py index dc6ae7eb..9eb3203e 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/protocol.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/protocol.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class Protocol(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/published_api_path.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/published_api_path.py index a76f56fa..4d3538df 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/published_api_path.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/published_api_path.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class PublishedApiPath(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/relative_cartesian_location.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/relative_cartesian_location.py index 35c9dbf5..2f17cb84 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/relative_cartesian_location.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/relative_cartesian_location.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class RelativeCartesianLocation(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py index 6c8d09d8..fe7445df 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.communication_type import CommunicationType +from published_apis.models.custom_operation import CustomOperation +from published_apis.models.operation import Operation +from published_apis import util + from published_apis.models.communication_type import CommunicationType # noqa: E501 from published_apis.models.custom_operation import CustomOperation # noqa: E501 from published_apis.models.operation import Operation # noqa: E501 - class Resource(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/security_method.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/security_method.py index 01847e2b..59142370 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/security_method.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/security_method.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py index e50c9e01..d1c2fef1 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py @@ -1,14 +1,20 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from published_apis.models.base_model import Model +from published_apis.models.aef_profile import AefProfile +from published_apis.models.api_status import ApiStatus +from published_apis.models.published_api_path import PublishedApiPath +from published_apis.models.shareable_information import ShareableInformation +import re from published_apis import util + from published_apis.models.aef_profile import AefProfile # noqa: E501 from published_apis.models.api_status import ApiStatus # noqa: E501 -from published_apis.models.base_model import Model from published_apis.models.published_api_path import PublishedApiPath # noqa: E501 from published_apis.models.shareable_information import ShareableInformation # noqa: E501 - +import re # noqa: E501 class ServiceAPIDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -106,6 +112,7 @@ class ServiceAPIDescription(Model): "VendorExt": True if supp_feat_in_bin[8] == "1" else False } + @classmethod def from_dict(cls, dikt) -> 'ServiceAPIDescription': """Returns the dict as a model @@ -255,7 +262,7 @@ class ServiceAPIDescription(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features @@ -324,7 +331,7 @@ class ServiceAPIDescription(Model): :type api_supp_feats: str """ if api_supp_feats is not None and not re.search(r'^[A-Fa-f0-9]*$', api_supp_feats): # noqa: E501 - raise ValueError("Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._api_supp_feats = api_supp_feats diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py index d812d30d..71dd39c9 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py @@ -1,14 +1,20 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from published_apis.models.base_model import Model +from published_apis.models.aef_profile import AefProfile +from published_apis.models.api_status import ApiStatus +from published_apis.models.published_api_path import PublishedApiPath +from published_apis.models.shareable_information import ShareableInformation +import re from published_apis import util + from published_apis.models.aef_profile import AefProfile # noqa: E501 from published_apis.models.api_status import ApiStatus # noqa: E501 -from published_apis.models.base_model import Model from published_apis.models.published_api_path import PublishedApiPath # noqa: E501 from published_apis.models.shareable_information import ShareableInformation # noqa: E501 - +import re # noqa: E501 class ServiceAPIDescriptionPatch(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -212,7 +218,7 @@ class ServiceAPIDescriptionPatch(Model): :type api_supp_feats: str """ if api_supp_feats is not None and not re.search(r'^[A-Fa-f0-9]*$', api_supp_feats): # noqa: E501 - raise ValueError("Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._api_supp_feats = api_supp_feats diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_kpis.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_kpis.py index 2d0b3c17..f4b8ae12 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_kpis.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_kpis.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +import re +from published_apis import util +import re # noqa: E501 class ServiceKpis(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -170,7 +172,7 @@ class ServiceKpis(Model): :type aval_comp: str """ if aval_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_comp): # noqa: E501 - raise ValueError("Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 self._aval_comp = aval_comp @@ -195,7 +197,7 @@ class ServiceKpis(Model): :type aval_gra_comp: str """ if aval_gra_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_gra_comp): # noqa: E501 - raise ValueError("Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 self._aval_gra_comp = aval_gra_comp @@ -220,7 +222,7 @@ class ServiceKpis(Model): :type aval_mem: str """ if aval_mem is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_mem): # noqa: E501 - raise ValueError("Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 self._aval_mem = aval_mem @@ -245,7 +247,7 @@ class ServiceKpis(Model): :type aval_stor: str """ if aval_stor is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_stor): # noqa: E501 - raise ValueError("Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 self._aval_stor = aval_stor diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py index 548e3753..ff4aea1c 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class ShareableInformation(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/supported_gad_shapes.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/supported_gad_shapes.py index 7b5da399..50d7db72 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/supported_gad_shapes.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/supported_gad_shapes.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class SupportedGADShapes(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipse.py index 7fc3e172..2aef9633 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipse.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class UncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipsoid.py index 7a89fe96..88a428d4 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipsoid.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis import util class UncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py index a53e20f2..4126d65a 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from published_apis import util from published_apis.models.base_model import Model +from published_apis.models.custom_operation import CustomOperation +from published_apis.models.resource import Resource +from published_apis import util + from published_apis.models.custom_operation import CustomOperation # noqa: E501 from published_apis.models.resource import Resource # noqa: E501 - class Version(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml b/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml index 041eed50..149cc4c7 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml @@ -3,9 +3,9 @@ info: description: "API for publishing service APIs. \n© 2024, 3GPP Organizational Partners\ \ (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Publish_Service_API - version: 1.3.0-alpha.5 + version: 1.3.1 externalDocs: - description: 3GPP TS 29.222 V18.5.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V18.7.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/published-apis/v1" @@ -715,6 +715,9 @@ components: - aefIds aefProfiles: - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -893,6 +896,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -901,6 +907,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -918,6 +927,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1096,6 +1108,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1104,6 +1119,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1185,6 +1203,9 @@ components: description: Represents the description of an API's interface. example: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1193,13 +1214,10 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr nullable: true - oneOf: - - required: - - ipv4Addr - - required: - - ipv6Addr - - required: - - fqdn + oneOf: + - required: ["fqdn"] + - required: ["ipv4Addr"] + - required: ["ipv6Addr"] properties: ipv4Addr: description: | @@ -1238,12 +1256,21 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array title: InterfaceDescription type: object AefProfile: description: Represents the AEF profile data. example: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1422,6 +1449,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1430,6 +1460,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1447,11 +1480,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp nullable: true - oneOf: - - required: - - domainName - - required: - - interfaceDescriptions + oneOf: + - required: ["domainName"] + - required: ["interfaceDescriptions"] properties: aefId: description: Identifier of the API exposing function @@ -1475,6 +1506,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array domainName: description: Domain to which API belongs to title: domainName @@ -1907,7 +1944,9 @@ components: title: ServiceKpis type: object IpAddrRange: - anyOf: [] + anyOf: + - required: ["ueIpv4AddrRanges"] + - required: ["ueIpv6AddrRanges"] description: Represents the list of public IP ranges example: ueIpv4AddrRanges: @@ -2112,6 +2151,23 @@ components: minimum: 0 title: Port type: integer + OAuthGrantType: + anyOf: + - enum: + - CLIENT_CREDENTIALS + - AUTHORIZATION_CODE + - AUTHORIZATION_CODE_WITH_PKCE + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. + type: string + description: "Indicates the supported authorization flow (e.g. client credentials\ + \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ + \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ + \ credentials flow.\n- AUTHORIZATION_CODE: Indicate that the grant type is\ + \ authorization code.\n- AUTHORIZATION_CODE_WITH_PKCE: Indicate that the grant\ + \ type is authorization code with PKCE.\n" + title: OAuthGrantType DateTime: description: string with format "date-time" as defined in OpenAPI. format: date-time @@ -2551,8 +2607,26 @@ components: type: string point: $ref: '#/components/schemas/GeographicalCoordinates' + area: + $ref: '#/components/schemas/GeographicArea' + horizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in + 0.1 degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer + required: + - coordinateId title: LocalOrigin type: object + HorizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in 0.1 + degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer RelativeCartesianLocation: description: Relative Cartesian Location properties: @@ -2588,6 +2662,8 @@ components: $ref: '#/components/schemas/UncertaintyEllipsoid' confidence: $ref: '#/components/schemas/Confidence' + vConfidence: + $ref: '#/components/schemas/Confidence' required: - confidence - localOrigin @@ -2687,9 +2763,6 @@ components: title: Ipv6AddressRange type: object Ipv6Addr_1: - allOf: - - pattern: "^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$" - - pattern: "^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$" description: | String identifying an IPv6 address formatted according to clause 4 of RFC5952. The mixed IPv4 IPv6 notation according to clause 5 of RFC5952 shall not be used. example: 2001:db8:85a3::8a2e:370:7334 diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/__init__.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/__init__.py index 07e31c34..108a343a 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/__init__.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/__init__.py @@ -2,6 +2,7 @@ import logging import connexion from flask_testing import TestCase + from published_apis.encoder import JSONEncoder diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py index 7f824b92..f194cded 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py @@ -1,6 +1,9 @@ import unittest from flask import json + +from published_apis.models.problem_details import ProblemDetails # noqa: E501 +from published_apis.models.service_api_description import ServiceAPIDescription # noqa: E501 from published_apis.test import BaseTestCase @@ -27,7 +30,7 @@ class TestDefaultController(BaseTestCase): """ - service_api_description = {"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}} + service_api_description = {"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', @@ -76,7 +79,7 @@ class TestDefaultController(BaseTestCase): """ - service_api_description = {"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}} + service_api_description = {"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py index 76ef0795..c9978525 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py @@ -1,6 +1,10 @@ import unittest from flask import json + +from published_apis.models.problem_details import ProblemDetails # noqa: E501 +from published_apis.models.service_api_description import ServiceAPIDescription # noqa: E501 +from published_apis.models.service_api_description_patch import ServiceAPIDescriptionPatch # noqa: E501 from published_apis.test import BaseTestCase diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/typing_utils.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/typing_utils.py index d21c4f63..74e3c913 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/typing_utils.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/typing_utils.py @@ -1,6 +1,7 @@ import sys if sys.version_info < (3, 7): + import typing def is_generic(klass): """ Determine whether klass is a generic class """ diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/util.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/util.py index 1b195665..2e3d203f 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/util.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/util.py @@ -1,5 +1,6 @@ import datetime +import typing from published_apis import typing_utils diff --git a/services/TS29222_CAPIF_Publish_Service_API/setup.py b/services/TS29222_CAPIF_Publish_Service_API/setup.py index 8b1c9912..5ae15b44 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/setup.py +++ b/services/TS29222_CAPIF_Publish_Service_API/setup.py @@ -1,3 +1,4 @@ +import sys from setuptools import setup, find_packages NAME = "published_apis" -- GitLab From 2f414d37c63087ef1bf53d089ef53ab1bc48a1f4 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Mon, 7 Apr 2025 13:02:49 +0200 Subject: [PATCH 099/157] Routing API realease V18.6.0 --- .../.openapi-generator/FILES | 1 + .../.openapi-generator/VERSION | 2 +- .../TS29222_CAPIF_Routing_Info_API/README.md | 2 +- .../capif_routing_info/models/__init__.py | 41 ++++++ .../capif_routing_info/models/aef_location.py | 7 +- .../capif_routing_info/models/aef_profile.py | 45 ++++++- .../capif_routing_info/models/base_model.py | 1 + .../models/civic_address.py | 3 +- .../models/communication_type.py | 3 +- .../models/custom_operation.py | 7 +- .../capif_routing_info/models/data_format.py | 3 +- .../models/ellipsoid_arc.py | 9 +- .../capif_routing_info/models/gad_shape.py | 6 +- .../models/geographic_area.py | 22 +++- .../models/interface_description.py | 47 ++++++- .../models/invalid_param.py | 3 +- .../models/ip_addr_range.py | 7 +- .../models/ipv4_address_range.py | 10 +- .../models/ipv4_address_range1.py | 10 +- .../capif_routing_info/models/ipv6_addr1.py | 3 +- .../models/ipv6_address_range.py | 3 +- .../models/ipv6_address_range1.py | 6 +- .../local3d_point_uncertainty_ellipsoid.py | 38 +++++- .../capif_routing_info/models/local_origin.py | 74 ++++++++++- .../models/o_auth_grant_type.py | 34 +++++ .../capif_routing_info/models/operation.py | 3 +- .../capif_routing_info/models/point.py | 9 +- .../models/point_altitude.py | 9 +- .../capif_routing_info/models/polygon.py | 9 +- .../models/problem_details.py | 11 +- .../capif_routing_info/models/protocol.py | 3 +- .../capif_routing_info/models/resource.py | 8 +- .../capif_routing_info/models/routing_info.py | 6 +- .../capif_routing_info/models/routing_rule.py | 8 +- .../models/security_method.py | 3 +- .../capif_routing_info/models/service_kpis.py | 14 +- .../models/supported_gad_shapes.py | 3 +- .../models/uncertainty_ellipse.py | 3 +- .../capif_routing_info/models/version.py | 7 +- .../capif_routing_info/openapi/openapi.yaml | 120 +++++++++++++++--- .../capif_routing_info/test/__init__.py | 3 +- .../test/test_default_controller.py | 4 + .../TS29222_CAPIF_Routing_Info_API/setup.py | 3 +- 43 files changed, 515 insertions(+), 98 deletions(-) create mode 100644 services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/o_auth_grant_type.py diff --git a/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/FILES index be8f43b7..850cbed4 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/FILES @@ -34,6 +34,7 @@ capif_routing_info/models/ipv6_address_range1.py capif_routing_info/models/local2d_point_uncertainty_ellipse.py capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py capif_routing_info/models/local_origin.py +capif_routing_info/models/o_auth_grant_type.py capif_routing_info/models/operation.py capif_routing_info/models/point.py capif_routing_info/models/point_altitude.py diff --git a/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/VERSION index 18bb4182..b23eb275 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.11.0 diff --git a/services/TS29222_CAPIF_Routing_Info_API/README.md b/services/TS29222_CAPIF_Routing_Info_API/README.md index edacb4a6..b239418e 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/README.md +++ b/services/TS29222_CAPIF_Routing_Info_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m openapi_server +python3 -m capif_routing_info ``` and open your browser to here: diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/__init__.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/__init__.py index d036df69..04378bc9 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/__init__.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/__init__.py @@ -1,2 +1,43 @@ # flake8: noqa # import models into model package +from capif_routing_info.models.aef_location import AefLocation +from capif_routing_info.models.aef_profile import AefProfile +from capif_routing_info.models.civic_address import CivicAddress +from capif_routing_info.models.communication_type import CommunicationType +from capif_routing_info.models.custom_operation import CustomOperation +from capif_routing_info.models.data_format import DataFormat +from capif_routing_info.models.ellipsoid_arc import EllipsoidArc +from capif_routing_info.models.gad_shape import GADShape +from capif_routing_info.models.geographic_area import GeographicArea +from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates +from capif_routing_info.models.interface_description import InterfaceDescription +from capif_routing_info.models.invalid_param import InvalidParam +from capif_routing_info.models.ip_addr_range import IpAddrRange +from capif_routing_info.models.ipv4_address_range import Ipv4AddressRange +from capif_routing_info.models.ipv4_address_range1 import Ipv4AddressRange1 +from capif_routing_info.models.ipv6_addr1 import Ipv6Addr1 +from capif_routing_info.models.ipv6_address_range import Ipv6AddressRange +from capif_routing_info.models.ipv6_address_range1 import Ipv6AddressRange1 +from capif_routing_info.models.local2d_point_uncertainty_ellipse import Local2dPointUncertaintyEllipse +from capif_routing_info.models.local3d_point_uncertainty_ellipsoid import Local3dPointUncertaintyEllipsoid +from capif_routing_info.models.local_origin import LocalOrigin +from capif_routing_info.models.o_auth_grant_type import OAuthGrantType +from capif_routing_info.models.operation import Operation +from capif_routing_info.models.point import Point +from capif_routing_info.models.point_altitude import PointAltitude +from capif_routing_info.models.point_altitude_uncertainty import PointAltitudeUncertainty +from capif_routing_info.models.point_uncertainty_circle import PointUncertaintyCircle +from capif_routing_info.models.point_uncertainty_ellipse import PointUncertaintyEllipse +from capif_routing_info.models.polygon import Polygon +from capif_routing_info.models.problem_details import ProblemDetails +from capif_routing_info.models.protocol import Protocol +from capif_routing_info.models.relative_cartesian_location import RelativeCartesianLocation +from capif_routing_info.models.resource import Resource +from capif_routing_info.models.routing_info import RoutingInfo +from capif_routing_info.models.routing_rule import RoutingRule +from capif_routing_info.models.security_method import SecurityMethod +from capif_routing_info.models.service_kpis import ServiceKpis +from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes +from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse +from capif_routing_info.models.uncertainty_ellipsoid import UncertaintyEllipsoid +from capif_routing_info.models.version import Version diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py index f0e756be..e60b523e 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info.models.civic_address import CivicAddress +from capif_routing_info.models.geographic_area import GeographicArea +from capif_routing_info import util + from capif_routing_info.models.civic_address import CivicAddress # noqa: E501 from capif_routing_info.models.geographic_area import GeographicArea # noqa: E501 - class AefLocation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py index ccf24ad6..2cb26e13 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py @@ -1,25 +1,36 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from capif_routing_info.models.base_model import Model +from capif_routing_info.models.aef_location import AefLocation +from capif_routing_info.models.data_format import DataFormat +from capif_routing_info.models.interface_description import InterfaceDescription +from capif_routing_info.models.ip_addr_range import IpAddrRange +from capif_routing_info.models.o_auth_grant_type import OAuthGrantType +from capif_routing_info.models.protocol import Protocol +from capif_routing_info.models.security_method import SecurityMethod +from capif_routing_info.models.service_kpis import ServiceKpis +from capif_routing_info.models.version import Version from capif_routing_info import util + from capif_routing_info.models.aef_location import AefLocation # noqa: E501 -from capif_routing_info.models.base_model import Model from capif_routing_info.models.data_format import DataFormat # noqa: E501 from capif_routing_info.models.interface_description import InterfaceDescription # noqa: E501 from capif_routing_info.models.ip_addr_range import IpAddrRange # noqa: E501 +from capif_routing_info.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from capif_routing_info.models.protocol import Protocol # noqa: E501 from capif_routing_info.models.security_method import SecurityMethod # noqa: E501 from capif_routing_info.models.service_kpis import ServiceKpis # noqa: E501 from capif_routing_info.models.version import Version # noqa: E501 - class AefProfile(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ - def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 + def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, grant_types=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 """AefProfile - a model defined in OpenAPI :param aef_id: The aef_id of this AefProfile. # noqa: E501 @@ -32,6 +43,8 @@ class AefProfile(Model): :type data_format: DataFormat :param security_methods: The security_methods of this AefProfile. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this AefProfile. # noqa: E501 + :type grant_types: List[OAuthGrantType] :param domain_name: The domain_name of this AefProfile. # noqa: E501 :type domain_name: str :param interface_descriptions: The interface_descriptions of this AefProfile. # noqa: E501 @@ -49,6 +62,7 @@ class AefProfile(Model): 'protocol': Protocol, 'data_format': DataFormat, 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType], 'domain_name': str, 'interface_descriptions': List[InterfaceDescription], 'aef_location': AefLocation, @@ -62,6 +76,7 @@ class AefProfile(Model): 'protocol': 'protocol', 'data_format': 'dataFormat', 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes', 'domain_name': 'domainName', 'interface_descriptions': 'interfaceDescriptions', 'aef_location': 'aefLocation', @@ -74,6 +89,7 @@ class AefProfile(Model): self._protocol = protocol self._data_format = data_format self._security_methods = security_methods + self._grant_types = grant_types self._domain_name = domain_name self._interface_descriptions = interface_descriptions self._aef_location = aef_location @@ -210,6 +226,29 @@ class AefProfile(Model): self._security_methods = security_methods + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this AefProfile. + + + :return: The grant_types of this AefProfile. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this AefProfile. + + + :param grant_types: The grant_types of this AefProfile. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types + @property def domain_name(self) -> str: """Gets the domain_name of this AefProfile. diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/base_model.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/base_model.py index 57cac681..48496362 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/base_model.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/base_model.py @@ -1,4 +1,5 @@ import pprint + import typing from capif_routing_info import util diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/civic_address.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/civic_address.py index e12616c9..fd306ef3 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/civic_address.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/civic_address.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class CivicAddress(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/communication_type.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/communication_type.py index 02f3063d..c355c6de 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/communication_type.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/communication_type.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class CommunicationType(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py index 6ea6b705..0e0995b2 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info.models.communication_type import CommunicationType +from capif_routing_info.models.operation import Operation +from capif_routing_info import util + from capif_routing_info.models.communication_type import CommunicationType # noqa: E501 from capif_routing_info.models.operation import Operation # noqa: E501 - class CustomOperation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/data_format.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/data_format.py index 3b453d17..83f31a21 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/data_format.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/data_format.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class DataFormat(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py index 790d70a0..345698c2 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info.models.gad_shape import GADShape +from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates +from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes +from capif_routing_info import util + +from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class EllipsoidArc(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py index de287476..d956d8d2 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes +from capif_routing_info import util +from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 class GADShape(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py index f0fd6607..5c159825 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py @@ -1,13 +1,31 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info.models.ellipsoid_arc import EllipsoidArc +from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates +from capif_routing_info.models.point import Point +from capif_routing_info.models.point_altitude import PointAltitude +from capif_routing_info.models.point_altitude_uncertainty import PointAltitudeUncertainty +from capif_routing_info.models.point_uncertainty_circle import PointUncertaintyCircle +from capif_routing_info.models.point_uncertainty_ellipse import PointUncertaintyEllipse +from capif_routing_info.models.polygon import Polygon +from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes +from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse +from capif_routing_info import util + +from capif_routing_info.models.ellipsoid_arc import EllipsoidArc # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.point import Point # noqa: E501 +from capif_routing_info.models.point_altitude import PointAltitude # noqa: E501 +from capif_routing_info.models.point_altitude_uncertainty import PointAltitudeUncertainty # noqa: E501 +from capif_routing_info.models.point_uncertainty_circle import PointUncertaintyCircle # noqa: E501 +from capif_routing_info.models.point_uncertainty_ellipse import PointUncertaintyEllipse # noqa: E501 +from capif_routing_info.models.polygon import Polygon # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 - class GeographicArea(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py index 6d0075be..f9b79570 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py @@ -1,11 +1,16 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.security_method import SecurityMethod # noqa: E501 +from capif_routing_info.models.o_auth_grant_type import OAuthGrantType +from capif_routing_info.models.security_method import SecurityMethod +import re +from capif_routing_info import util +from capif_routing_info.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from capif_routing_info.models.security_method import SecurityMethod # noqa: E501 +import re # noqa: E501 class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +18,7 @@ class InterfaceDescription(Model): Do not edit the class manually. """ - def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None): # noqa: E501 + def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None, grant_types=None): # noqa: E501 """InterfaceDescription - a model defined in OpenAPI :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 @@ -28,6 +33,8 @@ class InterfaceDescription(Model): :type api_prefix: str :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this InterfaceDescription. # noqa: E501 + :type grant_types: List[OAuthGrantType] """ self.openapi_types = { 'ipv4_addr': str, @@ -35,7 +42,8 @@ class InterfaceDescription(Model): 'fqdn': str, 'port': int, 'api_prefix': str, - 'security_methods': List[SecurityMethod] + 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType] } self.attribute_map = { @@ -44,7 +52,8 @@ class InterfaceDescription(Model): 'fqdn': 'fqdn', 'port': 'port', 'api_prefix': 'apiPrefix', - 'security_methods': 'securityMethods' + 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes' } self._ipv4_addr = ipv4_addr @@ -53,6 +62,7 @@ class InterfaceDescription(Model): self._port = port self._api_prefix = api_prefix self._security_methods = security_methods + self._grant_types = grant_types @classmethod def from_dict(cls, dikt) -> 'InterfaceDescription': @@ -136,7 +146,7 @@ class InterfaceDescription(Model): if fqdn is not None and len(fqdn) < 4: raise ValueError("Invalid value for `fqdn`, length must be greater than or equal to `4`") # noqa: E501 if fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', fqdn): # noqa: E501 - raise ValueError("Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + raise ValueError(r"Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 self._fqdn = fqdn @@ -214,3 +224,26 @@ class InterfaceDescription(Model): raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 self._security_methods = security_methods + + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this InterfaceDescription. + + + :return: The grant_types of this InterfaceDescription. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this InterfaceDescription. + + + :param grant_types: The grant_types of this InterfaceDescription. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/invalid_param.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/invalid_param.py index 3014346f..e6d4edec 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/invalid_param.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/invalid_param.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py index 6fa0acf3..d470760f 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info.models.ipv4_address_range1 import Ipv4AddressRange1 +from capif_routing_info.models.ipv6_address_range1 import Ipv6AddressRange1 +from capif_routing_info import util + from capif_routing_info.models.ipv4_address_range1 import Ipv4AddressRange1 # noqa: E501 from capif_routing_info.models.ipv6_address_range1 import Ipv6AddressRange1 # noqa: E501 - class IpAddrRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range.py index a8025b6c..e4a0b763 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +import re +from capif_routing_info import util +import re # noqa: E501 class Ipv4AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -65,7 +67,7 @@ class Ipv4AddressRange(Model): :type start: str """ if start is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', start): # noqa: E501 - raise ValueError("Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._start = start @@ -90,6 +92,6 @@ class Ipv4AddressRange(Model): :type end: str """ if end is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', end): # noqa: E501 - raise ValueError("Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._end = end diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range1.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range1.py index ebb34a4a..ca5d5f4a 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range1.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range1.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +import re +from capif_routing_info import util +import re # noqa: E501 class Ipv4AddressRange1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -67,7 +69,7 @@ class Ipv4AddressRange1(Model): if start is None: raise ValueError("Invalid value for `start`, must not be `None`") # noqa: E501 if start is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', start): # noqa: E501 - raise ValueError("Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `start`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._start = start @@ -94,6 +96,6 @@ class Ipv4AddressRange1(Model): if end is None: raise ValueError("Invalid value for `end`, must not be `None`") # noqa: E501 if end is not None and not re.search(r'^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', end): # noqa: E501 - raise ValueError("Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 + raise ValueError(r"Invalid value for `end`, must be a follow pattern or equal to `/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/`") # noqa: E501 self._end = end diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_addr1.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_addr1.py index a0805802..f4248ba8 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_addr1.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_addr1.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class Ipv6Addr1(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range.py index 2067eb2d..aeaff9c1 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class Ipv6AddressRange(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range1.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range1.py index 270b9ac9..a1060d8a 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range1.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range1.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 +from capif_routing_info.models.ipv6_addr1 import Ipv6Addr1 +from capif_routing_info import util +from capif_routing_info.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 class Ipv6AddressRange1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py index 2539de2c..076c7f49 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py @@ -22,7 +22,7 @@ class Local3dPointUncertaintyEllipsoid(Model): Do not edit the class manually. """ - def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None): # noqa: E501 + def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None, v_confidence=None): # noqa: E501 """Local3dPointUncertaintyEllipsoid - a model defined in OpenAPI :param shape: The shape of this Local3dPointUncertaintyEllipsoid. # noqa: E501 @@ -35,13 +35,16 @@ class Local3dPointUncertaintyEllipsoid(Model): :type uncertainty_ellipsoid: UncertaintyEllipsoid :param confidence: The confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 :type confidence: int + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type v_confidence: int """ self.openapi_types = { 'shape': SupportedGADShapes, 'local_origin': LocalOrigin, 'point': RelativeCartesianLocation, 'uncertainty_ellipsoid': UncertaintyEllipsoid, - 'confidence': int + 'confidence': int, + 'v_confidence': int } self.attribute_map = { @@ -49,7 +52,8 @@ class Local3dPointUncertaintyEllipsoid(Model): 'local_origin': 'localOrigin', 'point': 'point', 'uncertainty_ellipsoid': 'uncertaintyEllipsoid', - 'confidence': 'confidence' + 'confidence': 'confidence', + 'v_confidence': 'vConfidence' } self._shape = shape @@ -57,6 +61,7 @@ class Local3dPointUncertaintyEllipsoid(Model): self._point = point self._uncertainty_ellipsoid = uncertainty_ellipsoid self._confidence = confidence + self._v_confidence = v_confidence @classmethod def from_dict(cls, dikt) -> 'Local3dPointUncertaintyEllipsoid': @@ -189,3 +194,30 @@ class Local3dPointUncertaintyEllipsoid(Model): raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 self._confidence = confidence + + @property + def v_confidence(self) -> int: + """Gets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :return: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :rtype: int + """ + return self._v_confidence + + @v_confidence.setter + def v_confidence(self, v_confidence: int): + """Sets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :type v_confidence: int + """ + if v_confidence is not None and v_confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value less than or equal to `100`") # noqa: E501 + if v_confidence is not None and v_confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._v_confidence = v_confidence diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py index 8eb4a75a..0b89a0dc 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py @@ -1,10 +1,14 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.geographic_area import GeographicArea +from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates +from capif_routing_info import util +from capif_routing_info.models.geographic_area import GeographicArea # noqa: E501 +from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 class LocalOrigin(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,26 +16,36 @@ class LocalOrigin(Model): Do not edit the class manually. """ - def __init__(self, coordinate_id=None, point=None): # noqa: E501 + def __init__(self, coordinate_id=None, point=None, area=None, horiz_axes_orientation=None): # noqa: E501 """LocalOrigin - a model defined in OpenAPI :param coordinate_id: The coordinate_id of this LocalOrigin. # noqa: E501 :type coordinate_id: str :param point: The point of this LocalOrigin. # noqa: E501 :type point: GeographicalCoordinates + :param area: The area of this LocalOrigin. # noqa: E501 + :type area: GeographicArea + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. # noqa: E501 + :type horiz_axes_orientation: int """ self.openapi_types = { 'coordinate_id': str, - 'point': GeographicalCoordinates + 'point': GeographicalCoordinates, + 'area': GeographicArea, + 'horiz_axes_orientation': int } self.attribute_map = { 'coordinate_id': 'coordinateId', - 'point': 'point' + 'point': 'point', + 'area': 'area', + 'horiz_axes_orientation': 'horizAxesOrientation' } self._coordinate_id = coordinate_id self._point = point + self._area = area + self._horiz_axes_orientation = horiz_axes_orientation @classmethod def from_dict(cls, dikt) -> 'LocalOrigin': @@ -62,6 +76,8 @@ class LocalOrigin(Model): :param coordinate_id: The coordinate_id of this LocalOrigin. :type coordinate_id: str """ + if coordinate_id is None: + raise ValueError("Invalid value for `coordinate_id`, must not be `None`") # noqa: E501 self._coordinate_id = coordinate_id @@ -85,3 +101,51 @@ class LocalOrigin(Model): """ self._point = point + + @property + def area(self) -> GeographicArea: + """Gets the area of this LocalOrigin. + + + :return: The area of this LocalOrigin. + :rtype: GeographicArea + """ + return self._area + + @area.setter + def area(self, area: GeographicArea): + """Sets the area of this LocalOrigin. + + + :param area: The area of this LocalOrigin. + :type area: GeographicArea + """ + + self._area = area + + @property + def horiz_axes_orientation(self) -> int: + """Gets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :return: The horiz_axes_orientation of this LocalOrigin. + :rtype: int + """ + return self._horiz_axes_orientation + + @horiz_axes_orientation.setter + def horiz_axes_orientation(self, horiz_axes_orientation: int): + """Sets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. + :type horiz_axes_orientation: int + """ + if horiz_axes_orientation is not None and horiz_axes_orientation > 3600: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value less than or equal to `3600`") # noqa: E501 + if horiz_axes_orientation is not None and horiz_axes_orientation < 0: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value greater than or equal to `0`") # noqa: E501 + + self._horiz_axes_orientation = horiz_axes_orientation diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/o_auth_grant_type.py new file mode 100644 index 00000000..420b4513 --- /dev/null +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/o_auth_grant_type.py @@ -0,0 +1,34 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from capif_routing_info.models.base_model import Model +from capif_routing_info import util + + +class OAuthGrantType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """OAuthGrantType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'OAuthGrantType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OAuthGrantType of this OAuthGrantType. # noqa: E501 + :rtype: OAuthGrantType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/operation.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/operation.py index 3e0511a1..856dc775 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/operation.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/operation.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class Operation(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py index 471c405c..88b0a922 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info.models.gad_shape import GADShape +from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates +from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes +from capif_routing_info import util + +from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class Point(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py index 8524f902..ff5cab9e 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info.models.gad_shape import GADShape +from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates +from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes +from capif_routing_info import util + +from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class PointAltitude(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py index 977b0226..3af36a1e 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py @@ -1,12 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info.models.gad_shape import GADShape +from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates +from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes +from capif_routing_info import util + +from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 - class Polygon(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/problem_details.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/problem_details.py index e2a91365..096c04eb 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/problem_details.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/problem_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.invalid_param import InvalidParam # noqa: E501 +from capif_routing_info.models.invalid_param import InvalidParam +import re +from capif_routing_info import util +from capif_routing_info.models.invalid_param import InvalidParam # noqa: E501 +import re # noqa: E501 class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -259,6 +262,6 @@ class ProblemDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/protocol.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/protocol.py index 48cda2a8..fe4b2bf3 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/protocol.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/protocol.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class Protocol(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py index 11872f49..c6540878 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info.models.communication_type import CommunicationType +from capif_routing_info.models.custom_operation import CustomOperation +from capif_routing_info.models.operation import Operation +from capif_routing_info import util + from capif_routing_info.models.communication_type import CommunicationType # noqa: E501 from capif_routing_info.models.custom_operation import CustomOperation # noqa: E501 from capif_routing_info.models.operation import Operation # noqa: E501 - class Resource(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_info.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_info.py index e81e9048..8d086045 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_info.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_info.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.routing_rule import RoutingRule # noqa: E501 +from capif_routing_info.models.routing_rule import RoutingRule +from capif_routing_info import util +from capif_routing_info.models.routing_rule import RoutingRule # noqa: E501 class RoutingInfo(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py index 14216c31..88cb2c7a 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from capif_routing_info.models.base_model import Model +from capif_routing_info.models.aef_profile import AefProfile +from capif_routing_info.models.ipv4_address_range import Ipv4AddressRange +from capif_routing_info.models.ipv6_address_range import Ipv6AddressRange from capif_routing_info import util + from capif_routing_info.models.aef_profile import AefProfile # noqa: E501 -from capif_routing_info.models.base_model import Model from capif_routing_info.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 from capif_routing_info.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 - class RoutingRule(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/security_method.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/security_method.py index dc073f40..0ef293df 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/security_method.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/security_method.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/service_kpis.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/service_kpis.py index 05926a00..869dc5a3 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/service_kpis.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/service_kpis.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +import re +from capif_routing_info import util +import re # noqa: E501 class ServiceKpis(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -170,7 +172,7 @@ class ServiceKpis(Model): :type aval_comp: str """ if aval_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_comp): # noqa: E501 - raise ValueError("Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 self._aval_comp = aval_comp @@ -195,7 +197,7 @@ class ServiceKpis(Model): :type aval_gra_comp: str """ if aval_gra_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_gra_comp): # noqa: E501 - raise ValueError("Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 self._aval_gra_comp = aval_gra_comp @@ -220,7 +222,7 @@ class ServiceKpis(Model): :type aval_mem: str """ if aval_mem is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_mem): # noqa: E501 - raise ValueError("Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 self._aval_mem = aval_mem @@ -245,7 +247,7 @@ class ServiceKpis(Model): :type aval_stor: str """ if aval_stor is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_stor): # noqa: E501 - raise ValueError("Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 self._aval_stor = aval_stor diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/supported_gad_shapes.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/supported_gad_shapes.py index 98407a0e..e238c97b 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/supported_gad_shapes.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/supported_gad_shapes.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class SupportedGADShapes(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipse.py index 9d802dd4..27a6acd1 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipse.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info import util class UncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py index 6e7df341..1be123dc 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_routing_info import util from capif_routing_info.models.base_model import Model +from capif_routing_info.models.custom_operation import CustomOperation +from capif_routing_info.models.resource import Resource +from capif_routing_info import util + from capif_routing_info.models.custom_operation import CustomOperation # noqa: E501 from capif_routing_info.models.resource import Resource # noqa: E501 - class Version(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml index 5e93c85a..7b775ead 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for Routing information. \n© 2022, 3GPP Organizational Partners\ + description: "API for Routing information. \n© 2024, 3GPP Organizational Partners\ \ (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Routing_Info_API - version: 1.2.0-alpha.1 + version: 1.2.0 externalDocs: - description: 3GPP TS 29.222 V18.0.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/capif-routing-info/v1" @@ -209,6 +209,9 @@ components: end: end aefProfile: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -387,6 +390,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -395,6 +401,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -423,6 +432,9 @@ components: end: end aefProfile: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -601,6 +613,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -609,6 +624,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -651,6 +669,9 @@ components: end: end aefProfile: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -829,6 +850,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -837,6 +861,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -997,6 +1024,9 @@ components: description: Represents the AEF profile data. example: protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS ueIpRange: ueIpv4AddrRanges: - start: 198.51.100.1 @@ -1175,6 +1205,9 @@ components: aefId: aefId interfaceDescriptions: - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1183,6 +1216,9 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr - ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1200,11 +1236,9 @@ components: maxReqRate: 0 avalGraComp: avalGraComp nullable: true - oneOf: - - required: - - domainName - - required: - - interfaceDescriptions + oneOf: + - required: ["domainName"] + - required: ["interfaceDescriptions"] properties: aefId: description: Identifier of the API exposing function @@ -1228,6 +1262,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array domainName: description: Domain to which API belongs to title: domainName @@ -1521,6 +1561,9 @@ components: description: Represents the description of an API's interface. example: ipv6Addr: ipv6Addr + grantTypes: + - null + - null securityMethods: - null - null @@ -1529,13 +1572,10 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr nullable: true - oneOf: - - required: - - ipv4Addr - - required: - - ipv6Addr - - required: - - fqdn + oneOf: + - required: ["fqdn"] + - required: ["ipv4Addr"] + - required: ["ipv6Addr"] properties: ipv4Addr: description: | @@ -1574,6 +1614,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array title: InterfaceDescription type: object AefLocation: @@ -1696,7 +1742,9 @@ components: title: ServiceKpis type: object IpAddrRange: - anyOf: [] + anyOf: + - required: ["ueIpv4AddrRanges"] + - required: ["ueIpv6AddrRanges"] description: Represents the list of public IP ranges example: ueIpv4AddrRanges: @@ -1739,6 +1787,23 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$" title: Ipv4Addr type: string + OAuthGrantType: + anyOf: + - enum: + - CLIENT_CREDENTIALS + - AUTHORIZATION_CODE + - AUTHORIZATION_CODE_WITH_PKCE + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. + type: string + description: "Indicates the supported authorization flow (e.g. client credentials\ + \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ + \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ + \ credentials flow.\n- AUTHORIZATION_CODE: Indicate that the grant type is\ + \ authorization code.\n- AUTHORIZATION_CODE_WITH_PKCE: Indicate that the grant\ + \ type is authorization code with PKCE.\n" + title: OAuthGrantType DateTime: description: string with format "date-time" as defined in OpenAPI. format: date-time @@ -2197,8 +2262,26 @@ components: type: string point: $ref: '#/components/schemas/GeographicalCoordinates' + area: + $ref: '#/components/schemas/GeographicArea' + horizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in + 0.1 degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer + required: + - coordinateId title: LocalOrigin type: object + HorizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in 0.1 + degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer RelativeCartesianLocation: description: Relative Cartesian Location properties: @@ -2234,6 +2317,8 @@ components: $ref: '#/components/schemas/UncertaintyEllipsoid' confidence: $ref: '#/components/schemas/Confidence' + vConfidence: + $ref: '#/components/schemas/Confidence' required: - confidence - localOrigin @@ -2326,9 +2411,6 @@ components: title: Ipv6AddressRange_1 type: object Ipv6Addr_1: - allOf: - - pattern: "^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$" - - pattern: "^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$" description: | String identifying an IPv6 address formatted according to clause 4 of RFC5952. The mixed IPv4 IPv6 notation according to clause 5 of RFC5952 shall not be used. example: 2001:db8:85a3::8a2e:370:7334 diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/__init__.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/__init__.py index fe016ad6..e95f59cf 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/__init__.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/__init__.py @@ -1,9 +1,10 @@ import logging import connexion -from capif_routing_info.encoder import JSONEncoder from flask_testing import TestCase +from capif_routing_info.encoder import JSONEncoder + class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py index e90ce923..7241b494 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py @@ -1,5 +1,9 @@ import unittest +from flask import json + +from capif_routing_info.models.problem_details import ProblemDetails # noqa: E501 +from capif_routing_info.models.routing_info import RoutingInfo # noqa: E501 from capif_routing_info.test import BaseTestCase diff --git a/services/TS29222_CAPIF_Routing_Info_API/setup.py b/services/TS29222_CAPIF_Routing_Info_API/setup.py index 6d66c726..f3e2e6ad 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/setup.py +++ b/services/TS29222_CAPIF_Routing_Info_API/setup.py @@ -1,3 +1,4 @@ +import sys from setuptools import setup, find_packages NAME = "capif_routing_info" @@ -30,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['capif_routing_info=capif_routing_info.__main__:main']}, long_description="""\ - API for Routing information. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for Routing information. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) -- GitLab From 0b3e23bc760d657d4618ebc6b4a39ca8390b19a6 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 7 Apr 2025 13:33:46 +0200 Subject: [PATCH 100/157] fix name of capif_security_api-28 test --- tests/features/CAPIF Security Api/capif_security_api.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/features/CAPIF Security Api/capif_security_api.robot b/tests/features/CAPIF Security Api/capif_security_api.robot index 530914a9..c3a966f0 100644 --- a/tests/features/CAPIF Security Api/capif_security_api.robot +++ b/tests/features/CAPIF Security Api/capif_security_api.robot @@ -1254,7 +1254,7 @@ Retrieve access token with invalid apiName at scope ... error_description=One of the api names does not exist or is not associated with the aef id provided -Retrieve the Security Context of an API Invoker for PKI security method +Retrieve Security Context from AEF using PKI-secured API Invoker [Tags] capif_security_api-28 smoke # Default Invoker Registration and Onboarding ${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding -- GitLab From 7ade4d4e72a356ec8097e17413fec7a9318ef504 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Mon, 7 Apr 2025 14:13:46 +0200 Subject: [PATCH 101/157] Security API realease V18.6.0 --- .../.openapi-generator/FILES | 2 + .../.openapi-generator/VERSION | 2 +- services/TS29222_CAPIF_Security_API/README.md | 2 +- .../controllers/default_controller.py | 7 - .../controllers/security_controller.py | 1 - .../capif_security/models/__init__.py | 28 +++ .../models/access_token_claims.py | 6 +- .../capif_security/models/access_token_err.py | 3 +- .../models/access_token_err1.py | 3 +- .../models/access_token_req1.py | 142 ++++++++++++++- .../capif_security/models/access_token_rsp.py | 3 +- .../capif_security/models/base_model.py | 1 + .../capif_security/models/cause.py | 3 +- .../models/interface_description.py | 47 ++++- .../capif_security/models/invalid_param.py | 3 +- .../capif_security/models/invalid_param1.py | 3 +- .../models/ml_model_inter_ind.py | 95 ++++++++++ .../capif_security/models/nf_type.py | 3 +- .../models/no_profile_match_info.py | 7 +- .../models/no_profile_match_reason.py | 3 +- .../capif_security/models/nwdaf_event.py | 34 ++++ .../models/o_auth_grant_type.py | 3 +- .../capif_security/models/plmn_id.py | 10 +- .../capif_security/models/plmn_id_nid.py | 12 +- .../capif_security/models/problem_details.py | 11 +- .../capif_security/models/problem_details1.py | 16 +- .../models/query_param_combination.py | 6 +- .../capif_security/models/query_parameter.py | 3 +- .../capif_security/models/res_owner_id.py | 8 +- .../models/security_information.py | 8 +- .../capif_security/models/security_method.py | 3 +- .../models/security_notification.py | 6 +- .../capif_security/models/service_security.py | 12 +- .../capif_security/models/snssai.py | 8 +- .../models/websock_notif_config.py | 3 +- .../capif_security/openapi/openapi.yaml | 168 +++++++++++++++--- .../capif_security/test/__init__.py | 3 +- .../test/test_default_controller.py | 13 +- .../capif_security/typing_utils.py | 1 + services/TS29222_CAPIF_Security_API/setup.py | 1 + 40 files changed, 591 insertions(+), 102 deletions(-) create mode 100644 services/TS29222_CAPIF_Security_API/capif_security/models/ml_model_inter_ind.py create mode 100644 services/TS29222_CAPIF_Security_API/capif_security/models/nwdaf_event.py diff --git a/services/TS29222_CAPIF_Security_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Security_API/.openapi-generator/FILES index 1fd34c24..a3947acd 100644 --- a/services/TS29222_CAPIF_Security_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Security_API/.openapi-generator/FILES @@ -22,9 +22,11 @@ capif_security/models/cause.py capif_security/models/interface_description.py capif_security/models/invalid_param.py capif_security/models/invalid_param1.py +capif_security/models/ml_model_inter_ind.py capif_security/models/nf_type.py capif_security/models/no_profile_match_info.py capif_security/models/no_profile_match_reason.py +capif_security/models/nwdaf_event.py capif_security/models/o_auth_grant_type.py capif_security/models/plmn_id.py capif_security/models/plmn_id_nid.py diff --git a/services/TS29222_CAPIF_Security_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Security_API/.openapi-generator/VERSION index 18bb4182..b23eb275 100644 --- a/services/TS29222_CAPIF_Security_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_Security_API/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.11.0 diff --git a/services/TS29222_CAPIF_Security_API/README.md b/services/TS29222_CAPIF_Security_API/README.md index 6534bceb..66df1099 100644 --- a/services/TS29222_CAPIF_Security_API/README.md +++ b/services/TS29222_CAPIF_Security_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m openapi_server +python3 -m capif_security ``` and open your browser to here: diff --git a/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py b/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py index 3609bd8f..8f371687 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py @@ -17,7 +17,6 @@ publish_ops = Publisher() valid_user = ControlAccess() - def cert_validation(): def _cert_validation(f): @wraps(f) @@ -51,7 +50,6 @@ def cert_validation(): return __cert_validation return _cert_validation - @cert_validation() def securities_security_id_token_post(security_id, body): # noqa: E501 """securities_security_id_token_post @@ -111,7 +109,6 @@ def trusted_invokers_api_invoker_id_delete(api_invoker_id): # noqa: E501 current_app.logger.info("Removing security context") return service_security_ops.delete_servicesecurity(api_invoker_id) - @cert_validation() def trusted_invokers_api_invoker_id_delete_post(api_invoker_id, body): # noqa: E501 """trusted_invokers_api_invoker_id_delete_post @@ -125,7 +122,6 @@ def trusted_invokers_api_invoker_id_delete_post(api_invoker_id, body): # noqa: :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] """ - if request.is_json: body = SecurityNotification.from_dict(request.get_json()) # noqa: E501 @@ -134,7 +130,6 @@ def trusted_invokers_api_invoker_id_delete_post(api_invoker_id, body): # noqa: return res - @cert_validation() def trusted_invokers_api_invoker_id_get(api_invoker_id, authentication_info=None, authorization_info=None): # noqa: E501 """trusted_invokers_api_invoker_id_get @@ -156,7 +151,6 @@ def trusted_invokers_api_invoker_id_get(api_invoker_id, authentication_info=None return res - @cert_validation() def trusted_invokers_api_invoker_id_put(api_invoker_id, body): # noqa: E501 """trusted_invokers_api_invoker_id_put @@ -188,7 +182,6 @@ def trusted_invokers_api_invoker_id_put(api_invoker_id, body): # noqa: E501 return res - @cert_validation() def trusted_invokers_api_invoker_id_update_post(api_invoker_id, body): # noqa: E501 """trusted_invokers_api_invoker_id_update_post diff --git a/services/TS29222_CAPIF_Security_API/capif_security/controllers/security_controller.py b/services/TS29222_CAPIF_Security_API/capif_security/controllers/security_controller.py index 139597f9..8b137891 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/controllers/security_controller.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/controllers/security_controller.py @@ -1,2 +1 @@ - diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/__init__.py b/services/TS29222_CAPIF_Security_API/capif_security/models/__init__.py index d036df69..f4510143 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/__init__.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/__init__.py @@ -1,2 +1,30 @@ # flake8: noqa # import models into model package +from capif_security.models.access_token_claims import AccessTokenClaims +from capif_security.models.access_token_err import AccessTokenErr +from capif_security.models.access_token_err1 import AccessTokenErr1 +from capif_security.models.access_token_req1 import AccessTokenReq1 +from capif_security.models.access_token_rsp import AccessTokenRsp +from capif_security.models.cause import Cause +from capif_security.models.interface_description import InterfaceDescription +from capif_security.models.invalid_param import InvalidParam +from capif_security.models.invalid_param1 import InvalidParam1 +from capif_security.models.ml_model_inter_ind import MlModelInterInd +from capif_security.models.nf_type import NFType +from capif_security.models.no_profile_match_info import NoProfileMatchInfo +from capif_security.models.no_profile_match_reason import NoProfileMatchReason +from capif_security.models.nwdaf_event import NwdafEvent +from capif_security.models.o_auth_grant_type import OAuthGrantType +from capif_security.models.plmn_id import PlmnId +from capif_security.models.plmn_id_nid import PlmnIdNid +from capif_security.models.problem_details import ProblemDetails +from capif_security.models.problem_details1 import ProblemDetails1 +from capif_security.models.query_param_combination import QueryParamCombination +from capif_security.models.query_parameter import QueryParameter +from capif_security.models.res_owner_id import ResOwnerId +from capif_security.models.security_information import SecurityInformation +from capif_security.models.security_method import SecurityMethod +from capif_security.models.security_notification import SecurityNotification +from capif_security.models.service_security import ServiceSecurity +from capif_security.models.snssai import Snssai +from capif_security.models.websock_notif_config import WebsockNotifConfig diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_claims.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_claims.py index 71d49c28..46593ae6 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_claims.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_claims.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model -from capif_security.models.res_owner_id import ResOwnerId # noqa: E501 +from capif_security.models.res_owner_id import ResOwnerId +from capif_security import util +from capif_security.models.res_owner_id import ResOwnerId # noqa: E501 class AccessTokenClaims(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err.py index b5d7f6f8..c6002302 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class AccessTokenErr(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err1.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err1.py index 325b2197..23007798 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err1.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err1.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class AccessTokenErr1(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py index b9e4ff40..d82703e3 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py @@ -1,14 +1,24 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security.models.ml_model_inter_ind import MlModelInterInd +from capif_security.models.nf_type import NFType +from capif_security.models.nwdaf_event import NwdafEvent +from capif_security.models.plmn_id import PlmnId +from capif_security.models.plmn_id_nid import PlmnIdNid +from capif_security.models.snssai import Snssai +import re +from capif_security import util + +from capif_security.models.ml_model_inter_ind import MlModelInterInd # noqa: E501 from capif_security.models.nf_type import NFType # noqa: E501 +from capif_security.models.nwdaf_event import NwdafEvent # noqa: E501 from capif_security.models.plmn_id import PlmnId # noqa: E501 from capif_security.models.plmn_id_nid import PlmnIdNid # noqa: E501 from capif_security.models.snssai import Snssai # noqa: E501 - +import re # noqa: E501 class AccessTokenReq1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,7 +26,7 @@ class AccessTokenReq1(Model): Do not edit the class manually. """ - def __init__(self, grant_type=None, nf_instance_id=None, nf_type=None, target_nf_type=None, scope=None, target_nf_instance_id=None, requester_plmn=None, requester_plmn_list=None, requester_snssai_list=None, requester_fqdn=None, requester_snpn_list=None, target_plmn=None, target_snpn=None, target_snssai_list=None, target_nsi_list=None, target_nf_set_id=None, target_nf_service_set_id=None, hnrf_access_token_uri=None, source_nf_instance_id=None): # noqa: E501 + def __init__(self, grant_type=None, nf_instance_id=None, nf_type=None, target_nf_type=None, scope=None, target_nf_instance_id=None, requester_plmn=None, requester_plmn_list=None, requester_snssai_list=None, requester_fqdn=None, requester_snpn_list=None, target_plmn=None, target_snpn=None, target_snssai_list=None, target_nsi_list=None, target_nf_set_id=None, target_nf_service_set_id=None, hnrf_access_token_uri=None, source_nf_instance_id=None, vendor_id=None, analytics_ids=None, requester_inter_ind_list=None, source_vendor_id=None): # noqa: E501 """AccessTokenReq1 - a model defined in OpenAPI :param grant_type: The grant_type of this AccessTokenReq1. # noqa: E501 @@ -57,6 +67,14 @@ class AccessTokenReq1(Model): :type hnrf_access_token_uri: str :param source_nf_instance_id: The source_nf_instance_id of this AccessTokenReq1. # noqa: E501 :type source_nf_instance_id: str + :param vendor_id: The vendor_id of this AccessTokenReq1. # noqa: E501 + :type vendor_id: str + :param analytics_ids: The analytics_ids of this AccessTokenReq1. # noqa: E501 + :type analytics_ids: List[NwdafEvent] + :param requester_inter_ind_list: The requester_inter_ind_list of this AccessTokenReq1. # noqa: E501 + :type requester_inter_ind_list: List[MlModelInterInd] + :param source_vendor_id: The source_vendor_id of this AccessTokenReq1. # noqa: E501 + :type source_vendor_id: str """ self.openapi_types = { 'grant_type': str, @@ -77,7 +95,11 @@ class AccessTokenReq1(Model): 'target_nf_set_id': str, 'target_nf_service_set_id': str, 'hnrf_access_token_uri': str, - 'source_nf_instance_id': str + 'source_nf_instance_id': str, + 'vendor_id': str, + 'analytics_ids': List[NwdafEvent], + 'requester_inter_ind_list': List[MlModelInterInd], + 'source_vendor_id': str } self.attribute_map = { @@ -99,7 +121,11 @@ class AccessTokenReq1(Model): 'target_nf_set_id': 'targetNfSetId', 'target_nf_service_set_id': 'targetNfServiceSetId', 'hnrf_access_token_uri': 'hnrfAccessTokenUri', - 'source_nf_instance_id': 'sourceNfInstanceId' + 'source_nf_instance_id': 'sourceNfInstanceId', + 'vendor_id': 'vendorId', + 'analytics_ids': 'analyticsIds', + 'requester_inter_ind_list': 'requesterInterIndList', + 'source_vendor_id': 'sourceVendorId' } self._grant_type = grant_type @@ -121,6 +147,10 @@ class AccessTokenReq1(Model): self._target_nf_service_set_id = target_nf_service_set_id self._hnrf_access_token_uri = hnrf_access_token_uri self._source_nf_instance_id = source_nf_instance_id + self._vendor_id = vendor_id + self._analytics_ids = analytics_ids + self._requester_inter_ind_list = requester_inter_ind_list + self._source_vendor_id = source_vendor_id @classmethod def from_dict(cls, dikt) -> 'AccessTokenReq1': @@ -248,7 +278,7 @@ class AccessTokenReq1(Model): if scope is None: raise ValueError("Invalid value for `scope`, must not be `None`") # noqa: E501 if scope is not None and not re.search(r'^([a-zA-Z0-9_:-]+)( [a-zA-Z0-9_:-]+)*$', scope): # noqa: E501 - raise ValueError("Invalid value for `scope`, must be a follow pattern or equal to `/^([a-zA-Z0-9_:-]+)( [a-zA-Z0-9_:-]+)*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `scope`, must be a follow pattern or equal to `/^([a-zA-Z0-9_:-]+)( [a-zA-Z0-9_:-]+)*$/`") # noqa: E501 self._scope = scope @@ -367,7 +397,7 @@ class AccessTokenReq1(Model): if requester_fqdn is not None and len(requester_fqdn) < 4: raise ValueError("Invalid value for `requester_fqdn`, length must be greater than or equal to `4`") # noqa: E501 if requester_fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', requester_fqdn): # noqa: E501 - raise ValueError("Invalid value for `requester_fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + raise ValueError(r"Invalid value for `requester_fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 self._requester_fqdn = requester_fqdn @@ -573,3 +603,99 @@ class AccessTokenReq1(Model): """ self._source_nf_instance_id = source_nf_instance_id + + @property + def vendor_id(self) -> str: + """Gets the vendor_id of this AccessTokenReq1. + + Vendor ID of the NF Service instance (Private Enterprise Number assigned by IANA) # noqa: E501 + + :return: The vendor_id of this AccessTokenReq1. + :rtype: str + """ + return self._vendor_id + + @vendor_id.setter + def vendor_id(self, vendor_id: str): + """Sets the vendor_id of this AccessTokenReq1. + + Vendor ID of the NF Service instance (Private Enterprise Number assigned by IANA) # noqa: E501 + + :param vendor_id: The vendor_id of this AccessTokenReq1. + :type vendor_id: str + """ + if vendor_id is not None and not re.search(r'^[0-9]{6}$', vendor_id): # noqa: E501 + raise ValueError(r"Invalid value for `vendor_id`, must be a follow pattern or equal to `/^[0-9]{6}$/`") # noqa: E501 + + self._vendor_id = vendor_id + + @property + def analytics_ids(self) -> List[NwdafEvent]: + """Gets the analytics_ids of this AccessTokenReq1. + + + :return: The analytics_ids of this AccessTokenReq1. + :rtype: List[NwdafEvent] + """ + return self._analytics_ids + + @analytics_ids.setter + def analytics_ids(self, analytics_ids: List[NwdafEvent]): + """Sets the analytics_ids of this AccessTokenReq1. + + + :param analytics_ids: The analytics_ids of this AccessTokenReq1. + :type analytics_ids: List[NwdafEvent] + """ + if analytics_ids is not None and len(analytics_ids) < 1: + raise ValueError("Invalid value for `analytics_ids`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._analytics_ids = analytics_ids + + @property + def requester_inter_ind_list(self) -> List[MlModelInterInd]: + """Gets the requester_inter_ind_list of this AccessTokenReq1. + + + :return: The requester_inter_ind_list of this AccessTokenReq1. + :rtype: List[MlModelInterInd] + """ + return self._requester_inter_ind_list + + @requester_inter_ind_list.setter + def requester_inter_ind_list(self, requester_inter_ind_list: List[MlModelInterInd]): + """Sets the requester_inter_ind_list of this AccessTokenReq1. + + + :param requester_inter_ind_list: The requester_inter_ind_list of this AccessTokenReq1. + :type requester_inter_ind_list: List[MlModelInterInd] + """ + if requester_inter_ind_list is not None and len(requester_inter_ind_list) < 1: + raise ValueError("Invalid value for `requester_inter_ind_list`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._requester_inter_ind_list = requester_inter_ind_list + + @property + def source_vendor_id(self) -> str: + """Gets the source_vendor_id of this AccessTokenReq1. + + Vendor ID of the NF Service instance (Private Enterprise Number assigned by IANA) # noqa: E501 + + :return: The source_vendor_id of this AccessTokenReq1. + :rtype: str + """ + return self._source_vendor_id + + @source_vendor_id.setter + def source_vendor_id(self, source_vendor_id: str): + """Sets the source_vendor_id of this AccessTokenReq1. + + Vendor ID of the NF Service instance (Private Enterprise Number assigned by IANA) # noqa: E501 + + :param source_vendor_id: The source_vendor_id of this AccessTokenReq1. + :type source_vendor_id: str + """ + if source_vendor_id is not None and not re.search(r'^[0-9]{6}$', source_vendor_id): # noqa: E501 + raise ValueError(r"Invalid value for `source_vendor_id`, must be a follow pattern or equal to `/^[0-9]{6}$/`") # noqa: E501 + + self._source_vendor_id = source_vendor_id diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_rsp.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_rsp.py index deaf22ec..f8e524db 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_rsp.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_rsp.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class AccessTokenRsp(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/base_model.py b/services/TS29222_CAPIF_Security_API/capif_security/models/base_model.py index 32a1219f..4bf93155 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/base_model.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/base_model.py @@ -1,4 +1,5 @@ import pprint + import typing from capif_security import util diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/cause.py b/services/TS29222_CAPIF_Security_API/capif_security/models/cause.py index 1b57bf4d..227ba107 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/cause.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/cause.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class Cause(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py b/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py index 47458b7b..ade7fc69 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py @@ -1,11 +1,16 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model -from capif_security.models.security_method import SecurityMethod # noqa: E501 +from capif_security.models.o_auth_grant_type import OAuthGrantType +from capif_security.models.security_method import SecurityMethod +import re +from capif_security import util +from capif_security.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from capif_security.models.security_method import SecurityMethod # noqa: E501 +import re # noqa: E501 class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +18,7 @@ class InterfaceDescription(Model): Do not edit the class manually. """ - def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None): # noqa: E501 + def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None, grant_types=None): # noqa: E501 """InterfaceDescription - a model defined in OpenAPI :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 @@ -28,6 +33,8 @@ class InterfaceDescription(Model): :type api_prefix: str :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this InterfaceDescription. # noqa: E501 + :type grant_types: List[OAuthGrantType] """ self.openapi_types = { 'ipv4_addr': str, @@ -35,7 +42,8 @@ class InterfaceDescription(Model): 'fqdn': str, 'port': int, 'api_prefix': str, - 'security_methods': List[SecurityMethod] + 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType] } self.attribute_map = { @@ -44,7 +52,8 @@ class InterfaceDescription(Model): 'fqdn': 'fqdn', 'port': 'port', 'api_prefix': 'apiPrefix', - 'security_methods': 'securityMethods' + 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes' } self._ipv4_addr = ipv4_addr @@ -53,6 +62,7 @@ class InterfaceDescription(Model): self._port = port self._api_prefix = api_prefix self._security_methods = security_methods + self._grant_types = grant_types @classmethod def from_dict(cls, dikt) -> 'InterfaceDescription': @@ -136,7 +146,7 @@ class InterfaceDescription(Model): if fqdn is not None and len(fqdn) < 4: raise ValueError("Invalid value for `fqdn`, length must be greater than or equal to `4`") # noqa: E501 if fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', fqdn): # noqa: E501 - raise ValueError("Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + raise ValueError(r"Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 self._fqdn = fqdn @@ -214,3 +224,26 @@ class InterfaceDescription(Model): raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 self._security_methods = security_methods + + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this InterfaceDescription. + + + :return: The grant_types of this InterfaceDescription. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this InterfaceDescription. + + + :param grant_types: The grant_types of this InterfaceDescription. + :type grant_types: List[OAuthGrantType] + """ + if grant_types is not None and len(grant_types) < 1: + raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._grant_types = grant_types diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param.py b/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param.py index ca4a094e..f86b2086 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param1.py b/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param1.py index 3546df8d..77919000 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param1.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param1.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class InvalidParam1(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/ml_model_inter_ind.py b/services/TS29222_CAPIF_Security_API/capif_security/models/ml_model_inter_ind.py new file mode 100644 index 00000000..3e87273d --- /dev/null +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/ml_model_inter_ind.py @@ -0,0 +1,95 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from capif_security.models.base_model import Model +from capif_security.models.nwdaf_event import NwdafEvent +from capif_security import util + +from capif_security.models.nwdaf_event import NwdafEvent # noqa: E501 + +class MlModelInterInd(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, analytics_id=None, vendor_list=None): # noqa: E501 + """MlModelInterInd - a model defined in OpenAPI + + :param analytics_id: The analytics_id of this MlModelInterInd. # noqa: E501 + :type analytics_id: NwdafEvent + :param vendor_list: The vendor_list of this MlModelInterInd. # noqa: E501 + :type vendor_list: List[str] + """ + self.openapi_types = { + 'analytics_id': NwdafEvent, + 'vendor_list': List[str] + } + + self.attribute_map = { + 'analytics_id': 'analyticsId', + 'vendor_list': 'vendorList' + } + + self._analytics_id = analytics_id + self._vendor_list = vendor_list + + @classmethod + def from_dict(cls, dikt) -> 'MlModelInterInd': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The MlModelInterInd of this MlModelInterInd. # noqa: E501 + :rtype: MlModelInterInd + """ + return util.deserialize_model(dikt, cls) + + @property + def analytics_id(self) -> NwdafEvent: + """Gets the analytics_id of this MlModelInterInd. + + + :return: The analytics_id of this MlModelInterInd. + :rtype: NwdafEvent + """ + return self._analytics_id + + @analytics_id.setter + def analytics_id(self, analytics_id: NwdafEvent): + """Sets the analytics_id of this MlModelInterInd. + + + :param analytics_id: The analytics_id of this MlModelInterInd. + :type analytics_id: NwdafEvent + """ + if analytics_id is None: + raise ValueError("Invalid value for `analytics_id`, must not be `None`") # noqa: E501 + + self._analytics_id = analytics_id + + @property + def vendor_list(self) -> List[str]: + """Gets the vendor_list of this MlModelInterInd. + + + :return: The vendor_list of this MlModelInterInd. + :rtype: List[str] + """ + return self._vendor_list + + @vendor_list.setter + def vendor_list(self, vendor_list: List[str]): + """Sets the vendor_list of this MlModelInterInd. + + + :param vendor_list: The vendor_list of this MlModelInterInd. + :type vendor_list: List[str] + """ + if vendor_list is None: + raise ValueError("Invalid value for `vendor_list`, must not be `None`") # noqa: E501 + if vendor_list is not None and len(vendor_list) < 1: + raise ValueError("Invalid value for `vendor_list`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._vendor_list = vendor_list diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/nf_type.py b/services/TS29222_CAPIF_Security_API/capif_security/models/nf_type.py index 0f2e09b2..184a7c0d 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/nf_type.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/nf_type.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class NFType(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py b/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py index c374ddeb..4d8885b5 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py @@ -1,12 +1,15 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security.models.no_profile_match_reason import NoProfileMatchReason +from capif_security.models.query_param_combination import QueryParamCombination +from capif_security import util + from capif_security.models.no_profile_match_reason import NoProfileMatchReason # noqa: E501 from capif_security.models.query_param_combination import QueryParamCombination # noqa: E501 - class NoProfileMatchInfo(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_reason.py b/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_reason.py index 511afb65..ccec0b37 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_reason.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_reason.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class NoProfileMatchReason(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/nwdaf_event.py b/services/TS29222_CAPIF_Security_API/capif_security/models/nwdaf_event.py new file mode 100644 index 00000000..f07de0c3 --- /dev/null +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/nwdaf_event.py @@ -0,0 +1,34 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from capif_security.models.base_model import Model +from capif_security import util + + +class NwdafEvent(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """NwdafEvent - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'NwdafEvent': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NwdafEvent of this NwdafEvent. # noqa: E501 + :rtype: NwdafEvent + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Security_API/capif_security/models/o_auth_grant_type.py index 9420cc5b..8bace2b9 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/o_auth_grant_type.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/o_auth_grant_type.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class OAuthGrantType(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id.py b/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id.py index 82696e45..74dd8bf0 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +import re +from capif_security import util +import re # noqa: E501 class PlmnId(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -67,7 +69,7 @@ class PlmnId(Model): if mcc is None: raise ValueError("Invalid value for `mcc`, must not be `None`") # noqa: E501 if mcc is not None and not re.search(r'^\d{3}$', mcc): # noqa: E501 - raise ValueError("Invalid value for `mcc`, must be a follow pattern or equal to `/^\d{3}$/`") # noqa: E501 + raise ValueError(r"Invalid value for `mcc`, must be a follow pattern or equal to `/^\d{3}$/`") # noqa: E501 self._mcc = mcc @@ -94,6 +96,6 @@ class PlmnId(Model): if mnc is None: raise ValueError("Invalid value for `mnc`, must not be `None`") # noqa: E501 if mnc is not None and not re.search(r'^\d{2,3}$', mnc): # noqa: E501 - raise ValueError("Invalid value for `mnc`, must be a follow pattern or equal to `/^\d{2,3}$/`") # noqa: E501 + raise ValueError(r"Invalid value for `mnc`, must be a follow pattern or equal to `/^\d{2,3}$/`") # noqa: E501 self._mnc = mnc diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id_nid.py b/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id_nid.py index eb9d1e25..02bfde85 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id_nid.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id_nid.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +import re +from capif_security import util +import re # noqa: E501 class PlmnIdNid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -72,7 +74,7 @@ class PlmnIdNid(Model): if mcc is None: raise ValueError("Invalid value for `mcc`, must not be `None`") # noqa: E501 if mcc is not None and not re.search(r'^\d{3}$', mcc): # noqa: E501 - raise ValueError("Invalid value for `mcc`, must be a follow pattern or equal to `/^\d{3}$/`") # noqa: E501 + raise ValueError(r"Invalid value for `mcc`, must be a follow pattern or equal to `/^\d{3}$/`") # noqa: E501 self._mcc = mcc @@ -99,7 +101,7 @@ class PlmnIdNid(Model): if mnc is None: raise ValueError("Invalid value for `mnc`, must not be `None`") # noqa: E501 if mnc is not None and not re.search(r'^\d{2,3}$', mnc): # noqa: E501 - raise ValueError("Invalid value for `mnc`, must be a follow pattern or equal to `/^\d{2,3}$/`") # noqa: E501 + raise ValueError(r"Invalid value for `mnc`, must be a follow pattern or equal to `/^\d{2,3}$/`") # noqa: E501 self._mnc = mnc @@ -124,6 +126,6 @@ class PlmnIdNid(Model): :type nid: str """ if nid is not None and not re.search(r'^[A-Fa-f0-9]{11}$', nid): # noqa: E501 - raise ValueError("Invalid value for `nid`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{11}$/`") # noqa: E501 + raise ValueError(r"Invalid value for `nid`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{11}$/`") # noqa: E501 self._nid = nid diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details.py b/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details.py index 50003d8e..f24710e4 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details.py @@ -1,11 +1,14 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model -from capif_security.models.invalid_param import InvalidParam # noqa: E501 +from capif_security.models.invalid_param import InvalidParam +import re +from capif_security import util +from capif_security.models.invalid_param import InvalidParam # noqa: E501 +import re # noqa: E501 class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -259,6 +262,6 @@ class ProblemDetails(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py b/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py index 777afe0d..27b782fc 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py @@ -1,14 +1,20 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 +from capif_security.models.base_model import Model +from capif_security.models.access_token_err1 import AccessTokenErr1 +from capif_security.models.access_token_req1 import AccessTokenReq1 +from capif_security.models.invalid_param1 import InvalidParam1 +from capif_security.models.no_profile_match_info import NoProfileMatchInfo +import re from capif_security import util + from capif_security.models.access_token_err1 import AccessTokenErr1 # noqa: E501 from capif_security.models.access_token_req1 import AccessTokenReq1 # noqa: E501 -from capif_security.models.base_model import Model from capif_security.models.invalid_param1 import InvalidParam1 # noqa: E501 from capif_security.models.no_profile_match_info import NoProfileMatchInfo # noqa: E501 - +import re # noqa: E501 class ProblemDetails1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -281,7 +287,7 @@ class ProblemDetails1(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features @@ -352,7 +358,7 @@ class ProblemDetails1(Model): if nrf_id is not None and len(nrf_id) < 4: raise ValueError("Invalid value for `nrf_id`, length must be greater than or equal to `4`") # noqa: E501 if nrf_id is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', nrf_id): # noqa: E501 - raise ValueError("Invalid value for `nrf_id`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + raise ValueError(r"Invalid value for `nrf_id`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 self._nrf_id = nrf_id diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/query_param_combination.py b/services/TS29222_CAPIF_Security_API/capif_security/models/query_param_combination.py index 962b251c..a28fb4ad 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/query_param_combination.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/query_param_combination.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model -from capif_security.models.query_parameter import QueryParameter # noqa: E501 +from capif_security.models.query_parameter import QueryParameter +from capif_security import util +from capif_security.models.query_parameter import QueryParameter # noqa: E501 class QueryParamCombination(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/query_parameter.py b/services/TS29222_CAPIF_Security_API/capif_security/models/query_parameter.py index b5d0a01d..183bb325 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/query_parameter.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/query_parameter.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class QueryParameter(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/res_owner_id.py b/services/TS29222_CAPIF_Security_API/capif_security/models/res_owner_id.py index d59b5a48..0229dd1f 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/res_owner_id.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/res_owner_id.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +import re +from capif_security import util +import re # noqa: E501 class ResOwnerId(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -60,6 +62,6 @@ class ResOwnerId(Model): :type gpsi: str """ if gpsi is not None and not re.search(r'^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$', gpsi): # noqa: E501 - raise ValueError("Invalid value for `gpsi`, must be a follow pattern or equal to `/^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$/`") # noqa: E501 + raise ValueError(r"Invalid value for `gpsi`, must be a follow pattern or equal to `/^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$/`") # noqa: E501 self._gpsi = gpsi diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py b/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py index e678a362..10e85193 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py @@ -1,13 +1,17 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security.models.interface_description import InterfaceDescription +from capif_security.models.o_auth_grant_type import OAuthGrantType +from capif_security.models.security_method import SecurityMethod +from capif_security import util + from capif_security.models.interface_description import InterfaceDescription # noqa: E501 from capif_security.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from capif_security.models.security_method import SecurityMethod # noqa: E501 - class SecurityInformation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/security_method.py b/services/TS29222_CAPIF_Security_API/capif_security/models/security_method.py index 1d5bfae9..c319a38a 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/security_method.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/security_method.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py b/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py index 90e4e803..538c655f 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py @@ -1,10 +1,12 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model -from capif_security.models.cause import Cause # noqa: E501 +from capif_security.models.cause import Cause +from capif_security import util +from capif_security.models.cause import Cause # noqa: E501 class SecurityNotification(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py b/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py index 7556c8e7..c0bae73e 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py @@ -1,12 +1,16 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security.models.security_information import SecurityInformation +from capif_security.models.websock_notif_config import WebsockNotifConfig +import re +from capif_security import util + from capif_security.models.security_information import SecurityInformation # noqa: E501 from capif_security.models.websock_notif_config import WebsockNotifConfig # noqa: E501 - +import re # noqa: E501 class ServiceSecurity(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -174,6 +178,6 @@ class ServiceSecurity(Model): :type supported_features: str """ if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 - raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/snssai.py b/services/TS29222_CAPIF_Security_API/capif_security/models/snssai.py index 557c4bde..1d00dd90 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/snssai.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/snssai.py @@ -1,10 +1,12 @@ -import re # noqa: E501 from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +import re +from capif_security import util +import re # noqa: E501 class Snssai(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -94,6 +96,6 @@ class Snssai(Model): :type sd: str """ if sd is not None and not re.search(r'^[A-Fa-f0-9]{6}$', sd): # noqa: E501 - raise ValueError("Invalid value for `sd`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{6}$/`") # noqa: E501 + raise ValueError(r"Invalid value for `sd`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{6}$/`") # noqa: E501 self._sd = sd diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/websock_notif_config.py b/services/TS29222_CAPIF_Security_API/capif_security/models/websock_notif_config.py index b72b264f..1482ee7d 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/websock_notif_config.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/websock_notif_config.py @@ -1,8 +1,9 @@ from datetime import date, datetime # noqa: F401 + from typing import List, Dict # noqa: F401 -from capif_security import util from capif_security.models.base_model import Model +from capif_security import util class WebsockNotifConfig(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml b/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml index fe88c199..19377498 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml @@ -3,9 +3,9 @@ info: description: "API for CAPIF security management. \n© 2024, 3GPP Organizational\ \ Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Security_API - version: 1.3.0-alpha.4 + version: 1.3.0 externalDocs: - description: 3GPP TS 29.222 V18.5.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/capif-security/v1" @@ -307,9 +307,9 @@ paths: put: callbacks: notificationDestination: - '{request.body#/notificationDestination}': + '{$request.body#/notificationDestination}': post: - operationId: notificationDestination_request_bodyNotificationDestinationPost + operationId: notification_destination_post requestBody: content: application/json: @@ -805,6 +805,9 @@ components: authorizationInfo: authorizationInfo interfaceDetails: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -817,14 +820,17 @@ components: - null aefId: aefId grantType: - - CLIENT_CREDENTIALS - - CLIENT_CREDENTIALS + - null + - null apiId: apiId - selSecurityMethod: null authenticationInfo: authenticationInfo authorizationInfo: authorizationInfo interfaceDetails: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -837,8 +843,8 @@ components: - null aefId: aefId grantType: - - CLIENT_CREDENTIALS - - CLIENT_CREDENTIALS + - null + - null apiId: apiId websockNotifConfig: requestWebsocketUri: true @@ -881,6 +887,9 @@ components: authorizationInfo: authorizationInfo interfaceDetails: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -893,15 +902,13 @@ components: - null aefId: aefId grantType: - - CLIENT_CREDENTIALS - - CLIENT_CREDENTIALS + - null + - null apiId: apiId nullable: true - oneOf: - - required: - - aefId - - required: - - interfaceDetails + oneOf: + - required: ["aefId"] + - required: ["interfaceDetails"] properties: interfaceDetails: $ref: '#/components/schemas/InterfaceDescription' @@ -1097,6 +1104,8 @@ components: - enum: - OVERLIMIT_USAGE - UNEXPECTED_REASON + - AUTHORIZATION_ISSUE + - OTHER_REASON type: string - description: | This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. @@ -1105,7 +1114,11 @@ components: \ to the service API. \nPossible values are:\n- OVERLIMIT_USAGE:\n The\ \ revocation of the authorization of the API invoker is due to the overlimit\n\ \ usage of the service API\n- UNEXPECTED_REASON:\n The revocation\ - \ of the authorization of the API invoker is due to unexpected reason.\n" + \ of the authorization of the API invoker is due to unexpected reason.\n-\ + \ AUTHORIZATION_ISSUE:\n The revocation of the authorization of the API\ + \ invoker is due to API Invoker\n not being authorized anymore by the\ + \ API Provider.\n- OTHER_REASON:\n The revocation of the authorization\ + \ of the API invoker is due to other reason.\n" title: Cause OAuthGrantType: anyOf: @@ -1308,6 +1321,9 @@ components: description: Represents the description of an API's interface. example: ipv6Addr: ipv6Addr + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS securityMethods: - PSK - PSK @@ -1316,13 +1332,10 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr nullable: true - oneOf: - - required: - - ipv4Addr - - required: - - ipv6Addr - - required: - - fqdn + oneOf: + - required: ["fqdn"] + - required: ["ipv4Addr"] + - required: ["ipv6Addr"] properties: ipv4Addr: description: | @@ -1361,6 +1374,12 @@ components: minItems: 1 title: securityMethods type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + minItems: 1 + title: grantTypes + type: array title: InterfaceDescription type: object SecurityMethod: @@ -1530,12 +1549,52 @@ components: format: uuid title: NfInstanceId type: string + vendorId: + description: Vendor ID of the NF Service instance (Private Enterprise Number + assigned by IANA) + pattern: "^[0-9]{6}$" + title: VendorId + type: string + analyticsIds: + items: + $ref: '#/components/schemas/NwdafEvent' + minItems: 1 + title: analyticsIds + type: array + requesterInterIndList: + items: + $ref: '#/components/schemas/MlModelInterInd' + minItems: 1 + title: requesterInterIndList + type: array + sourceVendorId: + description: Vendor ID of the NF Service instance (Private Enterprise Number + assigned by IANA) + pattern: "^[0-9]{6}$" + title: VendorId + type: string required: - grant_type - nfInstanceId - scope title: AccessTokenReq_1 type: object + MlModelInterInd: + description: ML Model Interoperability Indicator per Analytics Id + properties: + analyticsId: + $ref: '#/components/schemas/NwdafEvent' + vendorList: + items: + $ref: '#/components/schemas/VendorId' + minItems: 1 + title: vendorList + type: array + required: + - analyticsId + - vendorList + title: MlModelInterInd + type: object NoProfileMatchInfo: description: Provides the reason for not finding NF matching the search criteria properties: @@ -1809,3 +1868,66 @@ components: \ an alphabetic character or a digit.\n" title: NfServiceSetId type: string + VendorId: + description: Vendor ID of the NF Service instance (Private Enterprise Number + assigned by IANA) + pattern: "^[0-9]{6}$" + title: VendorId + type: string + NwdafEvent: + anyOf: + - enum: + - SLICE_LOAD_LEVEL + - NETWORK_PERFORMANCE + - NF_LOAD + - SERVICE_EXPERIENCE + - UE_MOBILITY + - UE_COMMUNICATION + - QOS_SUSTAINABILITY + - ABNORMAL_BEHAVIOUR + - USER_DATA_CONGESTION + - NSI_LOAD_LEVEL + - DN_PERFORMANCE + - DISPERSION + - RED_TRANS_EXP + - WLAN_PERFORMANCE + - SM_CONGESTION + - PFD_DETERMINATION + - PDU_SESSION_TRAFFIC + - E2E_DATA_VOL_TRANS_TIME + - MOVEMENT_BEHAVIOUR + - LOC_ACCURACY + - RELATIVE_PROXIMITY + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: "Describes the NWDAF Events. \nPossible values are:\n- SLICE_LOAD_LEVEL:\ + \ Indicates that the event subscribed is load level information of Network\n\ + \ Slice.\n- NETWORK_PERFORMANCE: Indicates that the event subscribed is network\ + \ performance\n information.\n- NF_LOAD: Indicates that the event subscribed\ + \ is load level and status of one or several\n Network Functions.\n- SERVICE_EXPERIENCE:\ + \ Indicates that the event subscribed is service experience.\n- UE_MOBILITY:\ + \ Indicates that the event subscribed is UE mobility information.\n- UE_COMMUNICATION:\ + \ Indicates that the event subscribed is UE communication information.\n-\ + \ QOS_SUSTAINABILITY: Indicates that the event subscribed is QoS sustainability.\n\ + - ABNORMAL_BEHAVIOUR: Indicates that the event subscribed is abnormal behaviour.\n\ + - USER_DATA_CONGESTION: Indicates that the event subscribed is user data congestion\n\ + \ information.\n- NSI_LOAD_LEVEL: Indicates that the event subscribed is\ + \ load level information of Network\n Slice and the optionally associated\ + \ Network Slice Instance.\n- DN_PERFORMANCE: Indicates that the event subscribed\ + \ is DN performance information.\n- DISPERSION: Indicates that the event subscribed\ + \ is dispersion information.\n- RED_TRANS_EXP: Indicates that the event subscribed\ + \ is redundant transmission experience.\n- WLAN_PERFORMANCE: Indicates that\ + \ the event subscribed is WLAN performance.\n- SM_CONGESTION: Indicates the\ + \ Session Management Congestion Control Experience information\n for specific\ + \ DNN and/or S-NSSAI.\n- PFD_DETERMINATION: Indicates that the event subscribed\ + \ is the PFD Determination nformation\n for known application identifier(s).\n\ + - PDU_SESSION_TRAFFIC: Indicates that the event subscribed is the PDU Session\ + \ traffic\n information.\n- E2E_DATA_VOL_TRANS_TIME: Indicates that the event\ + \ subscribed is of E2E data volume \n transfer time.\n- MOVEMENT_BEHAVIOUR:\ + \ Indicates that the event subscribed is the Movement Behaviour\n information.\n\ + - LOC_ACCURACY: Indicates that the event subscribed is of location accuracy.\n\ + - RELATIVE_PROXIMITY: Indicates that the event subscribed is the Relative\ + \ Proximity\n information.\n" + title: NwdafEvent diff --git a/services/TS29222_CAPIF_Security_API/capif_security/test/__init__.py b/services/TS29222_CAPIF_Security_API/capif_security/test/__init__.py index aa37efef..d3c5dca1 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/test/__init__.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/test/__init__.py @@ -1,9 +1,10 @@ import logging import connexion -from capif_security.encoder import JSONEncoder from flask_testing import TestCase +from capif_security.encoder import JSONEncoder + class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py b/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py index 0fbd10e6..f89c1c51 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py @@ -1,8 +1,15 @@ import unittest -from capif_security.test import BaseTestCase from flask import json +from capif_security.models.access_token_err import AccessTokenErr # noqa: E501 +from capif_security.models.access_token_rsp import AccessTokenRsp # noqa: E501 +from capif_security.models.problem_details import ProblemDetails # noqa: E501 +from capif_security.models.res_owner_id import ResOwnerId # noqa: E501 +from capif_security.models.security_notification import SecurityNotification # noqa: E501 +from capif_security.models.service_security import ServiceSecurity # noqa: E501 +from capif_security.test import BaseTestCase + class TestDefaultController(BaseTestCase): """DefaultController integration test stubs""" @@ -90,7 +97,7 @@ class TestDefaultController(BaseTestCase): """ - service_security = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","securityInfo":[{"authenticationInfo":"authenticationInfo","authorizationInfo":"authorizationInfo","interfaceDetails":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"prefSecurityMethods":[null,null],"aefId":"aefId","grantType":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"apiId":"apiId"},{"authenticationInfo":"authenticationInfo","authorizationInfo":"authorizationInfo","interfaceDetails":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"prefSecurityMethods":[null,null],"aefId":"aefId","grantType":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"apiId":"apiId"}],"websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"requestTestNotification":True} + service_security = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","securityInfo":[{"authenticationInfo":"authenticationInfo","authorizationInfo":"authorizationInfo","interfaceDetails":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"prefSecurityMethods":[null,null],"aefId":"aefId","grantType":[null,null],"apiId":"apiId"},{"authenticationInfo":"authenticationInfo","authorizationInfo":"authorizationInfo","interfaceDetails":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"prefSecurityMethods":[null,null],"aefId":"aefId","grantType":[null,null],"apiId":"apiId"}],"websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"requestTestNotification":True} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', @@ -109,7 +116,7 @@ class TestDefaultController(BaseTestCase): """ - service_security = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","securityInfo":[{"authenticationInfo":"authenticationInfo","authorizationInfo":"authorizationInfo","interfaceDetails":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"prefSecurityMethods":[null,null],"aefId":"aefId","grantType":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"apiId":"apiId"},{"authenticationInfo":"authenticationInfo","authorizationInfo":"authorizationInfo","interfaceDetails":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"prefSecurityMethods":[null,null],"aefId":"aefId","grantType":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"apiId":"apiId"}],"websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"requestTestNotification":True} + service_security = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","securityInfo":[{"authenticationInfo":"authenticationInfo","authorizationInfo":"authorizationInfo","interfaceDetails":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"prefSecurityMethods":[null,null],"aefId":"aefId","grantType":[null,null],"apiId":"apiId"},{"authenticationInfo":"authenticationInfo","authorizationInfo":"authorizationInfo","interfaceDetails":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"prefSecurityMethods":[null,null],"aefId":"aefId","grantType":[null,null],"apiId":"apiId"}],"websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"requestTestNotification":True} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', diff --git a/services/TS29222_CAPIF_Security_API/capif_security/typing_utils.py b/services/TS29222_CAPIF_Security_API/capif_security/typing_utils.py index d21c4f63..74e3c913 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/typing_utils.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/typing_utils.py @@ -1,6 +1,7 @@ import sys if sys.version_info < (3, 7): + import typing def is_generic(klass): """ Determine whether klass is a generic class """ diff --git a/services/TS29222_CAPIF_Security_API/setup.py b/services/TS29222_CAPIF_Security_API/setup.py index fc9b23b7..9653f405 100644 --- a/services/TS29222_CAPIF_Security_API/setup.py +++ b/services/TS29222_CAPIF_Security_API/setup.py @@ -1,3 +1,4 @@ +import sys from setuptools import setup, find_packages NAME = "capif_security" -- GitLab From ffe5510b391a706e9f6104885bd92659d840faa3 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Mon, 7 Apr 2025 17:58:57 +0300 Subject: [PATCH 102/157] Change helper version of gunicorn --- services/helper/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/helper/requirements.txt b/services/helper/requirements.txt index 48b0fba6..2a09c37f 100644 --- a/services/helper/requirements.txt +++ b/services/helper/requirements.txt @@ -6,5 +6,5 @@ flask_jwt_extended == 4.6.0 pyopenssl == 24.1.0 pyyaml == 6.0.1 requests == 2.32.2 -gunicorn == 22.0.0 +gunicorn == 23.0.0 packaging == 24.0 -- GitLab From 9ac8eee1a04d4cb185d3dcd75c3c8caa6f3758ea Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Wed, 9 Apr 2025 12:19:54 +0200 Subject: [PATCH 103/157] Removed duplicated and unused imports --- .../api_invoker_management/app.py | 9 ++- .../controllers/default_controller.py | 4 +- ...pi_invoker_enrolment_details_controller.py | 3 +- .../core/apiinvokerenrolmentdetails.py | 12 ++-- .../api_invoker_management/core/publisher.py | 1 + .../core/redis_event.py | 2 +- .../core/redis_internal_event.py | 2 +- .../core/validate_user.py | 6 +- .../api_invoker_management/models/__init__.py | 47 ------------- .../models/aef_location.py | 9 +-- .../models/aef_profile.py | 16 +---- .../models/api_invoker_enrolment_details.py | 13 ++-- .../api_invoker_enrolment_details_patch.py | 9 +-- .../api_invoker_management/models/api_list.py | 8 +-- .../models/api_status.py | 5 +- .../models/base_model.py | 1 - .../models/civic_address.py | 5 +- .../models/communication_type.py | 5 +- .../models/custom_operation.py | 9 +-- .../models/data_format.py | 5 +- .../models/ellipsoid_arc.py | 10 +-- .../models/gad_shape.py | 8 +-- .../models/geographic_area.py | 17 +---- .../models/geographical_coordinates.py | 5 +- .../models/interface_description.py | 12 ++-- .../models/invalid_param.py | 5 +- .../models/ip_addr_range.py | 9 +-- .../models/ipv4_address_range.py | 8 +-- .../models/ipv6_addr1.py | 5 +- .../models/ipv6_address_range.py | 8 +-- .../local2d_point_uncertainty_ellipse.py | 12 +--- .../local3d_point_uncertainty_ellipsoid.py | 12 +--- .../models/local_origin.py | 9 +-- .../models/o_auth_grant_type.py | 5 +- .../models/onboarding_information.py | 5 +- .../models/onboarding_notification.py | 9 +-- .../models/operation.py | 5 +- .../api_invoker_management/models/point.py | 10 +-- .../models/point_altitude.py | 10 +-- .../models/point_altitude_uncertainty.py | 11 +--- .../models/point_uncertainty_circle.py | 10 +-- .../models/point_uncertainty_ellipse.py | 11 +--- .../api_invoker_management/models/polygon.py | 10 +-- .../models/problem_details.py | 11 ++-- .../api_invoker_management/models/protocol.py | 5 +- .../models/published_api_path.py | 5 +- .../models/relative_cartesian_location.py | 5 +- .../api_invoker_management/models/resource.py | 10 +-- .../models/security_method.py | 5 +- .../models/service_api_description.py | 14 ++-- .../models/service_kpis.py | 8 +-- .../models/shareable_information.py | 5 +- .../models/supported_gad_shapes.py | 5 +- .../models/uncertainty_ellipse.py | 5 +- .../models/uncertainty_ellipsoid.py | 5 +- .../api_invoker_management/models/version.py | 9 +-- .../models/websock_notif_config.py | 5 +- .../api_invoker_management/test/__init__.py | 3 +- .../test/test_default_controller.py | 3 +- ...pi_invoker_enrolment_details_controller.py | 6 +- .../api_invoker_management/util.py | 1 + .../setup.py | 2 +- .../api_provider_management/app.py | 2 +- .../controllers/default_controller.py | 4 +- ...i_provider_enrolment_details_controller.py | 2 +- .../core/provider_enrolment_details_api.py | 9 ++- .../api_provider_management/core/publisher.py | 1 + .../core/redis_internal_event.py | 2 +- .../core/validate_user.py | 6 +- .../models/api_provider_enrolment_details.py | 11 ++-- .../api_provider_enrolment_details_patch.py | 8 +-- .../models/api_provider_func_role.py | 5 +- .../models/api_provider_function_details.py | 9 +-- .../models/base_model.py | 1 - .../models/invalid_param.py | 5 +- .../models/problem_details.py | 11 ++-- .../models/registration_information.py | 5 +- .../api_provider_management/test/__init__.py | 3 +- .../test/test_default_controller.py | 3 +- ...i_provider_enrolment_details_controller.py | 6 +- .../setup.py | 2 +- .../capif_acl/app.py | 9 ++- .../controllers/default_controller.py | 7 +- .../controllers/security_controller.py | 1 - .../capif_acl/core/accesscontrolpolicyapi.py | 2 +- .../capif_acl/models/__init__.py | 5 -- .../models/access_control_policy_list.py | 8 +-- .../capif_acl/models/api_invoker_policy.py | 8 +-- .../capif_acl/models/base_model.py | 1 - .../capif_acl/models/invalid_param.py | 5 +- .../capif_acl/models/problem_details.py | 11 ++-- .../capif_acl/models/time_range_list.py | 5 +- .../capif_acl/test/__init__.py | 3 +- .../setup.py | 2 +- .../TS29222_CAPIF_Auditing_API/logs/app.py | 7 +- .../logs/controllers/default_controller.py | 2 +- .../logs/core/auditoperations.py | 4 +- .../logs/encoder.py | 1 - .../logs/models/__init__.py | 11 ---- .../logs/models/base_model.py | 1 - .../logs/models/interface_description.py | 12 ++-- .../logs/models/invalid_param.py | 5 +- .../logs/models/invocation_log.py | 11 ++-- .../logs/models/invocation_logs.py | 11 ++-- .../models/invocation_logs_retrieve_res.py | 13 ++-- .../logs/models/log.py | 10 +-- .../logs/models/o_auth_grant_type.py | 5 +- .../logs/models/operation.py | 5 +- .../logs/models/problem_details.py | 11 ++-- .../logs/models/protocol.py | 5 +- .../logs/models/security_method.py | 5 +- .../logs/test/__init__.py | 1 - .../logs/test/test_default_controller.py | 2 - services/TS29222_CAPIF_Auditing_API/setup.py | 4 +- .../service_apis/app.py | 7 +- .../controllers/default_controller.py | 2 +- .../service_apis/core/discoveredapis.py | 5 +- .../service_apis/encoder.py | 1 - .../service_apis/models/__init__.py | 43 ------------ .../service_apis/models/aef_location.py | 9 +-- .../service_apis/models/aef_profile.py | 16 +---- .../service_apis/models/api_status.py | 5 +- .../service_apis/models/base_model.py | 1 - .../service_apis/models/civic_address.py | 5 +- .../service_apis/models/communication_type.py | 5 +- .../service_apis/models/custom_operation.py | 9 +-- .../service_apis/models/data_format.py | 5 +- .../service_apis/models/discovered_apis.py | 11 ++-- .../service_apis/models/ellipsoid_arc.py | 10 +-- .../service_apis/models/gad_shape.py | 8 +-- .../service_apis/models/geographic_area.py | 17 +---- .../models/geographical_coordinates.py | 5 +- .../models/interface_description.py | 12 ++-- .../service_apis/models/invalid_param.py | 5 +- .../service_apis/models/ip_addr_info.py | 5 +- .../service_apis/models/ip_addr_range.py | 9 +-- .../service_apis/models/ipv4_address_range.py | 8 +-- .../service_apis/models/ipv6_addr1.py | 5 +- .../service_apis/models/ipv6_address_range.py | 8 +-- .../local2d_point_uncertainty_ellipse.py | 12 +--- .../local3d_point_uncertainty_ellipsoid.py | 12 +--- .../service_apis/models/local_origin.py | 9 +-- .../service_apis/models/o_auth_grant_type.py | 5 +- .../service_apis/models/operation.py | 5 +- .../service_apis/models/point.py | 10 +-- .../service_apis/models/point_altitude.py | 10 +-- .../models/point_altitude_uncertainty.py | 11 +--- .../models/point_uncertainty_circle.py | 10 +-- .../models/point_uncertainty_ellipse.py | 11 +--- .../service_apis/models/polygon.py | 10 +-- .../service_apis/models/problem_details.py | 11 ++-- .../service_apis/models/protocol.py | 5 +- .../service_apis/models/published_api_path.py | 5 +- .../models/relative_cartesian_location.py | 5 +- .../service_apis/models/resource.py | 10 +-- .../service_apis/models/security_method.py | 5 +- .../models/service_api_description.py | 14 ++-- .../service_apis/models/service_kpis.py | 8 +-- .../models/shareable_information.py | 5 +- .../models/supported_gad_shapes.py | 5 +- .../models/uncertainty_ellipse.py | 5 +- .../models/uncertainty_ellipsoid.py | 5 +- .../service_apis/models/version.py | 9 +-- .../service_apis/test/__init__.py | 1 - .../test/test_default_controller.py | 2 - .../setup.py | 4 +- .../capif_events/app.py | 11 ++-- .../controllers/default_controller.py | 2 +- .../capif_events/core/events_apis.py | 7 +- .../capif_events/core/notifications.py | 1 - .../capif_events/core/validate_user.py | 6 +- .../capif_events/models/__init__.py | 66 ------------------- .../models/access_control_policy_list.py | 8 +-- .../models/access_control_policy_list_ext.py | 8 +-- .../capif_events/models/aef_location.py | 9 +-- .../capif_events/models/aef_profile.py | 16 +---- .../capif_events/models/api_invoker_policy.py | 8 +-- .../capif_events/models/api_status.py | 5 +- .../capif_events/models/base_model.py | 1 - .../models/buffered_notifications_action.py | 5 +- .../capif_events/models/capif_event.py | 5 +- .../capif_events/models/capif_event_detail.py | 11 +--- .../capif_events/models/capif_event_filter.py | 5 +- .../capif_events/models/civic_address.py | 5 +- .../capif_events/models/communication_type.py | 5 +- .../capif_events/models/custom_operation.py | 9 +-- .../capif_events/models/data_format.py | 5 +- .../capif_events/models/ellipsoid_arc.py | 10 +-- .../capif_events/models/event_notification.py | 9 +-- .../capif_events/models/event_subscription.py | 14 ++-- .../models/event_subscription_patch.py | 10 +-- .../capif_events/models/gad_shape.py | 8 +-- .../capif_events/models/geographic_area.py | 17 +---- .../models/geographical_coordinates.py | 5 +- .../models/interface_description.py | 12 ++-- .../capif_events/models/invalid_param.py | 5 +- .../capif_events/models/invocation_log.py | 11 ++-- .../capif_events/models/ip_addr_range.py | 9 +-- .../capif_events/models/ipv4_address_range.py | 8 +-- .../models/ipv4_address_range1.py | 8 +-- .../capif_events/models/ipv6_addr1.py | 5 +- .../capif_events/models/ipv6_address_range.py | 5 +- .../models/ipv6_address_range1.py | 8 +-- .../local2d_point_uncertainty_ellipse.py | 12 +--- .../local3d_point_uncertainty_ellipsoid.py | 12 +--- .../capif_events/models/local_origin.py | 9 +-- .../capif_events/models/log.py | 10 +-- .../models/muting_exception_instructions.py | 9 +-- .../models/muting_notifications_settings.py | 5 +- .../capif_events/models/notification_flag.py | 5 +- .../models/notification_method.py | 5 +- .../capif_events/models/o_auth_grant_type.py | 5 +- .../capif_events/models/operation.py | 5 +- .../models/partitioning_criteria.py | 5 +- .../capif_events/models/point.py | 10 +-- .../capif_events/models/point_altitude.py | 10 +-- .../models/point_altitude_uncertainty.py | 11 +--- .../models/point_uncertainty_circle.py | 10 +-- .../models/point_uncertainty_ellipse.py | 11 +--- .../capif_events/models/polygon.py | 10 +-- .../capif_events/models/problem_details.py | 11 ++-- .../capif_events/models/protocol.py | 5 +- .../capif_events/models/published_api_path.py | 5 +- .../models/relative_cartesian_location.py | 5 +- .../models/reporting_information.py | 12 +--- .../capif_events/models/resource.py | 10 +-- .../capif_events/models/routing_rule.py | 10 +-- .../capif_events/models/security_method.py | 5 +- .../models/service_api_description.py | 14 ++-- .../capif_events/models/service_kpis.py | 8 +-- .../models/shareable_information.py | 5 +- .../models/subscription_action.py | 5 +- .../models/supported_gad_shapes.py | 5 +- .../capif_events/models/time_range_list.py | 5 +- .../capif_events/models/topology_hiding.py | 8 +-- .../models/uncertainty_ellipse.py | 5 +- .../models/uncertainty_ellipsoid.py | 5 +- .../capif_events/models/version.py | 9 +-- .../models/websock_notif_config.py | 5 +- .../capif_events/test/__init__.py | 3 +- .../test/test_default_controller.py | 3 +- services/TS29222_CAPIF_Events_API/setup.py | 4 +- .../api_invocation_logs/app.py | 7 +- .../controllers/default_controller.py | 4 +- .../core/invocationlogs.py | 6 +- .../api_invocation_logs/core/redis_event.py | 2 +- .../api_invocation_logs/core/validate_user.py | 6 +- .../api_invocation_logs/models/__init__.py | 9 --- .../api_invocation_logs/models/base_model.py | 1 - .../models/interface_description.py | 12 ++-- .../models/invalid_param.py | 5 +- .../models/invocation_log.py | 11 ++-- .../api_invocation_logs/models/log.py | 10 +-- .../models/o_auth_grant_type.py | 5 +- .../api_invocation_logs/models/operation.py | 5 +- .../models/problem_details.py | 11 ++-- .../api_invocation_logs/models/protocol.py | 5 +- .../models/security_method.py | 5 +- .../api_invocation_logs/test/__init__.py | 3 +- .../test/test_default_controller.py | 3 +- .../setup.py | 4 +- .../published_apis/app.py | 11 ++-- .../controllers/default_controller.py | 4 +- ...individual_apf_published_api_controller.py | 2 +- .../controllers/security_controller.py | 1 - .../published_apis/core/publisher.py | 1 + .../published_apis/core/redis_event.py | 2 +- .../core/serviceapidescriptions.py | 16 +++-- .../published_apis/core/validate_user.py | 6 +- .../published_apis/encoder.py | 1 - .../published_apis/models/__init__.py | 42 ------------ .../published_apis/models/aef_location.py | 9 +-- .../published_apis/models/aef_profile.py | 16 +---- .../published_apis/models/api_status.py | 5 +- .../published_apis/models/base_model.py | 1 - .../published_apis/models/civic_address.py | 5 +- .../models/communication_type.py | 5 +- .../published_apis/models/custom_operation.py | 9 +-- .../published_apis/models/data_format.py | 5 +- .../published_apis/models/ellipsoid_arc.py | 10 +-- .../published_apis/models/gad_shape.py | 8 +-- .../published_apis/models/geographic_area.py | 17 +---- .../models/geographical_coordinates.py | 5 +- .../models/interface_description.py | 12 ++-- .../published_apis/models/invalid_param.py | 5 +- .../published_apis/models/ip_addr_range.py | 9 +-- .../models/ipv4_address_range.py | 8 +-- .../published_apis/models/ipv6_addr1.py | 5 +- .../models/ipv6_address_range.py | 8 +-- .../local2d_point_uncertainty_ellipse.py | 12 +--- .../local3d_point_uncertainty_ellipsoid.py | 12 +--- .../published_apis/models/local_origin.py | 9 +-- .../models/o_auth_grant_type.py | 5 +- .../published_apis/models/operation.py | 5 +- .../published_apis/models/point.py | 10 +-- .../published_apis/models/point_altitude.py | 10 +-- .../models/point_altitude_uncertainty.py | 11 +--- .../models/point_uncertainty_circle.py | 10 +-- .../models/point_uncertainty_ellipse.py | 11 +--- .../published_apis/models/polygon.py | 10 +-- .../published_apis/models/problem_details.py | 11 ++-- .../published_apis/models/protocol.py | 5 +- .../models/published_api_path.py | 5 +- .../models/relative_cartesian_location.py | 5 +- .../published_apis/models/resource.py | 10 +-- .../published_apis/models/security_method.py | 5 +- .../models/service_api_description.py | 14 ++-- .../models/service_api_description_patch.py | 14 ++-- .../published_apis/models/service_kpis.py | 8 +-- .../models/shareable_information.py | 5 +- .../models/supported_gad_shapes.py | 5 +- .../models/uncertainty_ellipse.py | 5 +- .../models/uncertainty_ellipsoid.py | 5 +- .../published_apis/models/version.py | 9 +-- .../published_apis/test/__init__.py | 1 - .../test/test_default_controller.py | 1 - ...individual_apf_published_api_controller.py | 1 - .../published_apis/util.py | 1 - .../published_apis/vendor_specific.py | 1 + .../setup.py | 4 +- .../capif_routing_info/app.py | 1 - .../controllers/default_controller.py | 5 -- .../controllers/security_controller.py | 1 - .../capif_routing_info/encoder.py | 4 +- .../capif_routing_info/models/__init__.py | 41 ------------ .../capif_routing_info/models/aef_location.py | 9 +-- .../capif_routing_info/models/aef_profile.py | 16 +---- .../capif_routing_info/models/base_model.py | 1 - .../models/civic_address.py | 5 +- .../models/communication_type.py | 5 +- .../models/custom_operation.py | 9 +-- .../capif_routing_info/models/data_format.py | 5 +- .../models/ellipsoid_arc.py | 10 +-- .../capif_routing_info/models/gad_shape.py | 8 +-- .../models/geographic_area.py | 17 +---- .../models/geographical_coordinates.py | 5 +- .../models/interface_description.py | 12 ++-- .../models/invalid_param.py | 5 +- .../models/ip_addr_range.py | 9 +-- .../models/ipv4_address_range.py | 8 +-- .../models/ipv4_address_range1.py | 8 +-- .../capif_routing_info/models/ipv6_addr1.py | 5 +- .../models/ipv6_address_range.py | 5 +- .../models/ipv6_address_range1.py | 8 +-- .../local2d_point_uncertainty_ellipse.py | 12 +--- .../local3d_point_uncertainty_ellipsoid.py | 12 +--- .../capif_routing_info/models/local_origin.py | 9 +-- .../models/o_auth_grant_type.py | 5 +- .../capif_routing_info/models/operation.py | 5 +- .../capif_routing_info/models/point.py | 10 +-- .../models/point_altitude.py | 10 +-- .../models/point_altitude_uncertainty.py | 11 +--- .../models/point_uncertainty_circle.py | 10 +-- .../models/point_uncertainty_ellipse.py | 11 +--- .../capif_routing_info/models/polygon.py | 10 +-- .../models/problem_details.py | 11 ++-- .../capif_routing_info/models/protocol.py | 5 +- .../models/relative_cartesian_location.py | 5 +- .../capif_routing_info/models/resource.py | 10 +-- .../capif_routing_info/models/routing_info.py | 8 +-- .../capif_routing_info/models/routing_rule.py | 10 +-- .../models/security_method.py | 5 +- .../capif_routing_info/models/service_kpis.py | 8 +-- .../models/supported_gad_shapes.py | 5 +- .../models/uncertainty_ellipse.py | 5 +- .../models/uncertainty_ellipsoid.py | 5 +- .../capif_routing_info/models/version.py | 9 +-- .../capif_routing_info/test/__init__.py | 3 +- .../test/test_default_controller.py | 2 - .../capif_routing_info/util.py | 1 - .../TS29222_CAPIF_Routing_Info_API/setup.py | 4 +- .../capif_security/app.py | 9 ++- .../controllers/default_controller.py | 2 +- .../capif_security/core/redis_event.py | 2 +- .../core/redis_internal_event.py | 2 +- .../capif_security/core/servicesecurity.py | 8 +-- .../capif_security/core/validate_user.py | 6 +- .../capif_security/models/__init__.py | 28 -------- .../models/access_token_claims.py | 8 +-- .../capif_security/models/access_token_err.py | 5 +- .../models/access_token_err1.py | 5 +- .../models/access_token_req1.py | 16 ++--- .../capif_security/models/access_token_rsp.py | 5 +- .../capif_security/models/base_model.py | 1 - .../capif_security/models/cause.py | 5 +- .../models/interface_description.py | 12 ++-- .../capif_security/models/invalid_param.py | 5 +- .../capif_security/models/invalid_param1.py | 5 +- .../models/ml_model_inter_ind.py | 8 +-- .../capif_security/models/nf_type.py | 5 +- .../models/no_profile_match_info.py | 9 +-- .../models/no_profile_match_reason.py | 5 +- .../capif_security/models/nwdaf_event.py | 5 +- .../models/o_auth_grant_type.py | 5 +- .../capif_security/models/plmn_id.py | 8 +-- .../capif_security/models/plmn_id_nid.py | 8 +-- .../capif_security/models/problem_details.py | 11 ++-- .../capif_security/models/problem_details1.py | 14 ++-- .../models/query_param_combination.py | 8 +-- .../capif_security/models/query_parameter.py | 5 +- .../capif_security/models/res_owner_id.py | 8 +-- .../models/security_information.py | 10 +-- .../capif_security/models/security_method.py | 5 +- .../models/security_notification.py | 8 +-- .../capif_security/models/service_security.py | 12 ++-- .../capif_security/models/snssai.py | 8 +-- .../models/websock_notif_config.py | 5 +- .../capif_security/test/__init__.py | 3 +- .../test/test_default_controller.py | 3 +- services/TS29222_CAPIF_Security_API/setup.py | 4 +- services/helper/helper_service/app.py | 8 +-- .../controllers/helper_controller.py | 2 +- .../helper_service/core/helper_operations.py | 11 +++- services/helper/helper_service/utils/utils.py | 2 + services/register/register_service/app.py | 7 +- .../controllers/register_controller.py | 2 +- .../core/register_operations.py | 4 +- .../register/register_service/utils/utils.py | 2 + 418 files changed, 984 insertions(+), 2130 deletions(-) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/app.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/app.py index e44c08e4..abe58596 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/app.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/app.py @@ -6,6 +6,9 @@ from datetime import datetime from logging.handlers import RotatingFileHandler import connexion +import encoder +from config import Config +from core.consumer_messager import Subscriber from flask_apscheduler import APScheduler from flask_executor import Executor from flask_jwt_extended import JWTManager @@ -19,10 +22,6 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator -import encoder -from config import Config -from core.consumer_messager import Subscriber - NAME = "Invoker-Service" # Setting log level @@ -36,7 +35,7 @@ def configure_monitoring(app, config): fluent_bit_host = config['monitoring']['fluent_bit_host'] fluent_bit_port = config['monitoring']['fluent_bit_port'] fluent_bit_sender = sender.FluentSender('Invoker-Service', host=fluent_bit_host, port=fluent_bit_port) - propagator = TraceContextTextMapPropagator() + TraceContextTextMapPropagator() tracer_provider = TracerProvider(resource=resource) trace.set_tracer_provider(tracer_provider) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py index 118e93fd..09ffb624 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py @@ -2,8 +2,8 @@ from functools import wraps from cryptography import x509 from cryptography.hazmat.backends import default_backend -from flask import request, current_app -from flask_jwt_extended import jwt_required, get_jwt_identity +from flask import current_app, request +from flask_jwt_extended import get_jwt_identity, jwt_required from ..core.apiinvokerenrolmentdetails import InvokerManagementOperations from ..core.validate_user import ControlAccess diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py index bdc1fd92..052679b4 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py @@ -1,4 +1,5 @@ -from api_invoker_management.models.api_invoker_enrolment_details_patch import APIInvokerEnrolmentDetailsPatch # noqa: E501 +from api_invoker_management.models.api_invoker_enrolment_details_patch import \ + APIInvokerEnrolmentDetailsPatch # noqa: E501 def modify_ind_api_invoke_enrolment(onboarding_id, body): # noqa: E501 diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py index 08f934e3..e3164aeb 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py @@ -5,21 +5,19 @@ from datetime import datetime import requests import rfc3987 +from api_invoker_management.db.db import MongoDatabse from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails -from flask import current_app, Response +from flask import Response, current_app from pymongo import ReturnDocument +from ..config import Config +from ..util import dict_to_camel_case, serialize_clean_camel_case from .auth_manager import AuthManager from .publisher import Publisher from .redis_event import RedisEvent from .redis_internal_event import RedisInternalEvent from .resources import Resource -from .responses import bad_request_error, not_found_error, forbidden_error, internal_server_error, make_response -from ..config import Config -from ..util import dict_to_camel_case, serialize_clean_camel_case - -from api_invoker_management.db.db import MongoDatabse - +from .responses import bad_request_error, forbidden_error, internal_server_error, make_response, not_found_error publisher_ops = Publisher() diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/publisher.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/publisher.py index 34fcdf45..8292de4d 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/publisher.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/publisher.py @@ -1,5 +1,6 @@ import redis + class Publisher(): def __init__(self): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/redis_event.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/redis_event.py index f80e6b2e..3037ae76 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/redis_event.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/redis_event.py @@ -1,7 +1,7 @@ import json -from .publisher import Publisher from ..encoder import JSONEncoder +from .publisher import Publisher publisher_ops = Publisher() diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/redis_internal_event.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/redis_internal_event.py index 50e34342..c1ad0973 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/redis_internal_event.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/redis_internal_event.py @@ -1,7 +1,7 @@ import json -from .publisher import Publisher from ..encoder import JSONEncoder +from .publisher import Publisher publisher_ops = Publisher() diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/validate_user.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/validate_user.py index 1b25fd6a..917c4ccb 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/validate_user.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/validate_user.py @@ -1,12 +1,12 @@ import json -from flask import current_app, Response +from flask import Response, current_app -from .resources import Resource -from .responses import internal_server_error from ..encoder import CustomJSONEncoder from ..models.problem_details import ProblemDetails from ..util import serialize_clean_camel_case +from .resources import Resource +from .responses import internal_server_error class ControlAccess(Resource): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/__init__.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/__init__.py index 274af8e6..d036df69 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/__init__.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/__init__.py @@ -1,49 +1,2 @@ # flake8: noqa # import models into model package -from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails -from api_invoker_management.models.api_invoker_enrolment_details_patch import APIInvokerEnrolmentDetailsPatch -from api_invoker_management.models.api_list import APIList -from api_invoker_management.models.aef_location import AefLocation -from api_invoker_management.models.aef_profile import AefProfile -from api_invoker_management.models.api_status import ApiStatus -from api_invoker_management.models.civic_address import CivicAddress -from api_invoker_management.models.communication_type import CommunicationType -from api_invoker_management.models.custom_operation import CustomOperation -from api_invoker_management.models.data_format import DataFormat -from api_invoker_management.models.ellipsoid_arc import EllipsoidArc -from api_invoker_management.models.gad_shape import GADShape -from api_invoker_management.models.geographic_area import GeographicArea -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates -from api_invoker_management.models.interface_description import InterfaceDescription -from api_invoker_management.models.invalid_param import InvalidParam -from api_invoker_management.models.ip_addr_range import IpAddrRange -from api_invoker_management.models.ipv4_address_range import Ipv4AddressRange -from api_invoker_management.models.ipv6_addr1 import Ipv6Addr1 -from api_invoker_management.models.ipv6_address_range import Ipv6AddressRange -from api_invoker_management.models.local2d_point_uncertainty_ellipse import Local2dPointUncertaintyEllipse -from api_invoker_management.models.local3d_point_uncertainty_ellipsoid import Local3dPointUncertaintyEllipsoid -from api_invoker_management.models.local_origin import LocalOrigin -from api_invoker_management.models.o_auth_grant_type import OAuthGrantType -from api_invoker_management.models.onboarding_information import OnboardingInformation -from api_invoker_management.models.onboarding_notification import OnboardingNotification -from api_invoker_management.models.operation import Operation -from api_invoker_management.models.point import Point -from api_invoker_management.models.point_altitude import PointAltitude -from api_invoker_management.models.point_altitude_uncertainty import PointAltitudeUncertainty -from api_invoker_management.models.point_uncertainty_circle import PointUncertaintyCircle -from api_invoker_management.models.point_uncertainty_ellipse import PointUncertaintyEllipse -from api_invoker_management.models.polygon import Polygon -from api_invoker_management.models.problem_details import ProblemDetails -from api_invoker_management.models.protocol import Protocol -from api_invoker_management.models.published_api_path import PublishedApiPath -from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation -from api_invoker_management.models.resource import Resource -from api_invoker_management.models.security_method import SecurityMethod -from api_invoker_management.models.service_api_description import ServiceAPIDescription -from api_invoker_management.models.service_kpis import ServiceKpis -from api_invoker_management.models.shareable_information import ShareableInformation -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes -from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse -from api_invoker_management.models.uncertainty_ellipsoid import UncertaintyEllipsoid -from api_invoker_management.models.version import Version -from api_invoker_management.models.websock_notif_config import WebsockNotifConfig diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py index 226cef2c..512c9804 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.civic_address import CivicAddress -from api_invoker_management.models.geographic_area import GeographicArea from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.civic_address import CivicAddress # noqa: E501 from api_invoker_management.models.geographic_area import GeographicArea # noqa: E501 + class AefLocation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py index d650c30b..62866226 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py @@ -1,20 +1,9 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.aef_location import AefLocation -from api_invoker_management.models.data_format import DataFormat -from api_invoker_management.models.interface_description import InterfaceDescription -from api_invoker_management.models.ip_addr_range import IpAddrRange -from api_invoker_management.models.o_auth_grant_type import OAuthGrantType -from api_invoker_management.models.protocol import Protocol -from api_invoker_management.models.security_method import SecurityMethod -from api_invoker_management.models.service_kpis import ServiceKpis -from api_invoker_management.models.version import Version from api_invoker_management import util - from api_invoker_management.models.aef_location import AefLocation # noqa: E501 +from api_invoker_management.models.base_model import Model from api_invoker_management.models.data_format import DataFormat # noqa: E501 from api_invoker_management.models.interface_description import InterfaceDescription # noqa: E501 from api_invoker_management.models.ip_addr_range import IpAddrRange # noqa: E501 @@ -24,6 +13,7 @@ from api_invoker_management.models.security_method import SecurityMethod # noqa from api_invoker_management.models.service_kpis import ServiceKpis # noqa: E501 from api_invoker_management.models.version import Version # noqa: E501 + class AefProfile(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py index 521e6b2c..bec061ae 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py @@ -1,18 +1,13 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.api_list import APIList -from api_invoker_management.models.onboarding_information import OnboardingInformation -from api_invoker_management.models.websock_notif_config import WebsockNotifConfig -import re from api_invoker_management import util - from api_invoker_management.models.api_list import APIList # noqa: E501 +from api_invoker_management.models.base_model import Model from api_invoker_management.models.onboarding_information import OnboardingInformation # noqa: E501 from api_invoker_management.models.websock_notif_config import WebsockNotifConfig # noqa: E501 -import re # noqa: E501 + class APIInvokerEnrolmentDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py index 0ac660c7..c827f22b 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.api_list import APIList -from api_invoker_management.models.onboarding_information import OnboardingInformation from api_invoker_management import util - from api_invoker_management.models.api_list import APIList # noqa: E501 +from api_invoker_management.models.base_model import Model from api_invoker_management.models.onboarding_information import OnboardingInformation # noqa: E501 + class APIInvokerEnrolmentDetailsPatch(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py index 6054d75c..25ddd003 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.service_api_description import ServiceAPIDescription from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.service_api_description import ServiceAPIDescription # noqa: E501 + class APIList(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py index c67e0f6c..7bf0540b 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class ApiStatus(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/base_model.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/base_model.py index 9975e6c9..19dfa2af 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/base_model.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/base_model.py @@ -1,5 +1,4 @@ import pprint - import typing from api_invoker_management import util diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/civic_address.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/civic_address.py index a70b83c3..640aff79 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/civic_address.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/civic_address.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class CivicAddress(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/communication_type.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/communication_type.py index a09339c5..0f199361 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/communication_type.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/communication_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class CommunicationType(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py index c39874de..0fc56782 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.communication_type import CommunicationType -from api_invoker_management.models.operation import Operation from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.communication_type import CommunicationType # noqa: E501 from api_invoker_management.models.operation import Operation # noqa: E501 + class CustomOperation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/data_format.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/data_format.py index 3b5ef198..f6ba60af 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/data_format.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/data_format.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class DataFormat(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py index 48576865..de005059 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.gad_shape import GADShape -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class EllipsoidArc(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py index fdbb7ff5..496c79b9 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class GADShape(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py index 11758707..2ec1f553 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py @@ -1,20 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.ellipsoid_arc import EllipsoidArc -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates -from api_invoker_management.models.point import Point -from api_invoker_management.models.point_altitude import PointAltitude -from api_invoker_management.models.point_altitude_uncertainty import PointAltitudeUncertainty -from api_invoker_management.models.point_uncertainty_circle import PointUncertaintyCircle -from api_invoker_management.models.point_uncertainty_ellipse import PointUncertaintyEllipse -from api_invoker_management.models.polygon import Polygon -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes -from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.ellipsoid_arc import EllipsoidArc # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.point import Point # noqa: E501 @@ -26,6 +14,7 @@ from api_invoker_management.models.polygon import Polygon # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class GeographicArea(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographical_coordinates.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographical_coordinates.py index 1e82fce5..8c660935 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographical_coordinates.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographical_coordinates.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class GeographicalCoordinates(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py index 86301d32..3a9d6f55 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py @@ -1,16 +1,12 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.o_auth_grant_type import OAuthGrantType -from api_invoker_management.models.security_method import SecurityMethod -import re from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from api_invoker_management.models.security_method import SecurityMethod # noqa: E501 -import re # noqa: E501 + class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/invalid_param.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/invalid_param.py index 9fd06e46..20270842 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/invalid_param.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/invalid_param.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py index f831d595..70ad8a6f 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.ipv4_address_range import Ipv4AddressRange -from api_invoker_management.models.ipv6_address_range import Ipv6AddressRange from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 from api_invoker_management.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 + class IpAddrRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv4_address_range.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv4_address_range.py index bddd1688..822aaa85 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv4_address_range.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv4_address_range.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -import re from api_invoker_management import util +from api_invoker_management.models.base_model import Model -import re # noqa: E501 class Ipv4AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_addr1.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_addr1.py index ac8e6e66..0d7d43f4 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_addr1.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_addr1.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class Ipv6Addr1(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_address_range.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_address_range.py index 0b461670..9dc04924 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_address_range.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ipv6_address_range.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.ipv6_addr1 import Ipv6Addr1 from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 + class Ipv6AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py index b68d5903..5e05b820 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.gad_shape import GADShape -from api_invoker_management.models.local_origin import LocalOrigin -from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes -from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.local_origin import LocalOrigin # noqa: E501 from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class Local2dPointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py index 1ea64800..22c894f2 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.gad_shape import GADShape -from api_invoker_management.models.local_origin import LocalOrigin -from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes -from api_invoker_management.models.uncertainty_ellipsoid import UncertaintyEllipsoid from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.local_origin import LocalOrigin # noqa: E501 from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from api_invoker_management.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 + class Local3dPointUncertaintyEllipsoid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py index 1f5eb93a..489ceef8 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.geographic_area import GeographicArea -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.geographic_area import GeographicArea # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 + class LocalOrigin(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/o_auth_grant_type.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/o_auth_grant_type.py index 3bc3a6f8..a688eb0c 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/o_auth_grant_type.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/o_auth_grant_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class OAuthGrantType(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py index 8b5f6ea8..2ab7410e 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class OnboardingInformation(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py index 95d256ae..c60d37ee 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py @@ -1,14 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails -from api_invoker_management.models.api_list import APIList from api_invoker_management import util - from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # noqa: E501 from api_invoker_management.models.api_list import APIList # noqa: E501 +from api_invoker_management.models.base_model import Model + class OnboardingNotification(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/operation.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/operation.py index 846011b5..330be5f0 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/operation.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/operation.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class Operation(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py index 82fa8c78..b9f091ae 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.gad_shape import GADShape -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class Point(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py index 514bfe78..f4e1481d 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.gad_shape import GADShape -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class PointAltitude(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py index 71170148..5f5449dd 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.gad_shape import GADShape -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes -from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class PointAltitudeUncertainty(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py index 2b28dd8f..deb1f0a0 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.gad_shape import GADShape -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class PointUncertaintyCircle(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py index 09c55edb..ad7cc40d 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.gad_shape import GADShape -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes -from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class PointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py index 4b939caf..0999dd1b 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.gad_shape import GADShape -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class Polygon(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py index 420db0c1..f4405ce2 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.invalid_param import InvalidParam -import re from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.invalid_param import InvalidParam # noqa: E501 -import re # noqa: E501 + class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/protocol.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/protocol.py index efdaa084..9fefc9c7 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/protocol.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/protocol.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class Protocol(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/published_api_path.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/published_api_path.py index 64da80c7..158dca12 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/published_api_path.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/published_api_path.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class PublishedApiPath(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/relative_cartesian_location.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/relative_cartesian_location.py index 5bdb56a9..82963b5f 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/relative_cartesian_location.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/relative_cartesian_location.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class RelativeCartesianLocation(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py index b9b047b0..e30732ae 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.communication_type import CommunicationType -from api_invoker_management.models.custom_operation import CustomOperation -from api_invoker_management.models.operation import Operation from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.communication_type import CommunicationType # noqa: E501 from api_invoker_management.models.custom_operation import CustomOperation # noqa: E501 from api_invoker_management.models.operation import Operation # noqa: E501 + class Resource(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/security_method.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/security_method.py index 0a9e7394..a5937300 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/security_method.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/security_method.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py index 17106920..1b38bd50 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py @@ -1,20 +1,14 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.aef_profile import AefProfile -from api_invoker_management.models.api_status import ApiStatus -from api_invoker_management.models.published_api_path import PublishedApiPath -from api_invoker_management.models.shareable_information import ShareableInformation -import re from api_invoker_management import util - from api_invoker_management.models.aef_profile import AefProfile # noqa: E501 from api_invoker_management.models.api_status import ApiStatus # noqa: E501 +from api_invoker_management.models.base_model import Model from api_invoker_management.models.published_api_path import PublishedApiPath # noqa: E501 from api_invoker_management.models.shareable_information import ShareableInformation # noqa: E501 -import re # noqa: E501 + class ServiceAPIDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_kpis.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_kpis.py index e17f70fe..9314fcd6 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_kpis.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_kpis.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -import re from api_invoker_management import util +from api_invoker_management.models.base_model import Model -import re # noqa: E501 class ServiceKpis(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py index e4f8263e..7e73226d 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class ShareableInformation(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/supported_gad_shapes.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/supported_gad_shapes.py index 5a361e90..1242387f 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/supported_gad_shapes.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/supported_gad_shapes.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class SupportedGADShapes(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipse.py index 6db89075..b5a594eb 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipse.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class UncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipsoid.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipsoid.py index 613c6cc8..496846f8 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/uncertainty_ellipsoid.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class UncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py index 46329299..9570e89f 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model -from api_invoker_management.models.custom_operation import CustomOperation -from api_invoker_management.models.resource import Resource from api_invoker_management import util - +from api_invoker_management.models.base_model import Model from api_invoker_management.models.custom_operation import CustomOperation # noqa: E501 from api_invoker_management.models.resource import Resource # noqa: E501 + class Version(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/websock_notif_config.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/websock_notif_config.py index 4d3f5d7d..1a300a31 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/websock_notif_config.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/websock_notif_config.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invoker_management.models.base_model import Model from api_invoker_management import util +from api_invoker_management.models.base_model import Model class WebsockNotifConfig(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/__init__.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/__init__.py index 6f062ad6..df1dcccb 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/__init__.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/__init__.py @@ -1,9 +1,8 @@ import logging import connexion -from flask_testing import TestCase - from api_invoker_management.encoder import JSONEncoder +from flask_testing import TestCase class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py index a74ac675..0c5bab82 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py @@ -1,10 +1,9 @@ import unittest -from flask import json - from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # noqa: E501 from api_invoker_management.models.problem_details import ProblemDetails # noqa: E501 from api_invoker_management.test import BaseTestCase +from flask import json class TestDefaultController(BaseTestCase): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py index 598c8812..1506dfbb 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py @@ -1,11 +1,11 @@ import unittest -from flask import json - from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # noqa: E501 -from api_invoker_management.models.api_invoker_enrolment_details_patch import APIInvokerEnrolmentDetailsPatch # noqa: E501 +from api_invoker_management.models.api_invoker_enrolment_details_patch import \ + APIInvokerEnrolmentDetailsPatch # noqa: E501 from api_invoker_management.models.problem_details import ProblemDetails # noqa: E501 from api_invoker_management.test import BaseTestCase +from flask import json class TestIndividualAPIInvokerEnrolmentDetailsController(BaseTestCase): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/util.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/util.py index c54beede..cf911e58 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/util.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/util.py @@ -2,6 +2,7 @@ import datetime from api_invoker_management import typing_utils + def serialize_clean_camel_case(obj): res = obj.to_dict() res = clean_empty(res) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/setup.py b/services/TS29222_CAPIF_API_Invoker_Management_API/setup.py index 7187d5c1..c41926d4 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/setup.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup, find_packages +from setuptools import find_packages, setup NAME = "api_invoker_management" VERSION = "1.0.0" diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/app.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/app.py index 0838c6b7..c4b33c57 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/app.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/app.py @@ -32,7 +32,7 @@ def configure_monitoring(app, config): fluent_bit_host = config['monitoring']['fluent_bit_host'] fluent_bit_port = config['monitoring']['fluent_bit_port'] fluent_bit_sender = sender.FluentSender('Provider-Service', host=fluent_bit_host, port=fluent_bit_port) - propagator = TraceContextTextMapPropagator() + TraceContextTextMapPropagator() tracer_provider = TracerProvider(resource=resource) trace.set_tracer_provider(tracer_provider) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/default_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/default_controller.py index 6232ea29..0a67ace6 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/default_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/default_controller.py @@ -3,8 +3,8 @@ from functools import wraps from api_provider_management.models.api_provider_enrolment_details import APIProviderEnrolmentDetails # noqa: E501 from cryptography import x509 from cryptography.hazmat.backends import default_backend -from flask import request, current_app -from flask_jwt_extended import jwt_required, get_jwt_identity +from flask import current_app, request +from flask_jwt_extended import get_jwt_identity, jwt_required from ..core.provider_enrolment_details_api import ProviderManagementOperations from ..core.validate_user import ControlAccess diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/individual_api_provider_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/individual_api_provider_enrolment_details_controller.py index abc75937..cefef1ef 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/individual_api_provider_enrolment_details_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/individual_api_provider_enrolment_details_controller.py @@ -1,4 +1,4 @@ -from flask import request, current_app +from flask import current_app, request from ..core.provider_enrolment_details_api import ProviderManagementOperations from ..models.api_provider_enrolment_details_patch import APIProviderEnrolmentDetailsPatch # noqa: E501 diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py index a721a5aa..60b89b14 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py @@ -4,16 +4,15 @@ import secrets from datetime import datetime from api_provider_management.models.api_provider_enrolment_details import APIProviderEnrolmentDetails # noqa: E501 -from flask import current_app, Response +from flask import Response, current_app from pymongo import ReturnDocument +from ..core.sign_certificate import sign_certificate +from ..util import clean_empty, dict_to_camel_case, serialize_clean_camel_case from .auth_manager import AuthManager from .redis_internal_event import RedisInternalEvent from .resources import Resource -from .responses import internal_server_error, not_found_error, forbidden_error, make_response, bad_request_error -from ..core.sign_certificate import sign_certificate -from ..util import dict_to_camel_case, clean_empty, serialize_clean_camel_case - +from .responses import bad_request_error, forbidden_error, internal_server_error, make_response, not_found_error TOTAL_FEATURES = 2 SUPPORTED_FEATURES_HEX = "0" diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/publisher.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/publisher.py index acedb7e3..9f503516 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/publisher.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/publisher.py @@ -1,5 +1,6 @@ import redis + class Publisher(): def __init__(self): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/redis_internal_event.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/redis_internal_event.py index 50e34342..c1ad0973 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/redis_internal_event.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/redis_internal_event.py @@ -1,7 +1,7 @@ import json -from .publisher import Publisher from ..encoder import JSONEncoder +from .publisher import Publisher publisher_ops = Publisher() diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/validate_user.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/validate_user.py index 153a90c7..fea52c11 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/validate_user.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/validate_user.py @@ -1,12 +1,12 @@ import json -from flask import current_app, Response +from flask import Response, current_app -from .resources import Resource -from .responses import internal_server_error from ..encoder import CustomJSONEncoder from ..models.problem_details import ProblemDetails from ..util import serialize_clean_camel_case +from .resources import Resource +from .responses import internal_server_error class ControlAccess(Resource): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py index da7fb6da..18f2a1e6 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_provider_management.models.base_model import Model -from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails -import re from api_provider_management import util - from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails # noqa: E501 -import re # noqa: E501 +from api_provider_management.models.base_model import Model + class APIProviderEnrolmentDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py index e16230b9..5f4ab09b 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py @@ -1,12 +1,10 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_provider_management.models.base_model import Model -from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails from api_provider_management import util - from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails # noqa: E501 +from api_provider_management.models.base_model import Model + class APIProviderEnrolmentDetailsPatch(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_func_role.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_func_role.py index 7f3bb0f7..78d95461 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_func_role.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_func_role.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_provider_management.models.base_model import Model from api_provider_management import util +from api_provider_management.models.base_model import Model class ApiProviderFuncRole(Model): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py index d6989b1a..1c5655bb 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_provider_management.models.base_model import Model -from api_provider_management.models.api_provider_func_role import ApiProviderFuncRole -from api_provider_management.models.registration_information import RegistrationInformation from api_provider_management import util - from api_provider_management.models.api_provider_func_role import ApiProviderFuncRole # noqa: E501 +from api_provider_management.models.base_model import Model from api_provider_management.models.registration_information import RegistrationInformation # noqa: E501 + class APIProviderFunctionDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/base_model.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/base_model.py index 4fd1d5c7..621b8c7d 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/base_model.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/base_model.py @@ -1,5 +1,4 @@ import pprint - import typing from api_provider_management import util diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/invalid_param.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/invalid_param.py index 003aa181..cb682f81 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/invalid_param.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/invalid_param.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_provider_management.models.base_model import Model from api_provider_management import util +from api_provider_management.models.base_model import Model class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py index 7b4a267d..9d7f1232 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_provider_management.models.base_model import Model -from api_provider_management.models.invalid_param import InvalidParam -import re from api_provider_management import util - +from api_provider_management.models.base_model import Model from api_provider_management.models.invalid_param import InvalidParam # noqa: E501 -import re # noqa: E501 + class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/registration_information.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/registration_information.py index 3e4d440c..737b0994 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/registration_information.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/registration_information.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_provider_management.models.base_model import Model from api_provider_management import util +from api_provider_management.models.base_model import Model class RegistrationInformation(Model): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/__init__.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/__init__.py index 9853918d..7be5050e 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/__init__.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/__init__.py @@ -1,9 +1,8 @@ import logging import connexion -from flask_testing import TestCase - from api_provider_management.encoder import JSONEncoder +from flask_testing import TestCase class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py index 2b12ff85..120b96f8 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py @@ -1,10 +1,9 @@ import unittest -from flask import json - from api_provider_management.models.api_provider_enrolment_details import APIProviderEnrolmentDetails # noqa: E501 from api_provider_management.models.problem_details import ProblemDetails # noqa: E501 from api_provider_management.test import BaseTestCase +from flask import json class TestDefaultController(BaseTestCase): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py index 463aa435..9c1819ac 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py @@ -1,11 +1,11 @@ import unittest -from flask import json - from api_provider_management.models.api_provider_enrolment_details import APIProviderEnrolmentDetails # noqa: E501 -from api_provider_management.models.api_provider_enrolment_details_patch import APIProviderEnrolmentDetailsPatch # noqa: E501 +from api_provider_management.models.api_provider_enrolment_details_patch import \ + APIProviderEnrolmentDetailsPatch # noqa: E501 from api_provider_management.models.problem_details import ProblemDetails # noqa: E501 from api_provider_management.test import BaseTestCase +from flask import json class TestIndividualAPIProviderEnrolmentDetailsController(BaseTestCase): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/setup.py b/services/TS29222_CAPIF_API_Provider_Management_API/setup.py index 0f5d4a62..406d0dae 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/setup.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup, find_packages +from setuptools import find_packages, setup NAME = "api_provider_management" VERSION = "1.0.0" diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/app.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/app.py index 0b39d964..0841c2d2 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/app.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/app.py @@ -6,6 +6,9 @@ from datetime import datetime from logging.handlers import RotatingFileHandler import connexion +import encoder +from config import Config +from core.consumer_messager import Subscriber from flask_apscheduler import APScheduler from flask_executor import Executor from flask_jwt_extended import JWTManager @@ -19,10 +22,6 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator -import encoder -from config import Config -from core.consumer_messager import Subscriber - NAME = "Acl-Service" # Setting log level @@ -36,7 +35,7 @@ def configure_monitoring(app, config): fluent_bit_host = config['monitoring']['fluent_bit_host'] fluent_bit_port = config['monitoring']['fluent_bit_port'] fluent_bit_sender = sender.FluentSender('Acl-Service', host=fluent_bit_host, port=fluent_bit_port) - propagator = TraceContextTextMapPropagator() + TraceContextTextMapPropagator() tracer_provider = TracerProvider(resource=resource) trace.set_tracer_provider(tracer_provider) diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py index 4cd2db2d..b24e6f00 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py @@ -2,20 +2,21 @@ from functools import wraps from cryptography import x509 from cryptography.hazmat.backends import default_backend -from flask import request, current_app +from flask import current_app, request from ..core.accesscontrolpolicyapi import accessControlPolicyApi + def cert_validation(): def _cert_validation(f): @wraps(f) def __cert_validation(*args, **kwargs): - args = request.view_args + request.view_args cert_tmp = request.headers['X-Ssl-Client-Cert'] cert_raw = cert_tmp.replace('\t', '') - cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) + x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) result = f(**kwargs) diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller.py index 6d294ffd..8b137891 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller.py @@ -1,2 +1 @@ -from typing import List diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/accesscontrolpolicyapi.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/accesscontrolpolicyapi.py index 27e7f248..5c00ac43 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/accesscontrolpolicyapi.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/accesscontrolpolicyapi.py @@ -1,9 +1,9 @@ from flask import current_app -from .responses import make_response, not_found_error, internal_server_error from ..core.resources import Resource from ..models.access_control_policy_list import AccessControlPolicyList from ..util import serialize_clean_camel_case +from .responses import internal_server_error, make_response, not_found_error class accessControlPolicyApi(Resource): diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py index 43aa0151..d036df69 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py @@ -1,7 +1,2 @@ # flake8: noqa # import models into model package -from capif_acl.models.access_control_policy_list import AccessControlPolicyList -from capif_acl.models.api_invoker_policy import ApiInvokerPolicy -from capif_acl.models.invalid_param import InvalidParam -from capif_acl.models.problem_details import ProblemDetails -from capif_acl.models.time_range_list import TimeRangeList diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py index a851ac32..19dea5dc 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py @@ -1,12 +1,10 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_acl.models.base_model import Model -from capif_acl.models.api_invoker_policy import ApiInvokerPolicy from capif_acl import util - from capif_acl.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 +from capif_acl.models.base_model import Model + class AccessControlPolicyList(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py index a22e84c5..cdd35e29 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_acl.models.base_model import Model -from capif_acl.models.time_range_list import TimeRangeList from capif_acl import util - +from capif_acl.models.base_model import Model from capif_acl.models.time_range_list import TimeRangeList # noqa: E501 + class ApiInvokerPolicy(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py index fed13c90..2e2e14aa 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py @@ -1,5 +1,4 @@ import pprint - import typing from capif_acl import util diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py index a6789dc2..b94db8da 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_acl.models.base_model import Model from capif_acl import util +from capif_acl.models.base_model import Model class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py index 8473fc2b..bf02e50e 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_acl.models.base_model import Model -from capif_acl.models.invalid_param import InvalidParam -import re from capif_acl import util - +from capif_acl.models.base_model import Model from capif_acl.models.invalid_param import InvalidParam # noqa: E501 -import re # noqa: E501 + class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py index b9c47240..71f38cfc 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_acl.models.base_model import Model from capif_acl import util +from capif_acl.models.base_model import Model class TimeRangeList(Model): diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/__init__.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/__init__.py index 5d664f82..f70a615e 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/__init__.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/__init__.py @@ -1,9 +1,8 @@ import logging import connexion -from flask_testing import TestCase - from capif_acl.encoder import JSONEncoder +from flask_testing import TestCase class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py b/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py index 043381ad..276b24f9 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup, find_packages +from setuptools import find_packages, setup NAME = "capif_acl" VERSION = "1.0.0" diff --git a/services/TS29222_CAPIF_Auditing_API/logs/app.py b/services/TS29222_CAPIF_Auditing_API/logs/app.py index 4e8068e7..83fd706e 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/app.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/app.py @@ -5,6 +5,8 @@ import os from logging.handlers import RotatingFileHandler import connexion +import encoder +from config import Config from fluent import sender from opentelemetry import trace from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter @@ -14,9 +16,6 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator -import encoder -from config import Config - NAME = "Logs-Service" # Setting log level @@ -30,7 +29,7 @@ def configure_monitoring(app, config): fluent_bit_host = config['monitoring']['fluent_bit_host'] fluent_bit_port = config['monitoring']['fluent_bit_port'] fluent_bit_sender = sender.FluentSender('Logs-Service', host=fluent_bit_host, port=fluent_bit_port) - propagator = TraceContextTextMapPropagator() + TraceContextTextMapPropagator() tracer_provider = TracerProvider(resource=resource) trace.set_tracer_provider(tracer_provider) diff --git a/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py b/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py index 469bff22..0ff05f0d 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py @@ -1,4 +1,4 @@ -from flask import request, current_app +from flask import current_app, request from logs import util from logs.models.interface_description import InterfaceDescription # noqa: E501 from logs.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py b/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py index 86586ed2..b4681ac0 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py @@ -3,10 +3,10 @@ import json from flask import current_app -from .resources import Resource -from .responses import bad_request_error, not_found_error, internal_server_error, make_response from ..models.invocation_log import InvocationLog from ..util import serialize_clean_camel_case +from .resources import Resource +from .responses import bad_request_error, internal_server_error, make_response, not_found_error class AuditOperations (Resource): diff --git a/services/TS29222_CAPIF_Auditing_API/logs/encoder.py b/services/TS29222_CAPIF_Auditing_API/logs/encoder.py index 3c674456..f9d89aae 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/encoder.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/encoder.py @@ -1,5 +1,4 @@ from connexion.jsonifier import JSONEncoder - from logs.models.base_model import Model diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/__init__.py b/services/TS29222_CAPIF_Auditing_API/logs/models/__init__.py index 316dfd92..d036df69 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/__init__.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/__init__.py @@ -1,13 +1,2 @@ # flake8: noqa # import models into model package -from logs.models.interface_description import InterfaceDescription -from logs.models.invalid_param import InvalidParam -from logs.models.invocation_log import InvocationLog -from logs.models.invocation_logs import InvocationLogs -from logs.models.invocation_logs_retrieve_res import InvocationLogsRetrieveRes -from logs.models.log import Log -from logs.models.o_auth_grant_type import OAuthGrantType -from logs.models.operation import Operation -from logs.models.problem_details import ProblemDetails -from logs.models.protocol import Protocol -from logs.models.security_method import SecurityMethod diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/base_model.py b/services/TS29222_CAPIF_Auditing_API/logs/models/base_model.py index 56493bbf..16381a1d 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/base_model.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/base_model.py @@ -1,5 +1,4 @@ import pprint - import typing from logs import util diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/interface_description.py b/services/TS29222_CAPIF_Auditing_API/logs/models/interface_description.py index b2302306..2a92e75c 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/interface_description.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/interface_description.py @@ -1,16 +1,12 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model -from logs.models.o_auth_grant_type import OAuthGrantType -from logs.models.security_method import SecurityMethod -import re from logs import util - +from logs.models.base_model import Model from logs.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from logs.models.security_method import SecurityMethod # noqa: E501 -import re # noqa: E501 + class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/invalid_param.py b/services/TS29222_CAPIF_Auditing_API/logs/models/invalid_param.py index 7da75a55..bafe0905 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/invalid_param.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/invalid_param.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model from logs import util +from logs.models.base_model import Model class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_log.py b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_log.py index 26d42ad5..bf5c2ee2 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_log.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_log.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model -from logs.models.log import Log -import re from logs import util - +from logs.models.base_model import Model from logs.models.log import Log # noqa: E501 -import re # noqa: E501 + class InvocationLog(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs.py b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs.py index f1ed39c0..55c37648 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model -from logs.models.invocation_log import InvocationLog -import re from logs import util - +from logs.models.base_model import Model from logs.models.invocation_log import InvocationLog # noqa: E501 -import re # noqa: E501 + class InvocationLogs(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs_retrieve_res.py b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs_retrieve_res.py index 4ebdec7c..07455f47 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs_retrieve_res.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/invocation_logs_retrieve_res.py @@ -1,18 +1,13 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model -from logs.models.invocation_log import InvocationLog -from logs.models.invocation_logs import InvocationLogs -from logs.models.log import Log -import re from logs import util - +from logs.models.base_model import Model from logs.models.invocation_log import InvocationLog # noqa: E501 from logs.models.invocation_logs import InvocationLogs # noqa: E501 from logs.models.log import Log # noqa: E501 -import re # noqa: E501 + class InvocationLogsRetrieveRes(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/log.py b/services/TS29222_CAPIF_Auditing_API/logs/models/log.py index ef5604a6..a3c965ee 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/log.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/log.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model -from logs.models.interface_description import InterfaceDescription -from logs.models.operation import Operation -from logs.models.protocol import Protocol from logs import util - +from logs.models.base_model import Model from logs.models.interface_description import InterfaceDescription # noqa: E501 from logs.models.operation import Operation # noqa: E501 from logs.models.protocol import Protocol # noqa: E501 + class Log(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Auditing_API/logs/models/o_auth_grant_type.py index 280b8ef7..57b4bf4e 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/o_auth_grant_type.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/o_auth_grant_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model from logs import util +from logs.models.base_model import Model class OAuthGrantType(Model): diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/operation.py b/services/TS29222_CAPIF_Auditing_API/logs/models/operation.py index a8efafdc..cf35e30e 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/operation.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/operation.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model from logs import util +from logs.models.base_model import Model class Operation(Model): diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/problem_details.py b/services/TS29222_CAPIF_Auditing_API/logs/models/problem_details.py index 2a77eb97..c074f0e5 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/problem_details.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/problem_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model -from logs.models.invalid_param import InvalidParam -import re from logs import util - +from logs.models.base_model import Model from logs.models.invalid_param import InvalidParam # noqa: E501 -import re # noqa: E501 + class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/protocol.py b/services/TS29222_CAPIF_Auditing_API/logs/models/protocol.py index 989d9e4c..e2b23e6b 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/protocol.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/protocol.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model from logs import util +from logs.models.base_model import Model class Protocol(Model): diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/security_method.py b/services/TS29222_CAPIF_Auditing_API/logs/models/security_method.py index b32bbf5b..9091c514 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/security_method.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/security_method.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from logs.models.base_model import Model from logs import util +from logs.models.base_model import Model class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Auditing_API/logs/test/__init__.py b/services/TS29222_CAPIF_Auditing_API/logs/test/__init__.py index a3e8ced6..9209767d 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/test/__init__.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/test/__init__.py @@ -2,7 +2,6 @@ import logging import connexion from flask_testing import TestCase - from logs.encoder import JSONEncoder diff --git a/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py b/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py index edeb6213..3e2153c6 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py @@ -1,7 +1,5 @@ import unittest -from flask import json - from logs.models.interface_description import InterfaceDescription # noqa: E501 from logs.models.invocation_logs_retrieve_res import InvocationLogsRetrieveRes # noqa: E501 from logs.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_Auditing_API/setup.py b/services/TS29222_CAPIF_Auditing_API/setup.py index 9e2a513e..cbd1ece8 100644 --- a/services/TS29222_CAPIF_Auditing_API/setup.py +++ b/services/TS29222_CAPIF_Auditing_API/setup.py @@ -1,5 +1,5 @@ -import sys -from setuptools import setup, find_packages + +from setuptools import find_packages, setup NAME = "logs" VERSION = "1.0.0" diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/app.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/app.py index 4084bfdb..f84d1844 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/app.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/app.py @@ -5,6 +5,8 @@ import os from logging.handlers import RotatingFileHandler import connexion +import encoder +from config import Config from flask_jwt_extended import JWTManager from fluent import sender from opentelemetry import trace @@ -16,9 +18,6 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator -import encoder -from config import Config - NAME = "Discover-Service" # Setting log level @@ -32,7 +31,7 @@ def configure_monitoring(app, config): fluent_bit_host = config['monitoring']['fluent_bit_host'] fluent_bit_port = config['monitoring']['fluent_bit_port'] fluent_bit_sender = sender.FluentSender('Discover-Service', host=fluent_bit_host, port=fluent_bit_port) - propagator = TraceContextTextMapPropagator() + TraceContextTextMapPropagator() tracer_provider = TracerProvider(resource=resource) trace.set_tracer_provider(tracer_provider) diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py index 694d6f4a..d1922947 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py @@ -1,6 +1,6 @@ import json -from flask import request, current_app +from flask import current_app, request from service_apis.models.discovered_apis import DiscoveredAPIs # noqa: E501 from ..core.discoveredapis import DiscoverApisOperations, return_negotiated_supp_feat_dict diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py index bdcd3004..394bad68 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py @@ -7,8 +7,11 @@ from ..core.resources import Resource from ..core.responses import internal_server_error, make_response, not_found_error from ..models.discovered_apis import DiscoveredAPIs from ..util import serialize_clean_camel_case -from ..vendor_specific import find_attribute_in_body, filter_apis_with_vendor_specific_params, \ +from ..vendor_specific import ( + filter_apis_with_vendor_specific_params, + find_attribute_in_body, remove_vendor_specific_fields +) TOTAL_FEATURES = 4 SUPPORTED_FEATURES_HEX = "2" diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/encoder.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/encoder.py index c741e68b..26d33408 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/encoder.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/encoder.py @@ -1,5 +1,4 @@ from connexion.jsonifier import JSONEncoder - from service_apis.models.base_model import Model diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/__init__.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/__init__.py index 8451433a..d036df69 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/__init__.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/__init__.py @@ -1,45 +1,2 @@ # flake8: noqa # import models into model package -from service_apis.models.aef_location import AefLocation -from service_apis.models.aef_profile import AefProfile -from service_apis.models.api_status import ApiStatus -from service_apis.models.civic_address import CivicAddress -from service_apis.models.communication_type import CommunicationType -from service_apis.models.custom_operation import CustomOperation -from service_apis.models.data_format import DataFormat -from service_apis.models.discovered_apis import DiscoveredAPIs -from service_apis.models.ellipsoid_arc import EllipsoidArc -from service_apis.models.gad_shape import GADShape -from service_apis.models.geographic_area import GeographicArea -from service_apis.models.geographical_coordinates import GeographicalCoordinates -from service_apis.models.interface_description import InterfaceDescription -from service_apis.models.invalid_param import InvalidParam -from service_apis.models.ip_addr_info import IpAddrInfo -from service_apis.models.ip_addr_range import IpAddrRange -from service_apis.models.ipv4_address_range import Ipv4AddressRange -from service_apis.models.ipv6_addr1 import Ipv6Addr1 -from service_apis.models.ipv6_address_range import Ipv6AddressRange -from service_apis.models.local2d_point_uncertainty_ellipse import Local2dPointUncertaintyEllipse -from service_apis.models.local3d_point_uncertainty_ellipsoid import Local3dPointUncertaintyEllipsoid -from service_apis.models.local_origin import LocalOrigin -from service_apis.models.o_auth_grant_type import OAuthGrantType -from service_apis.models.operation import Operation -from service_apis.models.point import Point -from service_apis.models.point_altitude import PointAltitude -from service_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty -from service_apis.models.point_uncertainty_circle import PointUncertaintyCircle -from service_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse -from service_apis.models.polygon import Polygon -from service_apis.models.problem_details import ProblemDetails -from service_apis.models.protocol import Protocol -from service_apis.models.published_api_path import PublishedApiPath -from service_apis.models.relative_cartesian_location import RelativeCartesianLocation -from service_apis.models.resource import Resource -from service_apis.models.security_method import SecurityMethod -from service_apis.models.service_api_description import ServiceAPIDescription -from service_apis.models.service_kpis import ServiceKpis -from service_apis.models.shareable_information import ShareableInformation -from service_apis.models.supported_gad_shapes import SupportedGADShapes -from service_apis.models.uncertainty_ellipse import UncertaintyEllipse -from service_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid -from service_apis.models.version import Version diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_location.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_location.py index 25fe56a3..bbceaa45 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_location.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_location.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.civic_address import CivicAddress -from service_apis.models.geographic_area import GeographicArea from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.civic_address import CivicAddress # noqa: E501 from service_apis.models.geographic_area import GeographicArea # noqa: E501 + class AefLocation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py index 78ff868a..11969441 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py @@ -1,20 +1,9 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.aef_location import AefLocation -from service_apis.models.data_format import DataFormat -from service_apis.models.interface_description import InterfaceDescription -from service_apis.models.ip_addr_range import IpAddrRange -from service_apis.models.o_auth_grant_type import OAuthGrantType -from service_apis.models.protocol import Protocol -from service_apis.models.security_method import SecurityMethod -from service_apis.models.service_kpis import ServiceKpis -from service_apis.models.version import Version from service_apis import util - from service_apis.models.aef_location import AefLocation # noqa: E501 +from service_apis.models.base_model import Model from service_apis.models.data_format import DataFormat # noqa: E501 from service_apis.models.interface_description import InterfaceDescription # noqa: E501 from service_apis.models.ip_addr_range import IpAddrRange # noqa: E501 @@ -24,6 +13,7 @@ from service_apis.models.security_method import SecurityMethod # noqa: E501 from service_apis.models.service_kpis import ServiceKpis # noqa: E501 from service_apis.models.version import Version # noqa: E501 + class AefProfile(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py index 81815062..eef94f95 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class ApiStatus(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/base_model.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/base_model.py index 7951efc4..a083ea94 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/base_model.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/base_model.py @@ -1,5 +1,4 @@ import pprint - import typing from service_apis import util diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/civic_address.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/civic_address.py index 67c1a70f..7314bca7 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/civic_address.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/civic_address.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class CivicAddress(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/communication_type.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/communication_type.py index 04b99a70..ea17cb87 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/communication_type.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/communication_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class CommunicationType(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py index b98c3dc9..fed2a347 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.communication_type import CommunicationType -from service_apis.models.operation import Operation from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.communication_type import CommunicationType # noqa: E501 from service_apis.models.operation import Operation # noqa: E501 + class CustomOperation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/data_format.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/data_format.py index 875a9539..7575f306 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/data_format.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/data_format.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class DataFormat(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py index 36a7889a..a2377563 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.service_api_description import ServiceAPIDescription -import re from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.service_api_description import ServiceAPIDescription # noqa: E501 -import re # noqa: E501 + class DiscoveredAPIs(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py index 9f6206bc..a5747b5e 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.gad_shape import GADShape -from service_apis.models.geographical_coordinates import GeographicalCoordinates -from service_apis.models.supported_gad_shapes import SupportedGADShapes from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class EllipsoidArc(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py index 21e0ee19..dfc5dedb 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.supported_gad_shapes import SupportedGADShapes from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class GADShape(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py index dafc9960..3c2d44c2 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py @@ -1,20 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.ellipsoid_arc import EllipsoidArc -from service_apis.models.geographical_coordinates import GeographicalCoordinates -from service_apis.models.point import Point -from service_apis.models.point_altitude import PointAltitude -from service_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty -from service_apis.models.point_uncertainty_circle import PointUncertaintyCircle -from service_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse -from service_apis.models.polygon import Polygon -from service_apis.models.supported_gad_shapes import SupportedGADShapes -from service_apis.models.uncertainty_ellipse import UncertaintyEllipse from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.ellipsoid_arc import EllipsoidArc # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.point import Point # noqa: E501 @@ -26,6 +14,7 @@ from service_apis.models.polygon import Polygon # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class GeographicArea(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographical_coordinates.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographical_coordinates.py index 4eae80d3..755e077a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographical_coordinates.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographical_coordinates.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class GeographicalCoordinates(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/interface_description.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/interface_description.py index da6cd574..7c44ba11 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/interface_description.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/interface_description.py @@ -1,16 +1,12 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.o_auth_grant_type import OAuthGrantType -from service_apis.models.security_method import SecurityMethod -import re from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from service_apis.models.security_method import SecurityMethod # noqa: E501 -import re # noqa: E501 + class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/invalid_param.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/invalid_param.py index 67c79e30..74464bd1 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/invalid_param.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/invalid_param.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_info.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_info.py index 3cb739c6..1791b5a3 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_info.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_info.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class IpAddrInfo(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py index 4b86f968..b95a30bd 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.ipv4_address_range import Ipv4AddressRange -from service_apis.models.ipv6_address_range import Ipv6AddressRange from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 from service_apis.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 + class IpAddrRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv4_address_range.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv4_address_range.py index 9d500949..e2e91ad7 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv4_address_range.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv4_address_range.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -import re from service_apis import util +from service_apis.models.base_model import Model -import re # noqa: E501 class Ipv4AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_addr1.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_addr1.py index d8164b5f..7c01304e 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_addr1.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_addr1.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class Ipv6Addr1(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_address_range.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_address_range.py index e9fc81ec..b8e1c5e0 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_address_range.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ipv6_address_range.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.ipv6_addr1 import Ipv6Addr1 from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 + class Ipv6AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py index 23464399..105c1408 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.gad_shape import GADShape -from service_apis.models.local_origin import LocalOrigin -from service_apis.models.relative_cartesian_location import RelativeCartesianLocation -from service_apis.models.supported_gad_shapes import SupportedGADShapes -from service_apis.models.uncertainty_ellipse import UncertaintyEllipse from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.local_origin import LocalOrigin # noqa: E501 from service_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class Local2dPointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py index 4d9cb7bb..68e56109 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.gad_shape import GADShape -from service_apis.models.local_origin import LocalOrigin -from service_apis.models.relative_cartesian_location import RelativeCartesianLocation -from service_apis.models.supported_gad_shapes import SupportedGADShapes -from service_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.local_origin import LocalOrigin # noqa: E501 from service_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from service_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 + class Local3dPointUncertaintyEllipsoid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py index bf20a6d3..880120dc 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.geographic_area import GeographicArea -from service_apis.models.geographical_coordinates import GeographicalCoordinates from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.geographic_area import GeographicArea # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 + class LocalOrigin(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/o_auth_grant_type.py index fc93ba2e..b5020552 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/o_auth_grant_type.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/o_auth_grant_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class OAuthGrantType(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/operation.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/operation.py index 6e0b387e..a43fd60d 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/operation.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/operation.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class Operation(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py index a258d339..802b8a3d 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.gad_shape import GADShape -from service_apis.models.geographical_coordinates import GeographicalCoordinates -from service_apis.models.supported_gad_shapes import SupportedGADShapes from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class Point(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py index 3245960e..32b8233f 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.gad_shape import GADShape -from service_apis.models.geographical_coordinates import GeographicalCoordinates -from service_apis.models.supported_gad_shapes import SupportedGADShapes from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class PointAltitude(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py index aadbd510..9a70de0b 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.gad_shape import GADShape -from service_apis.models.geographical_coordinates import GeographicalCoordinates -from service_apis.models.supported_gad_shapes import SupportedGADShapes -from service_apis.models.uncertainty_ellipse import UncertaintyEllipse from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class PointAltitudeUncertainty(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py index 271b19bf..2870ddf9 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.gad_shape import GADShape -from service_apis.models.geographical_coordinates import GeographicalCoordinates -from service_apis.models.supported_gad_shapes import SupportedGADShapes from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class PointUncertaintyCircle(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py index 7e7499cf..32f2ab66 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.gad_shape import GADShape -from service_apis.models.geographical_coordinates import GeographicalCoordinates -from service_apis.models.supported_gad_shapes import SupportedGADShapes -from service_apis.models.uncertainty_ellipse import UncertaintyEllipse from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class PointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py index 421b7c36..b3374e3f 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.gad_shape import GADShape -from service_apis.models.geographical_coordinates import GeographicalCoordinates -from service_apis.models.supported_gad_shapes import SupportedGADShapes from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class Polygon(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/problem_details.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/problem_details.py index f1e1241d..ac177318 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/problem_details.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/problem_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.invalid_param import InvalidParam -import re from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.invalid_param import InvalidParam # noqa: E501 -import re # noqa: E501 + class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/protocol.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/protocol.py index 6cc058a0..d88a4100 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/protocol.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/protocol.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class Protocol(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/published_api_path.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/published_api_path.py index a8210648..5736c473 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/published_api_path.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/published_api_path.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class PublishedApiPath(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/relative_cartesian_location.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/relative_cartesian_location.py index ee5b860a..f2f1a689 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/relative_cartesian_location.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/relative_cartesian_location.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class RelativeCartesianLocation(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py index f530875d..0f340dfe 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.communication_type import CommunicationType -from service_apis.models.custom_operation import CustomOperation -from service_apis.models.operation import Operation from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.communication_type import CommunicationType # noqa: E501 from service_apis.models.custom_operation import CustomOperation # noqa: E501 from service_apis.models.operation import Operation # noqa: E501 + class Resource(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/security_method.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/security_method.py index 3215ddaa..23372e62 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/security_method.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/security_method.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py index 743c1081..b81515a9 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py @@ -1,20 +1,14 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.aef_profile import AefProfile -from service_apis.models.api_status import ApiStatus -from service_apis.models.published_api_path import PublishedApiPath -from service_apis.models.shareable_information import ShareableInformation -import re from service_apis import util - from service_apis.models.aef_profile import AefProfile # noqa: E501 from service_apis.models.api_status import ApiStatus # noqa: E501 +from service_apis.models.base_model import Model from service_apis.models.published_api_path import PublishedApiPath # noqa: E501 from service_apis.models.shareable_information import ShareableInformation # noqa: E501 -import re # noqa: E501 + class ServiceAPIDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_kpis.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_kpis.py index de72ad5b..66dd9e35 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_kpis.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_kpis.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -import re from service_apis import util +from service_apis.models.base_model import Model -import re # noqa: E501 class ServiceKpis(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py index 8d21330b..0f0c7b02 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class ShareableInformation(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/supported_gad_shapes.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/supported_gad_shapes.py index 0f035470..d5e17a12 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/supported_gad_shapes.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/supported_gad_shapes.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class SupportedGADShapes(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipse.py index 03672693..53e6a3ad 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipse.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class UncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipsoid.py index 6e598a1a..bac421f2 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/uncertainty_ellipsoid.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model from service_apis import util +from service_apis.models.base_model import Model class UncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/version.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/version.py index e0a21cc0..7efbc3f7 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/version.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/version.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from service_apis.models.base_model import Model -from service_apis.models.custom_operation import CustomOperation -from service_apis.models.resource import Resource from service_apis import util - +from service_apis.models.base_model import Model from service_apis.models.custom_operation import CustomOperation # noqa: E501 from service_apis.models.resource import Resource # noqa: E501 + class Version(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/__init__.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/__init__.py index b0510f7c..8b9b70a8 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/__init__.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/__init__.py @@ -2,7 +2,6 @@ import logging import connexion from flask_testing import TestCase - from service_apis.encoder import JSONEncoder diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py index 39959238..6e626023 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py @@ -1,7 +1,5 @@ import unittest -from flask import json - from service_apis.models.aef_location import AefLocation # noqa: E501 from service_apis.models.communication_type import CommunicationType # noqa: E501 from service_apis.models.data_format import DataFormat # noqa: E501 diff --git a/services/TS29222_CAPIF_Discover_Service_API/setup.py b/services/TS29222_CAPIF_Discover_Service_API/setup.py index 824ebbaa..da11c500 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/setup.py +++ b/services/TS29222_CAPIF_Discover_Service_API/setup.py @@ -1,5 +1,5 @@ -import sys -from setuptools import setup, find_packages + +from setuptools import find_packages, setup NAME = "service_apis" VERSION = "1.0.0" diff --git a/services/TS29222_CAPIF_Events_API/capif_events/app.py b/services/TS29222_CAPIF_Events_API/capif_events/app.py index ef1d8c3a..b9f0bd9b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/app.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/app.py @@ -6,6 +6,10 @@ from datetime import datetime from logging.handlers import RotatingFileHandler import connexion +import encoder +from config import Config +from core.consumer_messager import Subscriber +from core.notifications import Notifications from flask_apscheduler import APScheduler from flask_executor import Executor from flask_jwt_extended import JWTManager @@ -19,11 +23,6 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator -import encoder -from config import Config -from core.consumer_messager import Subscriber -from core.notifications import Notifications - NAME = "Events-Service" # Setting log level @@ -37,7 +36,7 @@ def configure_monitoring(app, config): fluent_bit_host = config['monitoring']['fluent_bit_host'] fluent_bit_port = config['monitoring']['fluent_bit_port'] fluent_bit_sender = sender.FluentSender('Events-Service', host=fluent_bit_host, port=fluent_bit_port) - propagator = TraceContextTextMapPropagator() + TraceContextTextMapPropagator() tracer_provider = TracerProvider(resource=resource) trace.set_tracer_provider(tracer_provider) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py b/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py index 2e071c8b..f55aeb40 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py @@ -4,7 +4,7 @@ from capif_events.models.event_subscription import EventSubscription # noqa: E5 from capif_events.models.event_subscription_patch import EventSubscriptionPatch # noqa: E501 from cryptography import x509 from cryptography.hazmat.backends import default_backend -from flask import request, current_app +from flask import current_app, request from ..core.events_apis import EventSubscriptionsOperations from ..core.validate_user import ControlAccess diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index 7f60bc24..440925c3 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -3,13 +3,12 @@ import secrets import rfc3987 from capif_events.models.event_subscription import EventSubscription # noqa: E501 -from flask import current_app, Response +from flask import Response, current_app +from ..util import clean_empty, dict_to_camel_case, serialize_clean_camel_case from .auth_manager import AuthManager from .resources import Resource -from .responses import internal_server_error, not_found_error, make_response, bad_request_error -from ..util import serialize_clean_camel_case, clean_empty, dict_to_camel_case - +from .responses import bad_request_error, internal_server_error, make_response, not_found_error TOTAL_FEATURES = 4 SUPPORTED_FEATURES_HEX = "c" diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index 451054b3..9c8e07ff 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -8,7 +8,6 @@ import requests from encoder import CustomJSONEncoder from flask import current_app from models.event_notification import EventNotification -from models.event_subscription import EventSubscription from util import serialize_clean_camel_case from .internal_event_ops import InternalEventOperations diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py b/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py index 168e903f..2357408a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py @@ -1,12 +1,12 @@ import json -from flask import current_app, Response +from flask import Response, current_app -from .resources import Resource -from .responses import internal_server_error from ..encoder import CustomJSONEncoder from ..models.problem_details import ProblemDetails from ..util import serialize_clean_camel_case +from .resources import Resource +from .responses import internal_server_error class ControlAccess(Resource): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/__init__.py b/services/TS29222_CAPIF_Events_API/capif_events/models/__init__.py index 537f7993..d036df69 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/__init__.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/__init__.py @@ -1,68 +1,2 @@ # flake8: noqa # import models into model package -from capif_events.models.access_control_policy_list import AccessControlPolicyList -from capif_events.models.access_control_policy_list_ext import AccessControlPolicyListExt -from capif_events.models.aef_location import AefLocation -from capif_events.models.aef_profile import AefProfile -from capif_events.models.api_invoker_policy import ApiInvokerPolicy -from capif_events.models.api_status import ApiStatus -from capif_events.models.buffered_notifications_action import BufferedNotificationsAction -from capif_events.models.capif_event import CAPIFEvent -from capif_events.models.capif_event_detail import CAPIFEventDetail -from capif_events.models.capif_event_filter import CAPIFEventFilter -from capif_events.models.civic_address import CivicAddress -from capif_events.models.communication_type import CommunicationType -from capif_events.models.custom_operation import CustomOperation -from capif_events.models.data_format import DataFormat -from capif_events.models.ellipsoid_arc import EllipsoidArc -from capif_events.models.event_notification import EventNotification -from capif_events.models.event_subscription import EventSubscription -from capif_events.models.event_subscription_patch import EventSubscriptionPatch -from capif_events.models.gad_shape import GADShape -from capif_events.models.geographic_area import GeographicArea -from capif_events.models.geographical_coordinates import GeographicalCoordinates -from capif_events.models.interface_description import InterfaceDescription -from capif_events.models.invalid_param import InvalidParam -from capif_events.models.invocation_log import InvocationLog -from capif_events.models.ip_addr_range import IpAddrRange -from capif_events.models.ipv4_address_range import Ipv4AddressRange -from capif_events.models.ipv4_address_range1 import Ipv4AddressRange1 -from capif_events.models.ipv6_addr1 import Ipv6Addr1 -from capif_events.models.ipv6_address_range import Ipv6AddressRange -from capif_events.models.ipv6_address_range1 import Ipv6AddressRange1 -from capif_events.models.local2d_point_uncertainty_ellipse import Local2dPointUncertaintyEllipse -from capif_events.models.local3d_point_uncertainty_ellipsoid import Local3dPointUncertaintyEllipsoid -from capif_events.models.local_origin import LocalOrigin -from capif_events.models.log import Log -from capif_events.models.muting_exception_instructions import MutingExceptionInstructions -from capif_events.models.muting_notifications_settings import MutingNotificationsSettings -from capif_events.models.notification_flag import NotificationFlag -from capif_events.models.notification_method import NotificationMethod -from capif_events.models.o_auth_grant_type import OAuthGrantType -from capif_events.models.operation import Operation -from capif_events.models.partitioning_criteria import PartitioningCriteria -from capif_events.models.point import Point -from capif_events.models.point_altitude import PointAltitude -from capif_events.models.point_altitude_uncertainty import PointAltitudeUncertainty -from capif_events.models.point_uncertainty_circle import PointUncertaintyCircle -from capif_events.models.point_uncertainty_ellipse import PointUncertaintyEllipse -from capif_events.models.polygon import Polygon -from capif_events.models.problem_details import ProblemDetails -from capif_events.models.protocol import Protocol -from capif_events.models.published_api_path import PublishedApiPath -from capif_events.models.relative_cartesian_location import RelativeCartesianLocation -from capif_events.models.reporting_information import ReportingInformation -from capif_events.models.resource import Resource -from capif_events.models.routing_rule import RoutingRule -from capif_events.models.security_method import SecurityMethod -from capif_events.models.service_api_description import ServiceAPIDescription -from capif_events.models.service_kpis import ServiceKpis -from capif_events.models.shareable_information import ShareableInformation -from capif_events.models.subscription_action import SubscriptionAction -from capif_events.models.supported_gad_shapes import SupportedGADShapes -from capif_events.models.time_range_list import TimeRangeList -from capif_events.models.topology_hiding import TopologyHiding -from capif_events.models.uncertainty_ellipse import UncertaintyEllipse -from capif_events.models.uncertainty_ellipsoid import UncertaintyEllipsoid -from capif_events.models.version import Version -from capif_events.models.websock_notif_config import WebsockNotifConfig diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py index a64c3841..42b98fed 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py @@ -1,12 +1,10 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.api_invoker_policy import ApiInvokerPolicy from capif_events import util - from capif_events.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 +from capif_events.models.base_model import Model + class AccessControlPolicyList(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py index e99c495c..5cdc5543 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py @@ -1,12 +1,10 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.api_invoker_policy import ApiInvokerPolicy from capif_events import util - from capif_events.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 +from capif_events.models.base_model import Model + class AccessControlPolicyListExt(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/aef_location.py b/services/TS29222_CAPIF_Events_API/capif_events/models/aef_location.py index 1f85dba5..5c51a242 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/aef_location.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/aef_location.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.civic_address import CivicAddress -from capif_events.models.geographic_area import GeographicArea from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.civic_address import CivicAddress # noqa: E501 from capif_events.models.geographic_area import GeographicArea # noqa: E501 + class AefLocation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py b/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py index 02ae4b48..c29502c6 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py @@ -1,20 +1,9 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.aef_location import AefLocation -from capif_events.models.data_format import DataFormat -from capif_events.models.interface_description import InterfaceDescription -from capif_events.models.ip_addr_range import IpAddrRange -from capif_events.models.o_auth_grant_type import OAuthGrantType -from capif_events.models.protocol import Protocol -from capif_events.models.security_method import SecurityMethod -from capif_events.models.service_kpis import ServiceKpis -from capif_events.models.version import Version from capif_events import util - from capif_events.models.aef_location import AefLocation # noqa: E501 +from capif_events.models.base_model import Model from capif_events.models.data_format import DataFormat # noqa: E501 from capif_events.models.interface_description import InterfaceDescription # noqa: E501 from capif_events.models.ip_addr_range import IpAddrRange # noqa: E501 @@ -24,6 +13,7 @@ from capif_events.models.security_method import SecurityMethod # noqa: E501 from capif_events.models.service_kpis import ServiceKpis # noqa: E501 from capif_events.models.version import Version # noqa: E501 + class AefProfile(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py b/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py index 4d2075bc..a627518b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.time_range_list import TimeRangeList from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.time_range_list import TimeRangeList # noqa: E501 + class ApiInvokerPolicy(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py b/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py index 3ea72ce9..25b8d95c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class ApiStatus(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/base_model.py b/services/TS29222_CAPIF_Events_API/capif_events/models/base_model.py index 41797264..336bc44c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/base_model.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/base_model.py @@ -1,5 +1,4 @@ import pprint - import typing from capif_events import util diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/buffered_notifications_action.py b/services/TS29222_CAPIF_Events_API/capif_events/models/buffered_notifications_action.py index eca65477..b53e72cf 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/buffered_notifications_action.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/buffered_notifications_action.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class BufferedNotificationsAction(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event.py b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event.py index fa3a9828..2d55c4ef 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class CAPIFEvent(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py index c15ad4c8..6dcc6c7f 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.access_control_policy_list_ext import AccessControlPolicyListExt -from capif_events.models.invocation_log import InvocationLog -from capif_events.models.service_api_description import ServiceAPIDescription -from capif_events.models.topology_hiding import TopologyHiding from capif_events import util - from capif_events.models.access_control_policy_list_ext import AccessControlPolicyListExt # noqa: E501 +from capif_events.models.base_model import Model from capif_events.models.invocation_log import InvocationLog # noqa: E501 from capif_events.models.service_api_description import ServiceAPIDescription # noqa: E501 from capif_events.models.topology_hiding import TopologyHiding # noqa: E501 + class CAPIFEventDetail(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py index e9c1638d..dd7c2d7c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class CAPIFEventFilter(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/civic_address.py b/services/TS29222_CAPIF_Events_API/capif_events/models/civic_address.py index 5819d5f2..379ebe0a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/civic_address.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/civic_address.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class CivicAddress(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/communication_type.py b/services/TS29222_CAPIF_Events_API/capif_events/models/communication_type.py index e5203eb6..3beb1ab1 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/communication_type.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/communication_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class CommunicationType(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py b/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py index 5676f216..4b20ff1e 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.communication_type import CommunicationType -from capif_events.models.operation import Operation from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.communication_type import CommunicationType # noqa: E501 from capif_events.models.operation import Operation # noqa: E501 + class CustomOperation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/data_format.py b/services/TS29222_CAPIF_Events_API/capif_events/models/data_format.py index adec690a..c668244c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/data_format.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/data_format.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class DataFormat(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py index b5be85b2..928435e9 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.gad_shape import GADShape -from capif_events.models.geographical_coordinates import GeographicalCoordinates -from capif_events.models.supported_gad_shapes import SupportedGADShapes from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class EllipsoidArc(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py b/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py index 9200e1bc..a77a357e 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.capif_event import CAPIFEvent -from capif_events.models.capif_event_detail import CAPIFEventDetail from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.capif_event import CAPIFEvent # noqa: E501 from capif_events.models.capif_event_detail import CAPIFEventDetail # noqa: E501 + class EventNotification(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py index ee0aafea..0470f4e6 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py @@ -1,20 +1,14 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.capif_event import CAPIFEvent -from capif_events.models.capif_event_filter import CAPIFEventFilter -from capif_events.models.reporting_information import ReportingInformation -from capif_events.models.websock_notif_config import WebsockNotifConfig -import re from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.capif_event import CAPIFEvent # noqa: E501 from capif_events.models.capif_event_filter import CAPIFEventFilter # noqa: E501 from capif_events.models.reporting_information import ReportingInformation # noqa: E501 from capif_events.models.websock_notif_config import WebsockNotifConfig # noqa: E501 -import re # noqa: E501 + class EventSubscription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py index 51be7cd3..437e372d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.capif_event import CAPIFEvent -from capif_events.models.capif_event_filter import CAPIFEventFilter -from capif_events.models.reporting_information import ReportingInformation from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.capif_event import CAPIFEvent # noqa: E501 from capif_events.models.capif_event_filter import CAPIFEventFilter # noqa: E501 from capif_events.models.reporting_information import ReportingInformation # noqa: E501 + class EventSubscriptionPatch(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py b/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py index f669a853..4ff103eb 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.supported_gad_shapes import SupportedGADShapes from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class GADShape(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py b/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py index 45c7018d..f09f9422 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py @@ -1,20 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.ellipsoid_arc import EllipsoidArc -from capif_events.models.geographical_coordinates import GeographicalCoordinates -from capif_events.models.point import Point -from capif_events.models.point_altitude import PointAltitude -from capif_events.models.point_altitude_uncertainty import PointAltitudeUncertainty -from capif_events.models.point_uncertainty_circle import PointUncertaintyCircle -from capif_events.models.point_uncertainty_ellipse import PointUncertaintyEllipse -from capif_events.models.polygon import Polygon -from capif_events.models.supported_gad_shapes import SupportedGADShapes -from capif_events.models.uncertainty_ellipse import UncertaintyEllipse from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.ellipsoid_arc import EllipsoidArc # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.point import Point # noqa: E501 @@ -26,6 +14,7 @@ from capif_events.models.polygon import Polygon # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class GeographicArea(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/geographical_coordinates.py b/services/TS29222_CAPIF_Events_API/capif_events/models/geographical_coordinates.py index 38210506..c0cc15c6 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/geographical_coordinates.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/geographical_coordinates.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class GeographicalCoordinates(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/interface_description.py b/services/TS29222_CAPIF_Events_API/capif_events/models/interface_description.py index e31b30d2..69bf2441 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/interface_description.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/interface_description.py @@ -1,16 +1,12 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.o_auth_grant_type import OAuthGrantType -from capif_events.models.security_method import SecurityMethod -import re from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from capif_events.models.security_method import SecurityMethod # noqa: E501 -import re # noqa: E501 + class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/invalid_param.py b/services/TS29222_CAPIF_Events_API/capif_events/models/invalid_param.py index 9f3557f5..ce023bf2 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/invalid_param.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/invalid_param.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/invocation_log.py b/services/TS29222_CAPIF_Events_API/capif_events/models/invocation_log.py index b67a3978..450c08bb 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/invocation_log.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/invocation_log.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.log import Log -import re from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.log import Log # noqa: E501 -import re # noqa: E501 + class InvocationLog(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py index f633723b..0c43c0a4 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.ipv4_address_range import Ipv4AddressRange -from capif_events.models.ipv6_address_range1 import Ipv6AddressRange1 from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 from capif_events.models.ipv6_address_range1 import Ipv6AddressRange1 # noqa: E501 + class IpAddrRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range.py index 10e51773..2f1dc1f9 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -import re from capif_events import util +from capif_events.models.base_model import Model -import re # noqa: E501 class Ipv4AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range1.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range1.py index c0291053..8c0d6664 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range1.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv4_address_range1.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -import re from capif_events import util +from capif_events.models.base_model import Model -import re # noqa: E501 class Ipv4AddressRange1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_addr1.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_addr1.py index d07d4876..0dd4716a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_addr1.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_addr1.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class Ipv6Addr1(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range.py index 17f20cdd..b7a59aff 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class Ipv6AddressRange(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range1.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range1.py index 4d678058..1f992719 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range1.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ipv6_address_range1.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.ipv6_addr1 import Ipv6Addr1 from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 + class Ipv6AddressRange1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py index 694b07d0..3432c476 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.gad_shape import GADShape -from capif_events.models.local_origin import LocalOrigin -from capif_events.models.relative_cartesian_location import RelativeCartesianLocation -from capif_events.models.supported_gad_shapes import SupportedGADShapes -from capif_events.models.uncertainty_ellipse import UncertaintyEllipse from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.local_origin import LocalOrigin # noqa: E501 from capif_events.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class Local2dPointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py index 7f164c4d..702a38e1 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.gad_shape import GADShape -from capif_events.models.local_origin import LocalOrigin -from capif_events.models.relative_cartesian_location import RelativeCartesianLocation -from capif_events.models.supported_gad_shapes import SupportedGADShapes -from capif_events.models.uncertainty_ellipsoid import UncertaintyEllipsoid from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.local_origin import LocalOrigin # noqa: E501 from capif_events.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_events.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 + class Local3dPointUncertaintyEllipsoid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py b/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py index f5b69773..f11e9ffe 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.geographic_area import GeographicArea -from capif_events.models.geographical_coordinates import GeographicalCoordinates from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.geographic_area import GeographicArea # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 + class LocalOrigin(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/log.py b/services/TS29222_CAPIF_Events_API/capif_events/models/log.py index bfb21f73..647a3c08 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/log.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/log.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.interface_description import InterfaceDescription -from capif_events.models.operation import Operation -from capif_events.models.protocol import Protocol from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.interface_description import InterfaceDescription # noqa: E501 from capif_events.models.operation import Operation # noqa: E501 from capif_events.models.protocol import Protocol # noqa: E501 + class Log(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py b/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py index 00839244..a928f40f 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.buffered_notifications_action import BufferedNotificationsAction -from capif_events.models.subscription_action import SubscriptionAction from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.buffered_notifications_action import BufferedNotificationsAction # noqa: E501 from capif_events.models.subscription_action import SubscriptionAction # noqa: E501 + class MutingExceptionInstructions(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/muting_notifications_settings.py b/services/TS29222_CAPIF_Events_API/capif_events/models/muting_notifications_settings.py index ac4ea3d6..a1de5ef7 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/muting_notifications_settings.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/muting_notifications_settings.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class MutingNotificationsSettings(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/notification_flag.py b/services/TS29222_CAPIF_Events_API/capif_events/models/notification_flag.py index fa4d5259..85bf9cde 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/notification_flag.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/notification_flag.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class NotificationFlag(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/notification_method.py b/services/TS29222_CAPIF_Events_API/capif_events/models/notification_method.py index b87ce0b5..b6832cd0 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/notification_method.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/notification_method.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class NotificationMethod(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Events_API/capif_events/models/o_auth_grant_type.py index 5d4c4ba6..42bce003 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/o_auth_grant_type.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/o_auth_grant_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class OAuthGrantType(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/operation.py b/services/TS29222_CAPIF_Events_API/capif_events/models/operation.py index 01c08428..ae36b029 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/operation.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/operation.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class Operation(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/partitioning_criteria.py b/services/TS29222_CAPIF_Events_API/capif_events/models/partitioning_criteria.py index 1fed743c..e744de1a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/partitioning_criteria.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/partitioning_criteria.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class PartitioningCriteria(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point.py index 25e5dcef..68b096fb 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.gad_shape import GADShape -from capif_events.models.geographical_coordinates import GeographicalCoordinates -from capif_events.models.supported_gad_shapes import SupportedGADShapes from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class Point(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py index e1fbee8d..637b2e25 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.gad_shape import GADShape -from capif_events.models.geographical_coordinates import GeographicalCoordinates -from capif_events.models.supported_gad_shapes import SupportedGADShapes from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class PointAltitude(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py index 965fd431..81b375b6 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.gad_shape import GADShape -from capif_events.models.geographical_coordinates import GeographicalCoordinates -from capif_events.models.supported_gad_shapes import SupportedGADShapes -from capif_events.models.uncertainty_ellipse import UncertaintyEllipse from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class PointAltitudeUncertainty(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py index 8ea7284c..55ac081d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.gad_shape import GADShape -from capif_events.models.geographical_coordinates import GeographicalCoordinates -from capif_events.models.supported_gad_shapes import SupportedGADShapes from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class PointUncertaintyCircle(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py index 07f77277..515a1d18 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.gad_shape import GADShape -from capif_events.models.geographical_coordinates import GeographicalCoordinates -from capif_events.models.supported_gad_shapes import SupportedGADShapes -from capif_events.models.uncertainty_ellipse import UncertaintyEllipse from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class PointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py b/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py index 8804de2c..8d8fe405 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.gad_shape import GADShape -from capif_events.models.geographical_coordinates import GeographicalCoordinates -from capif_events.models.supported_gad_shapes import SupportedGADShapes from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class Polygon(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/problem_details.py b/services/TS29222_CAPIF_Events_API/capif_events/models/problem_details.py index 4cd85b68..225739b5 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/problem_details.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/problem_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.invalid_param import InvalidParam -import re from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.invalid_param import InvalidParam # noqa: E501 -import re # noqa: E501 + class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/protocol.py b/services/TS29222_CAPIF_Events_API/capif_events/models/protocol.py index 437f5b2a..3fb57d95 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/protocol.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/protocol.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class Protocol(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/published_api_path.py b/services/TS29222_CAPIF_Events_API/capif_events/models/published_api_path.py index f341f1c9..f66c1853 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/published_api_path.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/published_api_path.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class PublishedApiPath(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/relative_cartesian_location.py b/services/TS29222_CAPIF_Events_API/capif_events/models/relative_cartesian_location.py index 5a994928..eeeb3d31 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/relative_cartesian_location.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/relative_cartesian_location.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class RelativeCartesianLocation(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py b/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py index 08e387b0..ac8dde65 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.muting_exception_instructions import MutingExceptionInstructions -from capif_events.models.muting_notifications_settings import MutingNotificationsSettings -from capif_events.models.notification_flag import NotificationFlag -from capif_events.models.notification_method import NotificationMethod -from capif_events.models.partitioning_criteria import PartitioningCriteria from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.muting_exception_instructions import MutingExceptionInstructions # noqa: E501 from capif_events.models.muting_notifications_settings import MutingNotificationsSettings # noqa: E501 from capif_events.models.notification_flag import NotificationFlag # noqa: E501 from capif_events.models.notification_method import NotificationMethod # noqa: E501 from capif_events.models.partitioning_criteria import PartitioningCriteria # noqa: E501 + class ReportingInformation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py b/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py index 8493f59d..a675ea25 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.communication_type import CommunicationType -from capif_events.models.custom_operation import CustomOperation -from capif_events.models.operation import Operation from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.communication_type import CommunicationType # noqa: E501 from capif_events.models.custom_operation import CustomOperation # noqa: E501 from capif_events.models.operation import Operation # noqa: E501 + class Resource(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py b/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py index b59d1dd7..abfb9e61 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.aef_profile import AefProfile -from capif_events.models.ipv4_address_range1 import Ipv4AddressRange1 -from capif_events.models.ipv6_address_range import Ipv6AddressRange from capif_events import util - from capif_events.models.aef_profile import AefProfile # noqa: E501 +from capif_events.models.base_model import Model from capif_events.models.ipv4_address_range1 import Ipv4AddressRange1 # noqa: E501 from capif_events.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 + class RoutingRule(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/security_method.py b/services/TS29222_CAPIF_Events_API/capif_events/models/security_method.py index ff87e785..cf8caff4 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/security_method.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/security_method.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py b/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py index 6616b8f4..88daceb2 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py @@ -1,20 +1,14 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.aef_profile import AefProfile -from capif_events.models.api_status import ApiStatus -from capif_events.models.published_api_path import PublishedApiPath -from capif_events.models.shareable_information import ShareableInformation -import re from capif_events import util - from capif_events.models.aef_profile import AefProfile # noqa: E501 from capif_events.models.api_status import ApiStatus # noqa: E501 +from capif_events.models.base_model import Model from capif_events.models.published_api_path import PublishedApiPath # noqa: E501 from capif_events.models.shareable_information import ShareableInformation # noqa: E501 -import re # noqa: E501 + class ServiceAPIDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/service_kpis.py b/services/TS29222_CAPIF_Events_API/capif_events/models/service_kpis.py index 7a4789dd..5a536e99 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/service_kpis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/service_kpis.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -import re from capif_events import util +from capif_events.models.base_model import Model -import re # noqa: E501 class ServiceKpis(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py b/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py index 7b16c081..c67425be 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class ShareableInformation(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/subscription_action.py b/services/TS29222_CAPIF_Events_API/capif_events/models/subscription_action.py index 99ae834d..c0ada57a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/subscription_action.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/subscription_action.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class SubscriptionAction(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/supported_gad_shapes.py b/services/TS29222_CAPIF_Events_API/capif_events/models/supported_gad_shapes.py index 38ff4d53..919cd5ad 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/supported_gad_shapes.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/supported_gad_shapes.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class SupportedGADShapes(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/time_range_list.py b/services/TS29222_CAPIF_Events_API/capif_events/models/time_range_list.py index 9a6b6267..0adae28c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/time_range_list.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/time_range_list.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class TimeRangeList(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/topology_hiding.py b/services/TS29222_CAPIF_Events_API/capif_events/models/topology_hiding.py index 0a028785..5cb44ed0 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/topology_hiding.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/topology_hiding.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.routing_rule import RoutingRule from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.routing_rule import RoutingRule # noqa: E501 + class TopologyHiding(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipse.py index 627eb52b..88c3675d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipse.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class UncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipsoid.py index f10fac8f..5e7e36ad 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/uncertainty_ellipsoid.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class UncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/version.py b/services/TS29222_CAPIF_Events_API/capif_events/models/version.py index 709e34ce..8185274b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/version.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/version.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model -from capif_events.models.custom_operation import CustomOperation -from capif_events.models.resource import Resource from capif_events import util - +from capif_events.models.base_model import Model from capif_events.models.custom_operation import CustomOperation # noqa: E501 from capif_events.models.resource import Resource # noqa: E501 + class Version(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/websock_notif_config.py b/services/TS29222_CAPIF_Events_API/capif_events/models/websock_notif_config.py index 0077354d..de4a84b0 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/websock_notif_config.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/websock_notif_config.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_events.models.base_model import Model from capif_events import util +from capif_events.models.base_model import Model class WebsockNotifConfig(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/test/__init__.py b/services/TS29222_CAPIF_Events_API/capif_events/test/__init__.py index c55e721a..8da9951b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/test/__init__.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/test/__init__.py @@ -1,9 +1,8 @@ import logging import connexion -from flask_testing import TestCase - from capif_events.encoder import JSONEncoder +from flask_testing import TestCase class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py b/services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py index 7e06036b..79cc892f 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py @@ -1,11 +1,10 @@ import unittest -from flask import json - from capif_events.models.event_subscription import EventSubscription # noqa: E501 from capif_events.models.event_subscription_patch import EventSubscriptionPatch # noqa: E501 from capif_events.models.problem_details import ProblemDetails # noqa: E501 from capif_events.test import BaseTestCase +from flask import json class TestDefaultController(BaseTestCase): diff --git a/services/TS29222_CAPIF_Events_API/setup.py b/services/TS29222_CAPIF_Events_API/setup.py index f6e3cc23..f126a701 100644 --- a/services/TS29222_CAPIF_Events_API/setup.py +++ b/services/TS29222_CAPIF_Events_API/setup.py @@ -1,5 +1,5 @@ -import sys -from setuptools import setup, find_packages + +from setuptools import find_packages, setup NAME = "capif_events" VERSION = "1.0.0" diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/app.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/app.py index eda5d2bc..56c94af9 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/app.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/app.py @@ -5,6 +5,8 @@ import os from logging.handlers import RotatingFileHandler import connexion +import encoder +from config import Config from fluent import sender from opentelemetry import trace from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter @@ -14,9 +16,6 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator -import encoder -from config import Config - NAME = "Logging-Service" # Setting log level @@ -30,7 +29,7 @@ def configure_monitoring(app, config): fluent_bit_host = config['monitoring']['fluent_bit_host'] fluent_bit_port = config['monitoring']['fluent_bit_port'] fluent_bit_sender = sender.FluentSender('Logging-Service', host=fluent_bit_host, port=fluent_bit_port) - propagator = TraceContextTextMapPropagator() + TraceContextTextMapPropagator() tracer_provider = TracerProvider(resource=resource) trace.set_tracer_provider(tracer_provider) diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py index 6877196b..c91cce60 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py @@ -1,9 +1,7 @@ -from api_invocation_logs.models.invocation_log import InvocationLog # noqa: E501 - from api_invocation_logs.models.invocation_log import InvocationLog # noqa: E501 from cryptography import x509 from cryptography.hazmat.backends import default_backend -from flask import request, current_app +from flask import current_app, request from ..core.invocationlogs import LoggingInvocationOperations from ..core.validate_user import ControlAccess diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py index 43106643..1e8ddf4f 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py @@ -6,11 +6,11 @@ import secrets from flask import current_app from pymongo import ReturnDocument -from .redis_event import RedisEvent -from .resources import Resource -from .responses import internal_server_error, not_found_error, unauthorized_error, make_response from ..encoder import CustomJSONEncoder from ..util import serialize_clean_camel_case +from .redis_event import RedisEvent +from .resources import Resource +from .responses import internal_server_error, make_response, not_found_error, unauthorized_error class LoggingInvocationOperations(Resource): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/redis_event.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/redis_event.py index c65a6a20..8dccdf3d 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/redis_event.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/redis_event.py @@ -1,7 +1,7 @@ import json -from .publisher import Publisher from ..encoder import CustomJSONEncoder +from .publisher import Publisher publisher_ops = Publisher() diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/validate_user.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/validate_user.py index c2bdf50f..f3f5cb6f 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/validate_user.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/validate_user.py @@ -1,12 +1,12 @@ import json -from flask import current_app, Response +from flask import Response, current_app -from .resources import Resource -from .responses import internal_server_error from ..encoder import CustomJSONEncoder from ..models.problem_details import ProblemDetails from ..util import serialize_clean_camel_case +from .resources import Resource +from .responses import internal_server_error class ControlAccess(Resource): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py index cfc7e59c..d036df69 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py @@ -1,11 +1,2 @@ # flake8: noqa # import models into model package -from api_invocation_logs.models.interface_description import InterfaceDescription -from api_invocation_logs.models.invalid_param import InvalidParam -from api_invocation_logs.models.invocation_log import InvocationLog -from api_invocation_logs.models.log import Log -from api_invocation_logs.models.o_auth_grant_type import OAuthGrantType -from api_invocation_logs.models.operation import Operation -from api_invocation_logs.models.problem_details import ProblemDetails -from api_invocation_logs.models.protocol import Protocol -from api_invocation_logs.models.security_method import SecurityMethod diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py index 642d94a3..d7f252ca 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py @@ -1,5 +1,4 @@ import pprint - import typing from api_invocation_logs import util diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py index 10e8ad15..03cb6d5a 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py @@ -1,16 +1,12 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model import Model -from api_invocation_logs.models.o_auth_grant_type import OAuthGrantType -from api_invocation_logs.models.security_method import SecurityMethod -import re from api_invocation_logs import util - +from api_invocation_logs.models.base_model import Model from api_invocation_logs.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from api_invocation_logs.models.security_method import SecurityMethod # noqa: E501 -import re # noqa: E501 + class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py index d7ec5735..18d055db 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model import Model from api_invocation_logs import util +from api_invocation_logs.models.base_model import Model class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py index 6110fce8..e7464b7f 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model import Model -from api_invocation_logs.models.log import Log -import re from api_invocation_logs import util - +from api_invocation_logs.models.base_model import Model from api_invocation_logs.models.log import Log # noqa: E501 -import re # noqa: E501 + class InvocationLog(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py index 41076a09..84715f30 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model import Model -from api_invocation_logs.models.interface_description import InterfaceDescription -from api_invocation_logs.models.operation import Operation -from api_invocation_logs.models.protocol import Protocol from api_invocation_logs import util - +from api_invocation_logs.models.base_model import Model from api_invocation_logs.models.interface_description import InterfaceDescription # noqa: E501 from api_invocation_logs.models.operation import Operation # noqa: E501 from api_invocation_logs.models.protocol import Protocol # noqa: E501 + class Log(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/o_auth_grant_type.py index 1165483f..9c8fcf7d 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/o_auth_grant_type.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/o_auth_grant_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model import Model from api_invocation_logs import util +from api_invocation_logs.models.base_model import Model class OAuthGrantType(Model): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py index 513f6d00..a4bea825 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model import Model from api_invocation_logs import util +from api_invocation_logs.models.base_model import Model class Operation(Model): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py index 1ab0e54c..0f87859c 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model import Model -from api_invocation_logs.models.invalid_param import InvalidParam -import re from api_invocation_logs import util - +from api_invocation_logs.models.base_model import Model from api_invocation_logs.models.invalid_param import InvalidParam # noqa: E501 -import re # noqa: E501 + class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py index ec4bf3b2..fe449f01 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model import Model from api_invocation_logs import util +from api_invocation_logs.models.base_model import Model class Protocol(Model): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py index b47fd3ef..3f0ff15b 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model import Model from api_invocation_logs import util +from api_invocation_logs.models.base_model import Model class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py index 52299ec8..5282c992 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py @@ -1,9 +1,8 @@ import logging import connexion -from flask_testing import TestCase - from api_invocation_logs.encoder import JSONEncoder +from flask_testing import TestCase class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py index a7819930..1475dbad 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py @@ -1,10 +1,9 @@ import unittest -from flask import json - from api_invocation_logs.models.invocation_log import InvocationLog # noqa: E501 from api_invocation_logs.models.problem_details import ProblemDetails # noqa: E501 from api_invocation_logs.test import BaseTestCase +from flask import json class TestDefaultController(BaseTestCase): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py index 46725d89..aed84929 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py @@ -1,5 +1,5 @@ -import sys -from setuptools import setup, find_packages + +from setuptools import find_packages, setup NAME = "api_invocation_logs" VERSION = "1.0.0" diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/app.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/app.py index 6cddfc9e..46e0941c 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/app.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/app.py @@ -6,6 +6,10 @@ from datetime import datetime from logging.handlers import RotatingFileHandler import connexion +# from published_apis import encoder +import encoder +from config import Config +from core.consumer_messager import Subscriber from flask_apscheduler import APScheduler from flask_executor import Executor from flask_jwt_extended import JWTManager @@ -19,11 +23,6 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator -# from published_apis import encoder -import encoder -from config import Config -from core.consumer_messager import Subscriber - NAME = "Publish-Service" # Setting log level @@ -37,7 +36,7 @@ def configure_monitoring(app, config): fluent_bit_host = config['monitoring']['fluent_bit_host'] fluent_bit_port = config['monitoring']['fluent_bit_port'] fluent_bit_sender = sender.FluentSender('Publish-Service', host=fluent_bit_host, port=fluent_bit_port) - propagator = TraceContextTextMapPropagator() + TraceContextTextMapPropagator() tracer_provider = TracerProvider(resource=resource) trace.set_tracer_provider(tracer_provider) diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py index 4f43631c..27c4b642 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py @@ -2,8 +2,8 @@ from functools import wraps from cryptography import x509 from cryptography.hazmat.backends import default_backend -from flask import request, current_app -from published_apis.vendor_specific import vendor_specific_key_n_value, find_attribute_in_body +from flask import current_app, request +from published_apis.vendor_specific import find_attribute_in_body, vendor_specific_key_n_value from ..core.responses import bad_request_error from ..core.serviceapidescriptions import PublishServiceOperations diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/individual_apf_published_api_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/individual_apf_published_api_controller.py index 0661991f..78336ca4 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/individual_apf_published_api_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/individual_apf_published_api_controller.py @@ -2,7 +2,7 @@ from functools import wraps from cryptography import x509 from cryptography.hazmat.backends import default_backend -from flask import request, current_app +from flask import current_app, request from published_apis.models.service_api_description_patch import ServiceAPIDescriptionPatch # noqa: E501 from ..core.serviceapidescriptions import PublishServiceOperations diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/security_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/security_controller.py index 6d294ffd..8b137891 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/security_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/security_controller.py @@ -1,2 +1 @@ -from typing import List diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/publisher.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/publisher.py index 34fcdf45..8292de4d 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/publisher.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/publisher.py @@ -1,5 +1,6 @@ import redis + class Publisher(): def __init__(self): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/redis_event.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/redis_event.py index f80e6b2e..3037ae76 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/redis_event.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/redis_event.py @@ -1,7 +1,7 @@ import json -from .publisher import Publisher from ..encoder import JSONEncoder +from .publisher import Publisher publisher_ops = Publisher() diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py index 7be74822..d5b45175 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py @@ -5,15 +5,21 @@ from datetime import datetime from flask import current_app from pymongo import ReturnDocument +from ..models.service_api_description import ServiceAPIDescription +from ..util import clean_empty, clean_n_camel_case, dict_to_camel_case +from ..vendor_specific import add_vend_spec_fields from .auth_manager import AuthManager from .publisher import Publisher from .redis_event import RedisEvent from .resources import Resource -from .responses import internal_server_error, forbidden_error, not_found_error, unauthorized_error, make_response, \ - bad_request_error -from ..models.service_api_description import ServiceAPIDescription -from ..util import dict_to_camel_case, clean_empty, clean_n_camel_case -from ..vendor_specific import add_vend_spec_fields +from .responses import ( + bad_request_error, + forbidden_error, + internal_server_error, + make_response, + not_found_error, + unauthorized_error +) publisher_ops = Publisher() diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/validate_user.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/validate_user.py index 94fe1d4b..1782fe04 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/validate_user.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/validate_user.py @@ -1,12 +1,12 @@ import json -from flask import current_app, Response +from flask import Response, current_app -from .resources import Resource -from .responses import internal_server_error from ..encoder import CustomJSONEncoder from ..models.problem_details import ProblemDetails from ..util import serialize_clean_camel_case +from .resources import Resource +from .responses import internal_server_error class ControlAccess(Resource): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/encoder.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/encoder.py index 4d957655..6f24878a 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/encoder.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/encoder.py @@ -1,5 +1,4 @@ from connexion.jsonifier import JSONEncoder - from published_apis.models.base_model import Model diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/__init__.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/__init__.py index 809cf1b1..d036df69 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/__init__.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/__init__.py @@ -1,44 +1,2 @@ # flake8: noqa # import models into model package -from published_apis.models.aef_location import AefLocation -from published_apis.models.aef_profile import AefProfile -from published_apis.models.api_status import ApiStatus -from published_apis.models.civic_address import CivicAddress -from published_apis.models.communication_type import CommunicationType -from published_apis.models.custom_operation import CustomOperation -from published_apis.models.data_format import DataFormat -from published_apis.models.ellipsoid_arc import EllipsoidArc -from published_apis.models.gad_shape import GADShape -from published_apis.models.geographic_area import GeographicArea -from published_apis.models.geographical_coordinates import GeographicalCoordinates -from published_apis.models.interface_description import InterfaceDescription -from published_apis.models.invalid_param import InvalidParam -from published_apis.models.ip_addr_range import IpAddrRange -from published_apis.models.ipv4_address_range import Ipv4AddressRange -from published_apis.models.ipv6_addr1 import Ipv6Addr1 -from published_apis.models.ipv6_address_range import Ipv6AddressRange -from published_apis.models.local2d_point_uncertainty_ellipse import Local2dPointUncertaintyEllipse -from published_apis.models.local3d_point_uncertainty_ellipsoid import Local3dPointUncertaintyEllipsoid -from published_apis.models.local_origin import LocalOrigin -from published_apis.models.o_auth_grant_type import OAuthGrantType -from published_apis.models.operation import Operation -from published_apis.models.point import Point -from published_apis.models.point_altitude import PointAltitude -from published_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty -from published_apis.models.point_uncertainty_circle import PointUncertaintyCircle -from published_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse -from published_apis.models.polygon import Polygon -from published_apis.models.problem_details import ProblemDetails -from published_apis.models.protocol import Protocol -from published_apis.models.published_api_path import PublishedApiPath -from published_apis.models.relative_cartesian_location import RelativeCartesianLocation -from published_apis.models.resource import Resource -from published_apis.models.security_method import SecurityMethod -from published_apis.models.service_api_description import ServiceAPIDescription -from published_apis.models.service_api_description_patch import ServiceAPIDescriptionPatch -from published_apis.models.service_kpis import ServiceKpis -from published_apis.models.shareable_information import ShareableInformation -from published_apis.models.supported_gad_shapes import SupportedGADShapes -from published_apis.models.uncertainty_ellipse import UncertaintyEllipse -from published_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid -from published_apis.models.version import Version diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_location.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_location.py index ccc48596..ca2cc22e 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_location.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_location.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.civic_address import CivicAddress -from published_apis.models.geographic_area import GeographicArea from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.civic_address import CivicAddress # noqa: E501 from published_apis.models.geographic_area import GeographicArea # noqa: E501 + class AefLocation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py index 249c595e..b50b23b7 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py @@ -1,20 +1,9 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.aef_location import AefLocation -from published_apis.models.data_format import DataFormat -from published_apis.models.interface_description import InterfaceDescription -from published_apis.models.ip_addr_range import IpAddrRange -from published_apis.models.o_auth_grant_type import OAuthGrantType -from published_apis.models.protocol import Protocol -from published_apis.models.security_method import SecurityMethod -from published_apis.models.service_kpis import ServiceKpis -from published_apis.models.version import Version from published_apis import util - from published_apis.models.aef_location import AefLocation # noqa: E501 +from published_apis.models.base_model import Model from published_apis.models.data_format import DataFormat # noqa: E501 from published_apis.models.interface_description import InterfaceDescription # noqa: E501 from published_apis.models.ip_addr_range import IpAddrRange # noqa: E501 @@ -24,6 +13,7 @@ from published_apis.models.security_method import SecurityMethod # noqa: E501 from published_apis.models.service_kpis import ServiceKpis # noqa: E501 from published_apis.models.version import Version # noqa: E501 + class AefProfile(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py index 0492b259..4fcf0817 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class ApiStatus(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/base_model.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/base_model.py index ae24c559..d4fac36d 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/base_model.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/base_model.py @@ -1,5 +1,4 @@ import pprint - import typing from published_apis import util diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/civic_address.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/civic_address.py index b4fa7c06..2985c188 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/civic_address.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/civic_address.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class CivicAddress(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/communication_type.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/communication_type.py index a91645f4..34963f38 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/communication_type.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/communication_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class CommunicationType(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py index 1f4a66a6..2900d43e 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.communication_type import CommunicationType -from published_apis.models.operation import Operation from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.communication_type import CommunicationType # noqa: E501 from published_apis.models.operation import Operation # noqa: E501 + class CustomOperation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/data_format.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/data_format.py index 5c6c9072..0f79d52e 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/data_format.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/data_format.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class DataFormat(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py index ca81b714..9b065e53 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.gad_shape import GADShape -from published_apis.models.geographical_coordinates import GeographicalCoordinates -from published_apis.models.supported_gad_shapes import SupportedGADShapes from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class EllipsoidArc(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py index f4754606..370e1da4 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.supported_gad_shapes import SupportedGADShapes from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class GADShape(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py index 0fa074cd..226225be 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py @@ -1,20 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.ellipsoid_arc import EllipsoidArc -from published_apis.models.geographical_coordinates import GeographicalCoordinates -from published_apis.models.point import Point -from published_apis.models.point_altitude import PointAltitude -from published_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty -from published_apis.models.point_uncertainty_circle import PointUncertaintyCircle -from published_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse -from published_apis.models.polygon import Polygon -from published_apis.models.supported_gad_shapes import SupportedGADShapes -from published_apis.models.uncertainty_ellipse import UncertaintyEllipse from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.ellipsoid_arc import EllipsoidArc # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.point import Point # noqa: E501 @@ -26,6 +14,7 @@ from published_apis.models.polygon import Polygon # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class GeographicArea(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographical_coordinates.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographical_coordinates.py index 49c59769..253a9089 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographical_coordinates.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographical_coordinates.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class GeographicalCoordinates(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py index 9dc53d39..7c8707c4 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py @@ -1,16 +1,12 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.o_auth_grant_type import OAuthGrantType -from published_apis.models.security_method import SecurityMethod -import re from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from published_apis.models.security_method import SecurityMethod # noqa: E501 -import re # noqa: E501 + class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/invalid_param.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/invalid_param.py index 16472ecc..b7b4d5ce 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/invalid_param.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/invalid_param.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py index 7934c226..48c4ede0 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.ipv4_address_range import Ipv4AddressRange -from published_apis.models.ipv6_address_range import Ipv6AddressRange from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 from published_apis.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 + class IpAddrRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv4_address_range.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv4_address_range.py index f72ef00e..2547d74c 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv4_address_range.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv4_address_range.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -import re from published_apis import util +from published_apis.models.base_model import Model -import re # noqa: E501 class Ipv4AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_addr1.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_addr1.py index 268ec666..354ce469 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_addr1.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_addr1.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class Ipv6Addr1(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_address_range.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_address_range.py index 37f319c8..a28eff1f 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_address_range.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ipv6_address_range.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.ipv6_addr1 import Ipv6Addr1 from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 + class Ipv6AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py index 2c575408..2b13ab8c 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.gad_shape import GADShape -from published_apis.models.local_origin import LocalOrigin -from published_apis.models.relative_cartesian_location import RelativeCartesianLocation -from published_apis.models.supported_gad_shapes import SupportedGADShapes -from published_apis.models.uncertainty_ellipse import UncertaintyEllipse from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.local_origin import LocalOrigin # noqa: E501 from published_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class Local2dPointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py index 2dfe87ae..ca17643d 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.gad_shape import GADShape -from published_apis.models.local_origin import LocalOrigin -from published_apis.models.relative_cartesian_location import RelativeCartesianLocation -from published_apis.models.supported_gad_shapes import SupportedGADShapes -from published_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.local_origin import LocalOrigin # noqa: E501 from published_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from published_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 + class Local3dPointUncertaintyEllipsoid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py index 6686d14d..d86b7142 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.geographic_area import GeographicArea -from published_apis.models.geographical_coordinates import GeographicalCoordinates from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.geographic_area import GeographicArea # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 + class LocalOrigin(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/o_auth_grant_type.py index d957daf8..a61d636f 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/o_auth_grant_type.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/o_auth_grant_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class OAuthGrantType(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/operation.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/operation.py index 0923ce76..abfa0c22 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/operation.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/operation.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class Operation(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py index d16cbaaa..b0d7a764 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.gad_shape import GADShape -from published_apis.models.geographical_coordinates import GeographicalCoordinates -from published_apis.models.supported_gad_shapes import SupportedGADShapes from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class Point(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py index 0fb374f7..7fd826c1 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.gad_shape import GADShape -from published_apis.models.geographical_coordinates import GeographicalCoordinates -from published_apis.models.supported_gad_shapes import SupportedGADShapes from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class PointAltitude(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py index cf96f55d..98b36ca7 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.gad_shape import GADShape -from published_apis.models.geographical_coordinates import GeographicalCoordinates -from published_apis.models.supported_gad_shapes import SupportedGADShapes -from published_apis.models.uncertainty_ellipse import UncertaintyEllipse from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class PointAltitudeUncertainty(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py index 3b773f51..477dfae0 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.gad_shape import GADShape -from published_apis.models.geographical_coordinates import GeographicalCoordinates -from published_apis.models.supported_gad_shapes import SupportedGADShapes from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class PointUncertaintyCircle(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py index ea57f68d..1e328c07 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.gad_shape import GADShape -from published_apis.models.geographical_coordinates import GeographicalCoordinates -from published_apis.models.supported_gad_shapes import SupportedGADShapes -from published_apis.models.uncertainty_ellipse import UncertaintyEllipse from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class PointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py index 8a3f6baa..d021ee3b 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.gad_shape import GADShape -from published_apis.models.geographical_coordinates import GeographicalCoordinates -from published_apis.models.supported_gad_shapes import SupportedGADShapes from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class Polygon(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/problem_details.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/problem_details.py index 41b69ae8..39abad6a 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/problem_details.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/problem_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.invalid_param import InvalidParam -import re from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.invalid_param import InvalidParam # noqa: E501 -import re # noqa: E501 + class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/protocol.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/protocol.py index 9eb3203e..011e1942 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/protocol.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/protocol.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class Protocol(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/published_api_path.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/published_api_path.py index 4d3538df..8e02d485 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/published_api_path.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/published_api_path.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class PublishedApiPath(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/relative_cartesian_location.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/relative_cartesian_location.py index 2f17cb84..0d1e9116 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/relative_cartesian_location.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/relative_cartesian_location.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class RelativeCartesianLocation(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py index fe7445df..d00e3ee8 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.communication_type import CommunicationType -from published_apis.models.custom_operation import CustomOperation -from published_apis.models.operation import Operation from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.communication_type import CommunicationType # noqa: E501 from published_apis.models.custom_operation import CustomOperation # noqa: E501 from published_apis.models.operation import Operation # noqa: E501 + class Resource(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/security_method.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/security_method.py index 59142370..97c264ab 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/security_method.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/security_method.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py index d1c2fef1..0111b908 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py @@ -1,20 +1,14 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.aef_profile import AefProfile -from published_apis.models.api_status import ApiStatus -from published_apis.models.published_api_path import PublishedApiPath -from published_apis.models.shareable_information import ShareableInformation -import re from published_apis import util - from published_apis.models.aef_profile import AefProfile # noqa: E501 from published_apis.models.api_status import ApiStatus # noqa: E501 +from published_apis.models.base_model import Model from published_apis.models.published_api_path import PublishedApiPath # noqa: E501 from published_apis.models.shareable_information import ShareableInformation # noqa: E501 -import re # noqa: E501 + class ServiceAPIDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py index 71dd39c9..283a1a07 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py @@ -1,20 +1,14 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.aef_profile import AefProfile -from published_apis.models.api_status import ApiStatus -from published_apis.models.published_api_path import PublishedApiPath -from published_apis.models.shareable_information import ShareableInformation -import re from published_apis import util - from published_apis.models.aef_profile import AefProfile # noqa: E501 from published_apis.models.api_status import ApiStatus # noqa: E501 +from published_apis.models.base_model import Model from published_apis.models.published_api_path import PublishedApiPath # noqa: E501 from published_apis.models.shareable_information import ShareableInformation # noqa: E501 -import re # noqa: E501 + class ServiceAPIDescriptionPatch(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_kpis.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_kpis.py index f4b8ae12..ac1a773e 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_kpis.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_kpis.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -import re from published_apis import util +from published_apis.models.base_model import Model -import re # noqa: E501 class ServiceKpis(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py index ff4aea1c..a2dfbeaf 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class ShareableInformation(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/supported_gad_shapes.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/supported_gad_shapes.py index 50d7db72..095abd0a 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/supported_gad_shapes.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/supported_gad_shapes.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class SupportedGADShapes(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipse.py index 2aef9633..44957aa6 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipse.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class UncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipsoid.py index 88a428d4..0a341783 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/uncertainty_ellipsoid.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model from published_apis import util +from published_apis.models.base_model import Model class UncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py index 4126d65a..4188ad79 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from published_apis.models.base_model import Model -from published_apis.models.custom_operation import CustomOperation -from published_apis.models.resource import Resource from published_apis import util - +from published_apis.models.base_model import Model from published_apis.models.custom_operation import CustomOperation # noqa: E501 from published_apis.models.resource import Resource # noqa: E501 + class Version(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/__init__.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/__init__.py index 108a343a..07e31c34 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/__init__.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/__init__.py @@ -2,7 +2,6 @@ import logging import connexion from flask_testing import TestCase - from published_apis.encoder import JSONEncoder diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py index f194cded..aa3a20d4 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py @@ -1,7 +1,6 @@ import unittest from flask import json - from published_apis.models.problem_details import ProblemDetails # noqa: E501 from published_apis.models.service_api_description import ServiceAPIDescription # noqa: E501 from published_apis.test import BaseTestCase diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py index c9978525..c9664f15 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py @@ -1,7 +1,6 @@ import unittest from flask import json - from published_apis.models.problem_details import ProblemDetails # noqa: E501 from published_apis.models.service_api_description import ServiceAPIDescription # noqa: E501 from published_apis.models.service_api_description_patch import ServiceAPIDescriptionPatch # noqa: E501 diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/util.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/util.py index 2e3d203f..1b195665 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/util.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/util.py @@ -1,6 +1,5 @@ import datetime -import typing from published_apis import typing_utils diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/vendor_specific.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/vendor_specific.py index 21fd6b6d..97cfd800 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/vendor_specific.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/vendor_specific.py @@ -1,5 +1,6 @@ import re + def find_attribute_in_body(test, path): f_key = [] if type(test) == dict: diff --git a/services/TS29222_CAPIF_Publish_Service_API/setup.py b/services/TS29222_CAPIF_Publish_Service_API/setup.py index 5ae15b44..9cd039a1 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/setup.py +++ b/services/TS29222_CAPIF_Publish_Service_API/setup.py @@ -1,5 +1,5 @@ -import sys -from setuptools import setup, find_packages + +from setuptools import find_packages, setup NAME = "published_apis" VERSION = "1.0.0" diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/app.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/app.py index 48e8769b..4df40da6 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/app.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/app.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import connexion - import encoder app = connexion.App(__name__, specification_dir='openapi/') diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/default_controller.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/default_controller.py index 9dafc055..575fc245 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/default_controller.py @@ -1,11 +1,6 @@ -import connexion -from typing import Dict -from typing import Tuple -from typing import Union from capif_routing_info.models.problem_details import ProblemDetails # noqa: E501 from capif_routing_info.models.routing_info import RoutingInfo # noqa: E501 -from capif_routing_info import util def service_apis_service_api_id_get(service_api_id, aef_id, supp_feat=None): # noqa: E501 diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/security_controller.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/security_controller.py index 6d294ffd..8b137891 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/security_controller.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/security_controller.py @@ -1,2 +1 @@ -from typing import List diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/encoder.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/encoder.py index ba7c4d5e..61d252c5 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/encoder.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/encoder.py @@ -1,7 +1,5 @@ -from connexion.jsonifier import JSONEncoder -import six - from capif_routing_info.models.base_model import Model +from connexion.jsonifier import JSONEncoder class CustomJSONEncoder(JSONEncoder): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/__init__.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/__init__.py index 04378bc9..d036df69 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/__init__.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/__init__.py @@ -1,43 +1,2 @@ # flake8: noqa # import models into model package -from capif_routing_info.models.aef_location import AefLocation -from capif_routing_info.models.aef_profile import AefProfile -from capif_routing_info.models.civic_address import CivicAddress -from capif_routing_info.models.communication_type import CommunicationType -from capif_routing_info.models.custom_operation import CustomOperation -from capif_routing_info.models.data_format import DataFormat -from capif_routing_info.models.ellipsoid_arc import EllipsoidArc -from capif_routing_info.models.gad_shape import GADShape -from capif_routing_info.models.geographic_area import GeographicArea -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates -from capif_routing_info.models.interface_description import InterfaceDescription -from capif_routing_info.models.invalid_param import InvalidParam -from capif_routing_info.models.ip_addr_range import IpAddrRange -from capif_routing_info.models.ipv4_address_range import Ipv4AddressRange -from capif_routing_info.models.ipv4_address_range1 import Ipv4AddressRange1 -from capif_routing_info.models.ipv6_addr1 import Ipv6Addr1 -from capif_routing_info.models.ipv6_address_range import Ipv6AddressRange -from capif_routing_info.models.ipv6_address_range1 import Ipv6AddressRange1 -from capif_routing_info.models.local2d_point_uncertainty_ellipse import Local2dPointUncertaintyEllipse -from capif_routing_info.models.local3d_point_uncertainty_ellipsoid import Local3dPointUncertaintyEllipsoid -from capif_routing_info.models.local_origin import LocalOrigin -from capif_routing_info.models.o_auth_grant_type import OAuthGrantType -from capif_routing_info.models.operation import Operation -from capif_routing_info.models.point import Point -from capif_routing_info.models.point_altitude import PointAltitude -from capif_routing_info.models.point_altitude_uncertainty import PointAltitudeUncertainty -from capif_routing_info.models.point_uncertainty_circle import PointUncertaintyCircle -from capif_routing_info.models.point_uncertainty_ellipse import PointUncertaintyEllipse -from capif_routing_info.models.polygon import Polygon -from capif_routing_info.models.problem_details import ProblemDetails -from capif_routing_info.models.protocol import Protocol -from capif_routing_info.models.relative_cartesian_location import RelativeCartesianLocation -from capif_routing_info.models.resource import Resource -from capif_routing_info.models.routing_info import RoutingInfo -from capif_routing_info.models.routing_rule import RoutingRule -from capif_routing_info.models.security_method import SecurityMethod -from capif_routing_info.models.service_kpis import ServiceKpis -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes -from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse -from capif_routing_info.models.uncertainty_ellipsoid import UncertaintyEllipsoid -from capif_routing_info.models.version import Version diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py index e60b523e..aede9133 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.civic_address import CivicAddress -from capif_routing_info.models.geographic_area import GeographicArea from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.civic_address import CivicAddress # noqa: E501 from capif_routing_info.models.geographic_area import GeographicArea # noqa: E501 + class AefLocation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py index 2cb26e13..62efcf19 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py @@ -1,20 +1,9 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.aef_location import AefLocation -from capif_routing_info.models.data_format import DataFormat -from capif_routing_info.models.interface_description import InterfaceDescription -from capif_routing_info.models.ip_addr_range import IpAddrRange -from capif_routing_info.models.o_auth_grant_type import OAuthGrantType -from capif_routing_info.models.protocol import Protocol -from capif_routing_info.models.security_method import SecurityMethod -from capif_routing_info.models.service_kpis import ServiceKpis -from capif_routing_info.models.version import Version from capif_routing_info import util - from capif_routing_info.models.aef_location import AefLocation # noqa: E501 +from capif_routing_info.models.base_model import Model from capif_routing_info.models.data_format import DataFormat # noqa: E501 from capif_routing_info.models.interface_description import InterfaceDescription # noqa: E501 from capif_routing_info.models.ip_addr_range import IpAddrRange # noqa: E501 @@ -24,6 +13,7 @@ from capif_routing_info.models.security_method import SecurityMethod # noqa: E5 from capif_routing_info.models.service_kpis import ServiceKpis # noqa: E501 from capif_routing_info.models.version import Version # noqa: E501 + class AefProfile(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/base_model.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/base_model.py index 48496362..57cac681 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/base_model.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/base_model.py @@ -1,5 +1,4 @@ import pprint - import typing from capif_routing_info import util diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/civic_address.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/civic_address.py index fd306ef3..46b947c1 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/civic_address.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/civic_address.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class CivicAddress(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/communication_type.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/communication_type.py index c355c6de..84355f1b 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/communication_type.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/communication_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class CommunicationType(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py index 0e0995b2..d6a2f42a 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.communication_type import CommunicationType -from capif_routing_info.models.operation import Operation from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.communication_type import CommunicationType # noqa: E501 from capif_routing_info.models.operation import Operation # noqa: E501 + class CustomOperation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/data_format.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/data_format.py index 83f31a21..8c400e5e 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/data_format.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/data_format.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class DataFormat(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py index 345698c2..246c731e 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.gad_shape import GADShape -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class EllipsoidArc(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py index d956d8d2..c4606e3a 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class GADShape(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py index 5c159825..83b2f60a 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py @@ -1,20 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.ellipsoid_arc import EllipsoidArc -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates -from capif_routing_info.models.point import Point -from capif_routing_info.models.point_altitude import PointAltitude -from capif_routing_info.models.point_altitude_uncertainty import PointAltitudeUncertainty -from capif_routing_info.models.point_uncertainty_circle import PointUncertaintyCircle -from capif_routing_info.models.point_uncertainty_ellipse import PointUncertaintyEllipse -from capif_routing_info.models.polygon import Polygon -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes -from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.ellipsoid_arc import EllipsoidArc # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.point import Point # noqa: E501 @@ -26,6 +14,7 @@ from capif_routing_info.models.polygon import Polygon # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class GeographicArea(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographical_coordinates.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographical_coordinates.py index 8b0e51f2..e33c892b 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographical_coordinates.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographical_coordinates.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class GeographicalCoordinates(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py index f9b79570..e895f9db 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py @@ -1,16 +1,12 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.o_auth_grant_type import OAuthGrantType -from capif_routing_info.models.security_method import SecurityMethod -import re from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from capif_routing_info.models.security_method import SecurityMethod # noqa: E501 -import re # noqa: E501 + class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/invalid_param.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/invalid_param.py index e6d4edec..b42e24b5 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/invalid_param.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/invalid_param.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py index d470760f..b9869baf 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.ipv4_address_range1 import Ipv4AddressRange1 -from capif_routing_info.models.ipv6_address_range1 import Ipv6AddressRange1 from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.ipv4_address_range1 import Ipv4AddressRange1 # noqa: E501 from capif_routing_info.models.ipv6_address_range1 import Ipv6AddressRange1 # noqa: E501 + class IpAddrRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range.py index e4a0b763..cdde631b 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -import re from capif_routing_info import util +from capif_routing_info.models.base_model import Model -import re # noqa: E501 class Ipv4AddressRange(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range1.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range1.py index ca5d5f4a..beae3e04 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range1.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv4_address_range1.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -import re from capif_routing_info import util +from capif_routing_info.models.base_model import Model -import re # noqa: E501 class Ipv4AddressRange1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_addr1.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_addr1.py index f4248ba8..bfe95315 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_addr1.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_addr1.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class Ipv6Addr1(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range.py index aeaff9c1..c419f267 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class Ipv6AddressRange(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range1.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range1.py index a1060d8a..2efedbc2 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range1.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ipv6_address_range1.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.ipv6_addr1 import Ipv6Addr1 from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.ipv6_addr1 import Ipv6Addr1 # noqa: E501 + class Ipv6AddressRange1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local2d_point_uncertainty_ellipse.py index c9b258b1..e1f2f11d 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local2d_point_uncertainty_ellipse.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.gad_shape import GADShape -from capif_routing_info.models.local_origin import LocalOrigin -from capif_routing_info.models.relative_cartesian_location import RelativeCartesianLocation -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes -from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.local_origin import LocalOrigin # noqa: E501 from capif_routing_info.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class Local2dPointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py index 076c7f49..f494ead2 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py @@ -1,21 +1,15 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.gad_shape import GADShape -from capif_routing_info.models.local_origin import LocalOrigin -from capif_routing_info.models.relative_cartesian_location import RelativeCartesianLocation -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes -from capif_routing_info.models.uncertainty_ellipsoid import UncertaintyEllipsoid from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.local_origin import LocalOrigin # noqa: E501 from capif_routing_info.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_routing_info.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 + class Local3dPointUncertaintyEllipsoid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py index 0b89a0dc..a301c3ac 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.geographic_area import GeographicArea -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.geographic_area import GeographicArea # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 + class LocalOrigin(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/o_auth_grant_type.py index 420b4513..eabc37f6 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/o_auth_grant_type.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/o_auth_grant_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class OAuthGrantType(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/operation.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/operation.py index 856dc775..b72c36a0 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/operation.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/operation.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class Operation(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py index 88b0a922..a6f38782 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.gad_shape import GADShape -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class Point(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py index ff5cab9e..72156c95 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.gad_shape import GADShape -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class PointAltitude(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude_uncertainty.py index fdcea5e2..63f0459a 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude_uncertainty.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.gad_shape import GADShape -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes -from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class PointAltitudeUncertainty(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_circle.py index 80faac43..7a7e2cd8 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_circle.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.gad_shape import GADShape -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class PointUncertaintyCircle(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_ellipse.py index 03c55bf7..df271216 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_ellipse.py @@ -1,19 +1,14 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.gad_shape import GADShape -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes -from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + class PointUncertaintyEllipse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py index 3af36a1e..c4e0ed43 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.gad_shape import GADShape -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + class Polygon(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/problem_details.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/problem_details.py index 096c04eb..d095ab5a 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/problem_details.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/problem_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.invalid_param import InvalidParam -import re from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.invalid_param import InvalidParam # noqa: E501 -import re # noqa: E501 + class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/protocol.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/protocol.py index fe4b2bf3..59c0a37d 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/protocol.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/protocol.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class Protocol(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/relative_cartesian_location.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/relative_cartesian_location.py index 592f4bc6..b71e9ce1 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/relative_cartesian_location.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/relative_cartesian_location.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class RelativeCartesianLocation(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py index c6540878..ee34d66f 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.communication_type import CommunicationType -from capif_routing_info.models.custom_operation import CustomOperation -from capif_routing_info.models.operation import Operation from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.communication_type import CommunicationType # noqa: E501 from capif_routing_info.models.custom_operation import CustomOperation # noqa: E501 from capif_routing_info.models.operation import Operation # noqa: E501 + class Resource(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_info.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_info.py index 8d086045..9615bb65 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_info.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_info.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.routing_rule import RoutingRule from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.routing_rule import RoutingRule # noqa: E501 + class RoutingInfo(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py index 88cb2c7a..f5072e73 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.aef_profile import AefProfile -from capif_routing_info.models.ipv4_address_range import Ipv4AddressRange -from capif_routing_info.models.ipv6_address_range import Ipv6AddressRange from capif_routing_info import util - from capif_routing_info.models.aef_profile import AefProfile # noqa: E501 +from capif_routing_info.models.base_model import Model from capif_routing_info.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 from capif_routing_info.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 + class RoutingRule(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/security_method.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/security_method.py index 0ef293df..948a0e08 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/security_method.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/security_method.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/service_kpis.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/service_kpis.py index 869dc5a3..b06404f7 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/service_kpis.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/service_kpis.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -import re from capif_routing_info import util +from capif_routing_info.models.base_model import Model -import re # noqa: E501 class ServiceKpis(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/supported_gad_shapes.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/supported_gad_shapes.py index e238c97b..ef3f27ba 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/supported_gad_shapes.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/supported_gad_shapes.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class SupportedGADShapes(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipse.py index 27a6acd1..00d8acb9 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipse.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class UncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipsoid.py index 45538ba7..c1307ee3 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/uncertainty_ellipsoid.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model from capif_routing_info import util +from capif_routing_info.models.base_model import Model class UncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py index 1be123dc..990be9ce 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_routing_info.models.base_model import Model -from capif_routing_info.models.custom_operation import CustomOperation -from capif_routing_info.models.resource import Resource from capif_routing_info import util - +from capif_routing_info.models.base_model import Model from capif_routing_info.models.custom_operation import CustomOperation # noqa: E501 from capif_routing_info.models.resource import Resource # noqa: E501 + class Version(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/__init__.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/__init__.py index e95f59cf..fe016ad6 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/__init__.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/__init__.py @@ -1,9 +1,8 @@ import logging import connexion -from flask_testing import TestCase - from capif_routing_info.encoder import JSONEncoder +from flask_testing import TestCase class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py index 7241b494..cf2e7c38 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py @@ -1,7 +1,5 @@ import unittest -from flask import json - from capif_routing_info.models.problem_details import ProblemDetails # noqa: E501 from capif_routing_info.models.routing_info import RoutingInfo # noqa: E501 from capif_routing_info.test import BaseTestCase diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/util.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/util.py index 6f369d51..fc17a1ca 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/util.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/util.py @@ -1,6 +1,5 @@ import datetime -import typing from capif_routing_info import typing_utils diff --git a/services/TS29222_CAPIF_Routing_Info_API/setup.py b/services/TS29222_CAPIF_Routing_Info_API/setup.py index f3e2e6ad..327037e0 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/setup.py +++ b/services/TS29222_CAPIF_Routing_Info_API/setup.py @@ -1,5 +1,5 @@ -import sys -from setuptools import setup, find_packages + +from setuptools import find_packages, setup NAME = "capif_routing_info" VERSION = "1.0.0" diff --git a/services/TS29222_CAPIF_Security_API/capif_security/app.py b/services/TS29222_CAPIF_Security_API/capif_security/app.py index c61896ee..f4f39fde 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/app.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/app.py @@ -6,6 +6,9 @@ from datetime import datetime from logging.handlers import RotatingFileHandler import connexion +import encoder +from config import Config +from core.consumer_messager import Subscriber from flask_apscheduler import APScheduler from flask_executor import Executor from flask_jwt_extended import JWTManager @@ -19,10 +22,6 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator -import encoder -from config import Config -from core.consumer_messager import Subscriber - NAME = "Security-Service" # Setting log level @@ -36,7 +35,7 @@ def configure_monitoring(app, config): fluent_bit_host = config['monitoring']['fluent_bit_host'] fluent_bit_port = config['monitoring']['fluent_bit_port'] fluent_bit_sender = sender.FluentSender('Security-Service', host=fluent_bit_host, port=fluent_bit_port) - propagator = TraceContextTextMapPropagator() + TraceContextTextMapPropagator() tracer_provider = TracerProvider(resource=resource) trace.set_tracer_provider(tracer_provider) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py b/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py index 8f371687..385d3cfd 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py @@ -5,7 +5,7 @@ from capif_security.models.security_notification import SecurityNotification # from capif_security.models.service_security import ServiceSecurity # noqa: E501 from cryptography import x509 from cryptography.hazmat.backends import default_backend -from flask import request, current_app +from flask import current_app, request from ..core.publisher import Publisher from ..core.redis_internal_event import RedisInternalEvent diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/redis_event.py b/services/TS29222_CAPIF_Security_API/capif_security/core/redis_event.py index c65a6a20..8dccdf3d 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/redis_event.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/redis_event.py @@ -1,7 +1,7 @@ import json -from .publisher import Publisher from ..encoder import CustomJSONEncoder +from .publisher import Publisher publisher_ops = Publisher() diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/redis_internal_event.py b/services/TS29222_CAPIF_Security_API/capif_security/core/redis_internal_event.py index 50e34342..c1ad0973 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/redis_internal_event.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/redis_internal_event.py @@ -1,7 +1,7 @@ import json -from .publisher import Publisher from ..encoder import JSONEncoder +from .publisher import Publisher publisher_ops = Publisher() diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py index e0a9041b..2cbc3e77 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py @@ -9,14 +9,14 @@ from flask import current_app from flask_jwt_extended import create_access_token from pymongo import ReturnDocument -from .redis_event import RedisEvent -from .resources import Resource -from .responses import not_found_error, make_response, bad_request_error, internal_server_error, forbidden_error from ..core.publisher import Publisher from ..models.access_token_claims import AccessTokenClaims from ..models.access_token_err import AccessTokenErr from ..models.access_token_rsp import AccessTokenRsp -from ..util import dict_to_camel_case, clean_empty, serialize_clean_camel_case +from ..util import clean_empty, dict_to_camel_case, serialize_clean_camel_case +from .redis_event import RedisEvent +from .resources import Resource +from .responses import bad_request_error, forbidden_error, internal_server_error, make_response, not_found_error publish_ops = Publisher() diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/validate_user.py b/services/TS29222_CAPIF_Security_API/capif_security/core/validate_user.py index c3f70049..29180d1a 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/validate_user.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/validate_user.py @@ -1,11 +1,11 @@ import json -from flask import current_app, Response +from flask import Response, current_app -from .resources import Resource -from .responses import internal_server_error, serialize_clean_camel_case from ..encoder import CustomJSONEncoder from ..models.problem_details import ProblemDetails +from .resources import Resource +from .responses import internal_server_error, serialize_clean_camel_case class ControlAccess(Resource): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/__init__.py b/services/TS29222_CAPIF_Security_API/capif_security/models/__init__.py index f4510143..d036df69 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/__init__.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/__init__.py @@ -1,30 +1,2 @@ # flake8: noqa # import models into model package -from capif_security.models.access_token_claims import AccessTokenClaims -from capif_security.models.access_token_err import AccessTokenErr -from capif_security.models.access_token_err1 import AccessTokenErr1 -from capif_security.models.access_token_req1 import AccessTokenReq1 -from capif_security.models.access_token_rsp import AccessTokenRsp -from capif_security.models.cause import Cause -from capif_security.models.interface_description import InterfaceDescription -from capif_security.models.invalid_param import InvalidParam -from capif_security.models.invalid_param1 import InvalidParam1 -from capif_security.models.ml_model_inter_ind import MlModelInterInd -from capif_security.models.nf_type import NFType -from capif_security.models.no_profile_match_info import NoProfileMatchInfo -from capif_security.models.no_profile_match_reason import NoProfileMatchReason -from capif_security.models.nwdaf_event import NwdafEvent -from capif_security.models.o_auth_grant_type import OAuthGrantType -from capif_security.models.plmn_id import PlmnId -from capif_security.models.plmn_id_nid import PlmnIdNid -from capif_security.models.problem_details import ProblemDetails -from capif_security.models.problem_details1 import ProblemDetails1 -from capif_security.models.query_param_combination import QueryParamCombination -from capif_security.models.query_parameter import QueryParameter -from capif_security.models.res_owner_id import ResOwnerId -from capif_security.models.security_information import SecurityInformation -from capif_security.models.security_method import SecurityMethod -from capif_security.models.security_notification import SecurityNotification -from capif_security.models.service_security import ServiceSecurity -from capif_security.models.snssai import Snssai -from capif_security.models.websock_notif_config import WebsockNotifConfig diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_claims.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_claims.py index 46593ae6..61a482b6 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_claims.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_claims.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.res_owner_id import ResOwnerId from capif_security import util - +from capif_security.models.base_model import Model from capif_security.models.res_owner_id import ResOwnerId # noqa: E501 + class AccessTokenClaims(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err.py index c6002302..3e7629b5 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class AccessTokenErr(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err1.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err1.py index 23007798..efd3e8f4 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err1.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_err1.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class AccessTokenErr1(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py index d82703e3..0530651a 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py @@ -1,24 +1,16 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.ml_model_inter_ind import MlModelInterInd -from capif_security.models.nf_type import NFType -from capif_security.models.nwdaf_event import NwdafEvent -from capif_security.models.plmn_id import PlmnId -from capif_security.models.plmn_id_nid import PlmnIdNid -from capif_security.models.snssai import Snssai -import re from capif_security import util - +from capif_security.models.base_model import Model from capif_security.models.ml_model_inter_ind import MlModelInterInd # noqa: E501 from capif_security.models.nf_type import NFType # noqa: E501 from capif_security.models.nwdaf_event import NwdafEvent # noqa: E501 from capif_security.models.plmn_id import PlmnId # noqa: E501 from capif_security.models.plmn_id_nid import PlmnIdNid # noqa: E501 from capif_security.models.snssai import Snssai # noqa: E501 -import re # noqa: E501 + class AccessTokenReq1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_rsp.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_rsp.py index f8e524db..477f3a63 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_rsp.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_rsp.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class AccessTokenRsp(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/base_model.py b/services/TS29222_CAPIF_Security_API/capif_security/models/base_model.py index 4bf93155..32a1219f 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/base_model.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/base_model.py @@ -1,5 +1,4 @@ import pprint - import typing from capif_security import util diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/cause.py b/services/TS29222_CAPIF_Security_API/capif_security/models/cause.py index 227ba107..b4fbd86e 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/cause.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/cause.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class Cause(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py b/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py index ade7fc69..b414ef8b 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py @@ -1,16 +1,12 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.o_auth_grant_type import OAuthGrantType -from capif_security.models.security_method import SecurityMethod -import re from capif_security import util - +from capif_security.models.base_model import Model from capif_security.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from capif_security.models.security_method import SecurityMethod # noqa: E501 -import re # noqa: E501 + class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param.py b/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param.py index f86b2086..57a65695 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class InvalidParam(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param1.py b/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param1.py index 77919000..e7abd4e9 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param1.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/invalid_param1.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class InvalidParam1(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/ml_model_inter_ind.py b/services/TS29222_CAPIF_Security_API/capif_security/models/ml_model_inter_ind.py index 3e87273d..c1ab27a7 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/ml_model_inter_ind.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/ml_model_inter_ind.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.nwdaf_event import NwdafEvent from capif_security import util - +from capif_security.models.base_model import Model from capif_security.models.nwdaf_event import NwdafEvent # noqa: E501 + class MlModelInterInd(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/nf_type.py b/services/TS29222_CAPIF_Security_API/capif_security/models/nf_type.py index 184a7c0d..017f0384 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/nf_type.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/nf_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class NFType(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py b/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py index 4d8885b5..c7b85407 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py @@ -1,15 +1,12 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.no_profile_match_reason import NoProfileMatchReason -from capif_security.models.query_param_combination import QueryParamCombination from capif_security import util - +from capif_security.models.base_model import Model from capif_security.models.no_profile_match_reason import NoProfileMatchReason # noqa: E501 from capif_security.models.query_param_combination import QueryParamCombination # noqa: E501 + class NoProfileMatchInfo(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_reason.py b/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_reason.py index ccec0b37..5fe37d57 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_reason.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_reason.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class NoProfileMatchReason(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/nwdaf_event.py b/services/TS29222_CAPIF_Security_API/capif_security/models/nwdaf_event.py index f07de0c3..d1701a39 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/nwdaf_event.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/nwdaf_event.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class NwdafEvent(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/o_auth_grant_type.py b/services/TS29222_CAPIF_Security_API/capif_security/models/o_auth_grant_type.py index 8bace2b9..3813c056 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/o_auth_grant_type.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/o_auth_grant_type.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class OAuthGrantType(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id.py b/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id.py index 74dd8bf0..c86104bb 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -import re from capif_security import util +from capif_security.models.base_model import Model -import re # noqa: E501 class PlmnId(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id_nid.py b/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id_nid.py index 02bfde85..9e414876 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id_nid.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/plmn_id_nid.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -import re from capif_security import util +from capif_security.models.base_model import Model -import re # noqa: E501 class PlmnIdNid(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details.py b/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details.py index f24710e4..47dd078a 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details.py @@ -1,14 +1,11 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.invalid_param import InvalidParam -import re from capif_security import util - +from capif_security.models.base_model import Model from capif_security.models.invalid_param import InvalidParam # noqa: E501 -import re # noqa: E501 + class ProblemDetails(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py b/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py index 27b782fc..e0fbf4c1 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py @@ -1,20 +1,14 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.access_token_err1 import AccessTokenErr1 -from capif_security.models.access_token_req1 import AccessTokenReq1 -from capif_security.models.invalid_param1 import InvalidParam1 -from capif_security.models.no_profile_match_info import NoProfileMatchInfo -import re from capif_security import util - from capif_security.models.access_token_err1 import AccessTokenErr1 # noqa: E501 from capif_security.models.access_token_req1 import AccessTokenReq1 # noqa: E501 +from capif_security.models.base_model import Model from capif_security.models.invalid_param1 import InvalidParam1 # noqa: E501 from capif_security.models.no_profile_match_info import NoProfileMatchInfo # noqa: E501 -import re # noqa: E501 + class ProblemDetails1(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/query_param_combination.py b/services/TS29222_CAPIF_Security_API/capif_security/models/query_param_combination.py index a28fb4ad..430eab7c 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/query_param_combination.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/query_param_combination.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.query_parameter import QueryParameter from capif_security import util - +from capif_security.models.base_model import Model from capif_security.models.query_parameter import QueryParameter # noqa: E501 + class QueryParamCombination(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/query_parameter.py b/services/TS29222_CAPIF_Security_API/capif_security/models/query_parameter.py index 183bb325..39302f5b 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/query_parameter.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/query_parameter.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class QueryParameter(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/res_owner_id.py b/services/TS29222_CAPIF_Security_API/capif_security/models/res_owner_id.py index 0229dd1f..7ad71592 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/res_owner_id.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/res_owner_id.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -import re from capif_security import util +from capif_security.models.base_model import Model -import re # noqa: E501 class ResOwnerId(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py b/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py index 10e85193..ab650a4a 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py @@ -1,17 +1,13 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.interface_description import InterfaceDescription -from capif_security.models.o_auth_grant_type import OAuthGrantType -from capif_security.models.security_method import SecurityMethod from capif_security import util - +from capif_security.models.base_model import Model from capif_security.models.interface_description import InterfaceDescription # noqa: E501 from capif_security.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from capif_security.models.security_method import SecurityMethod # noqa: E501 + class SecurityInformation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/security_method.py b/services/TS29222_CAPIF_Security_API/capif_security/models/security_method.py index c319a38a..c3deabe5 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/security_method.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/security_method.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class SecurityMethod(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py b/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py index 538c655f..fbf39b6d 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py @@ -1,13 +1,11 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.cause import Cause from capif_security import util - +from capif_security.models.base_model import Model from capif_security.models.cause import Cause # noqa: E501 + class SecurityNotification(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py b/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py index c0bae73e..10d26438 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py @@ -1,16 +1,12 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -from capif_security.models.security_information import SecurityInformation -from capif_security.models.websock_notif_config import WebsockNotifConfig -import re from capif_security import util - +from capif_security.models.base_model import Model from capif_security.models.security_information import SecurityInformation # noqa: E501 from capif_security.models.websock_notif_config import WebsockNotifConfig # noqa: E501 -import re # noqa: E501 + class ServiceSecurity(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/snssai.py b/services/TS29222_CAPIF_Security_API/capif_security/models/snssai.py index 1d00dd90..90cde98e 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/snssai.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/snssai.py @@ -1,12 +1,10 @@ +import re # noqa: E501 from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model -import re from capif_security import util +from capif_security.models.base_model import Model -import re # noqa: E501 class Snssai(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/websock_notif_config.py b/services/TS29222_CAPIF_Security_API/capif_security/models/websock_notif_config.py index 1482ee7d..13109aa1 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/websock_notif_config.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/websock_notif_config.py @@ -1,9 +1,8 @@ from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 -from typing import List, Dict # noqa: F401 - -from capif_security.models.base_model import Model from capif_security import util +from capif_security.models.base_model import Model class WebsockNotifConfig(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/test/__init__.py b/services/TS29222_CAPIF_Security_API/capif_security/test/__init__.py index d3c5dca1..aa37efef 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/test/__init__.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/test/__init__.py @@ -1,9 +1,8 @@ import logging import connexion -from flask_testing import TestCase - from capif_security.encoder import JSONEncoder +from flask_testing import TestCase class BaseTestCase(TestCase): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py b/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py index f89c1c51..da26a6d6 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py @@ -1,7 +1,5 @@ import unittest -from flask import json - from capif_security.models.access_token_err import AccessTokenErr # noqa: E501 from capif_security.models.access_token_rsp import AccessTokenRsp # noqa: E501 from capif_security.models.problem_details import ProblemDetails # noqa: E501 @@ -9,6 +7,7 @@ from capif_security.models.res_owner_id import ResOwnerId # noqa: E501 from capif_security.models.security_notification import SecurityNotification # noqa: E501 from capif_security.models.service_security import ServiceSecurity # noqa: E501 from capif_security.test import BaseTestCase +from flask import json class TestDefaultController(BaseTestCase): diff --git a/services/TS29222_CAPIF_Security_API/setup.py b/services/TS29222_CAPIF_Security_API/setup.py index 9653f405..f291508a 100644 --- a/services/TS29222_CAPIF_Security_API/setup.py +++ b/services/TS29222_CAPIF_Security_API/setup.py @@ -1,5 +1,5 @@ -import sys -from setuptools import setup, find_packages + +from setuptools import find_packages, setup NAME = "capif_security" VERSION = "1.0.0" diff --git a/services/helper/helper_service/app.py b/services/helper/helper_service/app.py index 6dd56d8c..f43ab73b 100644 --- a/services/helper/helper_service/app.py +++ b/services/helper/helper_service/app.py @@ -2,14 +2,12 @@ import json import logging import os -from db.db import MongoDatabse - import requests -from OpenSSL.crypto import PKey, TYPE_RSA, X509Req, dump_certificate_request, FILETYPE_PEM, dump_privatekey -from flask import Flask - from config import Config from controllers.helper_controller import helper_routes +from db.db import MongoDatabse +from flask import Flask +from OpenSSL.crypto import FILETYPE_PEM, TYPE_RSA, PKey, X509Req, dump_certificate_request, dump_privatekey app = Flask(__name__) config = Config().get_config() diff --git a/services/helper/helper_service/controllers/helper_controller.py b/services/helper/helper_service/controllers/helper_controller.py index 5a8eba34..19b11160 100644 --- a/services/helper/helper_service/controllers/helper_controller.py +++ b/services/helper/helper_service/controllers/helper_controller.py @@ -2,7 +2,7 @@ from config import Config from core.helper_operations import HelperOperations -from flask import Blueprint, request, current_app, jsonify +from flask import Blueprint, current_app, jsonify, request config = Config().get_config() diff --git a/services/helper/helper_service/core/helper_operations.py b/services/helper/helper_service/core/helper_operations.py index 77384cda..f0c1f6d3 100644 --- a/services/helper/helper_service/core/helper_operations.py +++ b/services/helper/helper_service/core/helper_operations.py @@ -4,8 +4,15 @@ import pymongo import requests from config import Config from db.db import MongoDatabse -from flask import jsonify, current_app -from utils.utils import to_snake_case, convert_dict_keys_to_snake_case, validate_snake_case_keys, get_nested_value, convert_value_to_original_type, convert_nested_values +from flask import current_app, jsonify +from utils.utils import ( + convert_dict_keys_to_snake_case, + convert_nested_values, + convert_value_to_original_type, + get_nested_value, + to_snake_case, + validate_snake_case_keys +) class HelperOperations: diff --git a/services/helper/helper_service/utils/utils.py b/services/helper/helper_service/utils/utils.py index a5349309..fce57a34 100644 --- a/services/helper/helper_service/utils/utils.py +++ b/services/helper/helper_service/utils/utils.py @@ -1,6 +1,8 @@ import re + from flask import jsonify + def to_snake_case(text): """ Convert string to snake case. diff --git a/services/register/register_service/app.py b/services/register/register_service/app.py index 8a03c2df..378bf88c 100644 --- a/services/register/register_service/app.py +++ b/services/register/register_service/app.py @@ -4,13 +4,12 @@ import logging import os import requests -from OpenSSL.crypto import PKey, TYPE_RSA, X509Req, dump_certificate_request, FILETYPE_PEM, dump_privatekey -from flask import Flask -from flask_jwt_extended import JWTManager - from config import Config from controllers.register_controller import register_routes from db.db import MongoDatabse +from flask import Flask +from flask_jwt_extended import JWTManager +from OpenSSL.crypto import FILETYPE_PEM, TYPE_RSA, PKey, X509Req, dump_certificate_request, dump_privatekey app = Flask(__name__) diff --git a/services/register/register_service/controllers/register_controller.py b/services/register/register_service/controllers/register_controller.py index 85777ed3..93d7fafd 100644 --- a/services/register/register_service/controllers/register_controller.py +++ b/services/register/register_service/controllers/register_controller.py @@ -7,7 +7,7 @@ import jwt from config import Config from core.register_operations import RegisterOperations from db.db import MongoDatabse -from flask import current_app, jsonify, request, Blueprint +from flask import Blueprint, current_app, jsonify, request from flask_httpauth import HTTPBasicAuth auth = HTTPBasicAuth() diff --git a/services/register/register_service/core/register_operations.py b/services/register/register_service/core/register_operations.py index 452a8c0d..844ce951 100644 --- a/services/register/register_service/core/register_operations.py +++ b/services/register/register_service/core/register_operations.py @@ -5,9 +5,9 @@ from datetime import datetime import requests from config import Config from db.db import MongoDatabse -from flask import jsonify, current_app +from flask import current_app, jsonify from flask_jwt_extended import create_access_token -from utils.utils import to_snake_case, convert_dict_keys_to_snake_case, validate_snake_case_keys +from utils.utils import convert_dict_keys_to_snake_case, to_snake_case, validate_snake_case_keys class RegisterOperations: diff --git a/services/register/register_service/utils/utils.py b/services/register/register_service/utils/utils.py index 067bf1f1..4b38761f 100644 --- a/services/register/register_service/utils/utils.py +++ b/services/register/register_service/utils/utils.py @@ -1,6 +1,8 @@ import re + from flask import jsonify + def to_snake_case(text): """ Convert string to snake case. -- GitLab From 4e40066c0919be3d6bac0b059c730c3d42cf4054 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 9 Apr 2025 16:59:26 +0200 Subject: [PATCH 104/157] Update data types on tests according to changes on v18.7.0 --- .../api_publish_service/bodyRequests.py | 19 ++++++- tests/libraries/common/types.json | 52 ++++++++++++++++--- 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/tests/libraries/api_publish_service/bodyRequests.py b/tests/libraries/api_publish_service/bodyRequests.py index a86ce024..046e8e18 100644 --- a/tests/libraries/api_publish_service/bodyRequests.py +++ b/tests/libraries/api_publish_service/bodyRequests.py @@ -113,6 +113,20 @@ def create_aef_profile(aef_id, security_method=None, domain_name=None, interface_descriptions=None): + # "mandatory_attributes": { + # "aefId": "string", + # "versions": "Version" + # }, + # "optional_attributes": { + # "protocol": "Protocol", + # "dataFormat": "DataFormat", + # "securityMethods": "SecurityMethod", + # "grantTypes": "OAuthGrantType", + # "domainName": "string", + # "interfaceDescriptions": "InterfaceDescription", + # "aefLocation": "AefLocation", + # "serviceKpis": "ServiceKpis", + # "ueIpRange": "IpAddrRange" data = { "aefId": aef_id, "versions": [ @@ -248,7 +262,8 @@ def create_interface_description(ipv4_addr=None, fqdn=None, port=None, api_prefix=None, - security_methods=None): + security_methods=None, + grant_types=None): """ Create an interface description with the given parameters. """ @@ -270,5 +285,7 @@ def create_interface_description(ipv4_addr=None, data['apiPrefix'] = api_prefix if security_methods is not None: data['securityMethods'] = security_methods + if grant_types is not None: + data['grantTypes'] = grant_types # Return the interface description return data diff --git a/tests/libraries/common/types.json b/tests/libraries/common/types.json index 5d67162c..076d833f 100644 --- a/tests/libraries/common/types.json +++ b/tests/libraries/common/types.json @@ -75,6 +75,7 @@ }, "optional_attributes": { "apiId": "string", + "apiStatus": "ApiStatus", "aefProfiles": "AefProfile", "description": "string", "supportedFeatures": "SupportedFeatures", @@ -83,7 +84,7 @@ "apiSuppFeats": "SupportedFeatures", "pubApiPath": "PublishedApiPath", "ccfId": "string", - "apiStatus": "ApiStatus" + "apiProvName": "string" }, "regex_attributes": { "^vendorSpecific-(.*)": "VendorSpecificObject" @@ -120,15 +121,45 @@ "protocol": "Protocol", "dataFormat": "DataFormat", "securityMethods": "SecurityMethod", + "grantTypes": "OAuthGrantType", "domainName": "string", "interfaceDescriptions": "InterfaceDescription", - "aefLocation": "AefLocation" + "aefLocation": "AefLocation", + "serviceKpis": "ServiceKpis", + "ueIpRange": "IpAddrRange" }, "regex_attributes": { "^vendorSpecific-(.*)": "VendorSpecificObject" }, "oneOf": ["interfaceDescriptions", "domainName"] }, + "ServiceKpis": { + "mandatory_attributes": {}, + "optional_attributes": { + "maxReqRate": "integer", + "maxRestime": "integer", + "availability": "integer", + "avalComp": "Flops", + "avalGraComp": "Flops", + "avalMem": "Memory", + "avalStor": "Memory", + "conBand": "integer" + } + }, + "Flops": { + "regex": "^[0-9]+(\\.[0-9]+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$" + }, + "Memory": { + "regex": "^[0-9]+(\\.[0-9]+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$" + }, + "IpAddrRange": { + "mandatory_attributes": {}, + "optional_attributes": { + "ueIpv4AddrRanges": "Ipv4AddressRange", + "ueIpv6AddrRanges": "Ipv6AddressRange" + }, + "oneOf": ["ueIpv4AddrRanges", "ueIpv6AddrRanges"] + }, "Version": { "mandatory_attributes": { "apiVersion": "string" @@ -181,10 +212,13 @@ "optional_attributes": { "ipv4Addr": "string", "ipv6Addr": "string", + "fqdn": "Fqdn", "port": "integer", - "securityMethods": "SecurityMethod" + "apiPrefix": "string", + "securityMethods": "SecurityMethod", + "grantTypes": "OAuthGrantType" }, - "oneOf": ["ipv4Addr", "ipv6Addr"] + "oneOf": ["ipv4Addr", "ipv6Addr", "fqdn"] }, "AefLocation": { "mandatory_attributes": {}, @@ -336,7 +370,7 @@ "mandatory_attributes": {}, "optional_attributes": { "start": "Ipv4Addr", - "stop": "Ipv4Addr" + "end": "Ipv4Addr" } }, "Ipv4Addr": { @@ -375,7 +409,8 @@ "DiscoveredAPIs": { "mandatory_attributes": {}, "optional_attributes": { - "serviceAPIDescriptions": "ServiceAPIDescription" + "serviceAPIDescriptions": "ServiceAPIDescription", + "suppFeat": "SupportedFeatures" } }, "ServiceSecurity": { @@ -576,7 +611,10 @@ } }, "GrantType": { - "enum": ["client_credentials"] + "enum": ["client_credentials","authorization_code"] + }, + "OAuthGrantType": { + "enum": ["CLIENT_CREDENTIALS", "AUTHORIZATION_CODE", "AUTHORIZATION_CODE_WITH_PKCE"] }, "TokenType": { "enum": ["Bearer"] -- GitLab From f6120f0bc4efc3f3a8c051a6f64a1619e708574f Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Fri, 11 Apr 2025 09:04:38 +0200 Subject: [PATCH 105/157] Celery in services folder --- .../capif_events/celery_app/Dockerfile | 12 - .../capif_events/core/events_apis.py | 1 + services/celery/Dockerfile | 12 + .../celery_app => celery}/__init__.py | 0 .../celery_app => celery}/config.py | 0 .../celery_app => celery}/config.yaml | 0 .../celery_app => celery}/requirements.txt | 0 .../celery_app => celery}/start_celery.sh | 0 .../celery_app => celery}/tasks.py | 17 +- services/docker-compose-capif.yml | 6 +- tests/features/Event Filter/event_req.robot | 215 ------------------ 11 files changed, 28 insertions(+), 235 deletions(-) delete mode 100644 services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile create mode 100644 services/celery/Dockerfile rename services/{TS29222_CAPIF_Events_API/capif_events/celery_app => celery}/__init__.py (100%) rename services/{TS29222_CAPIF_Events_API/capif_events/celery_app => celery}/config.py (100%) rename services/{TS29222_CAPIF_Events_API/capif_events/celery_app => celery}/config.yaml (100%) rename services/{TS29222_CAPIF_Events_API/capif_events/celery_app => celery}/requirements.txt (100%) rename services/{TS29222_CAPIF_Events_API/capif_events/celery_app => celery}/start_celery.sh (100%) rename services/{TS29222_CAPIF_Events_API/capif_events/celery_app => celery}/tasks.py (88%) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile b/services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile deleted file mode 100644 index 7d334128..00000000 --- a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM labs.etsi.org:5050/ocf/capif/python:3-slim-bullseye - -WORKDIR /celery_app - -COPY requirements.txt /celery_app/ -RUN pip install --no-cache-dir -r requirements.txt - -COPY . /celery_app - -RUN chmod +x /celery_app/start_celery.sh - -CMD ["/celery_app/start_celery.sh"] diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index fea10021..d57defba 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -60,6 +60,7 @@ class EventSubscriptionsOperations(Resource): def __check_event_req(self, event_subscription): current_app.logger.debug("Checking event requirement.") + expired_at = None if event_subscription.event_req.mon_dur: if event_subscription.event_req.mon_dur > datetime.now(timezone.utc): expired_at = event_subscription.event_req.mon_dur diff --git a/services/celery/Dockerfile b/services/celery/Dockerfile new file mode 100644 index 00000000..ffad675f --- /dev/null +++ b/services/celery/Dockerfile @@ -0,0 +1,12 @@ +FROM labs.etsi.org:5050/ocf/capif/python:3-slim-bullseye + +WORKDIR /celery + +COPY requirements.txt /celery/ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . /celery + +RUN chmod +x /celery/start_celery.sh + +CMD ["/celery/start_celery.sh"] diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/__init__.py b/services/celery/__init__.py similarity index 100% rename from services/TS29222_CAPIF_Events_API/capif_events/celery_app/__init__.py rename to services/celery/__init__.py diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.py b/services/celery/config.py similarity index 100% rename from services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.py rename to services/celery/config.py diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.yaml b/services/celery/config.yaml similarity index 100% rename from services/TS29222_CAPIF_Events_API/capif_events/celery_app/config.yaml rename to services/celery/config.yaml diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/requirements.txt b/services/celery/requirements.txt similarity index 100% rename from services/TS29222_CAPIF_Events_API/capif_events/celery_app/requirements.txt rename to services/celery/requirements.txt diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/start_celery.sh b/services/celery/start_celery.sh similarity index 100% rename from services/TS29222_CAPIF_Events_API/capif_events/celery_app/start_celery.sh rename to services/celery/start_celery.sh diff --git a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/tasks.py b/services/celery/tasks.py similarity index 88% rename from services/TS29222_CAPIF_Events_API/capif_events/celery_app/tasks.py rename to services/celery/tasks.py index 3016f12c..cdc589b5 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/celery_app/tasks.py +++ b/services/celery/tasks.py @@ -1,19 +1,24 @@ # celery/tasks.py from celery import Celery -from datetime import datetime, timedelta, timezone +from datetime import datetime, timezone import pymongo import os from bson.codec_options import CodecOptions from config import Config import aiohttp import asyncio -from dateutil import parser # Celery Configuration +# celery = Celery( +# "notifications", +# broker=os.environ.get("CELERY_BROKER_URL", "redis://redis:6379/0"), +# backend=os.environ.get("CELERY_RESULT_BACKEND", "redis://redis:6379/0") +# ) + celery = Celery( "notifications", - broker=os.environ.get("CELERY_BROKER_URL", "redis://redis:6379/0"), - backend=os.environ.get("CELERY_RESULT_BACKEND", "redis://redis:6379/0") + broker=f"redis://{os.getenv("REDIS_HOST")}:{os.getenv("REDIS_PORT")}/0", + backend=f"redis://{os.getenv("REDIS_HOST")}:{os.getenv("REDIS_PORT")}/0" ) celery.conf.beat_schedule = { @@ -103,7 +108,7 @@ async def send(url, data): @celery.task(name="celery.tasks.check_notifications_collection") def my_periodic_task(): - print("Checking notifications collection...") + # print("Checking notifications collection...") while True: try: notification_data = notifications_col.find_one_and_delete( @@ -121,4 +126,4 @@ def my_periodic_task(): except Exception as e: print(f"Error sending notification: {e}") - print("Finished processing notifications.") + # print("Finished processing notifications.") diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index e965cedb..06247465 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -177,23 +177,25 @@ services: celery_worker: build: - context: ${SERVICES_DIR}/TS29222_CAPIF_Events_API/capif_events/celery_app + context: ${SERVICES_DIR}/celery environment: - CELERY_MODE=worker - REDIS_HOST=redis - REDIS_PORT=6379 depends_on: - redis + - mongo celery_beat: build: - context: ${SERVICES_DIR}/TS29222_CAPIF_Events_API/capif_events/celery_app + context: ${SERVICES_DIR}/celery environment: - CELERY_MODE=beat - REDIS_HOST=redis - REDIS_PORT=6379 depends_on: - redis + - mongo api-invocation-logs: build: context: ${SERVICES_DIR}/TS29222_CAPIF_Logging_API_Invocation_API diff --git a/tests/features/Event Filter/event_req.robot b/tests/features/Event Filter/event_req.robot index 4530c0d2..b2d9f9dd 100644 --- a/tests/features/Event Filter/event_req.robot +++ b/tests/features/Event Filter/event_req.robot @@ -52,221 +52,6 @@ Invoker subscribe to Service API Available ${notification_events_on_mock_server}= Set Variable ${resp.json()} -Invoker subscribe to Service API Availables - [Tags] event_filter-7 mockserver smoke - - # Initialize Mock server - Init Mock Server - - # Register Providers - ## Default Provider 1 Registration - ${register_user_info_provider_1}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_1 - ${aef_id_1}= Set Variable - ... ${register_user_info_provider_1['aef_roles']['${AEF_PROVIDER_USERNAME}_1']['aef_id']} - - ## Publish service_1 API - ${service_api_description_published_1} - ... ${provider_resource_url_1} - ... ${provider_request_body_1}= - ... Publish Service Api - ... ${register_user_info_provider_1} - ... service_name=service_1 - - ## Default Provider 2 Registration - ${register_user_info_provider_2}= Provider Default Registration provider_username=${PROVIDER_USERNAME}_2 - ${aef_id_2}= Set Variable - ... ${register_user_info_provider_2['aef_roles']['${AEF_PROVIDER_USERNAME}_2']['aef_id']} - - ## Publish service_2 API - ${service_api_description_published_2} - ... ${provider_resource_url_2} - ... ${provider_request_body_2}= - ... Publish Service Api - ... ${register_user_info_provider_2} - ... service_name=service_2 - - ## Store apiId1 and apiId2 for further use - ${service_api_id_1}= Set Variable ${service_api_description_published_1['apiId']} - ${service_api_id_2}= Set Variable ${service_api_description_published_2['apiId']} - - # Register Invokers - ## Default Invoker 1 Registration and Onboarding - ${register_user_info_invoker_1} ${invoker_url_1} ${request_body_1}= Invoker Default Onboarding - ... invoker_username=${INVOKER_USERNAME}_1 - - ## Default Invoker 2 Registration and Onboarding - ${register_user_info_invoker_2} ${invoker_url_2} ${request_body_2}= Invoker Default Onboarding - ... invoke_username=${INVOKER_USERNAME}_2 - - ## Store apiInvokerIds for further use - ${api_invoker_id_1}= Set Variable ${register_user_info_invoker_1['api_invoker_id']} - ${api_invoker_id_2}= Set Variable ${register_user_info_invoker_2['api_invoker_id']} - - # Subscribe to events - ## Event lists - ${events_list}= Create List SERVICE_API_INVOCATION_SUCCESS SERVICE_API_INVOCATION_FAILURE - - ## Event filters - ${event_filter_empty}= Create Capif Event Filter - ${event_filter_api_invoker_ids}= Create Capif Event Filter apiInvokerIds=${api_invoker_id_1} - ${event_filter_api_ids}= Create Capif Event Filter apiIds=${service_api_id_1} - ${event_filter_aef_ids}= Create Capif Event Filter aefIds=${aef_id_2} - ${event_filter_api_ids_and_aef_ids}= Create Capif Event Filter - ... apiIds=${service_api_id_2} - ... aefIds=${aef_id_2} - ${event_filter_api_ids_and_api_invoker_ids}= Create Capif Event Filter - ... apiInvokerIds=${api_invoker_id_2} - ... apiIds=${service_api_id_2} - ${event_filter_aef_ids_and_api_invoker_ids}= Create Capif Event Filter - ... apiInvokerIds=${api_invoker_id_2} - ... aefIds=${aef_id_1} - ${event_filter_api_ids_aef_ids_and_api_invoker_ids}= Create Capif Event Filter - ... apiInvokerIds=${api_invoker_id_2} - ... aefIds=${aef_id_2} - ... apiIds=${service_api_id_2} - - ## Subscription to Events 1 - ${event_filters}= Create List ${event_filter_api_ids} ${event_filter_api_ids} - ${subscription_id_1}= - ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - - ## Subscription to Events 2 - ${event_filters}= Create List ${event_filter_aef_ids} ${event_filter_aef_ids} - ${subscription_id_2}= - ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - - ## Subscription to Events 3 - ${event_filters}= Create List ${event_filter_api_invoker_ids} ${event_filter_api_invoker_ids} - ${subscription_id_3}= - ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - - ## Subscription to Events 4 - ${event_filters}= Create List ${event_filter_api_ids_and_aef_ids} ${event_filter_api_ids_and_aef_ids} - ${subscription_id_4}= - ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - - ## Subscription to Events 5 - ${event_filters}= Create List - ... ${event_filter_api_ids_and_api_invoker_ids} - ... ${event_filter_api_ids_and_api_invoker_ids} - ${subscription_id_5}= - ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - - ## Subscription to Events 6 - ${event_filters}= Create List - ... ${event_filter_aef_ids_and_api_invoker_ids} - ... ${event_filter_aef_ids_and_api_invoker_ids} - ${subscription_id_6}= - ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - - ## Subscription to Events 7 - ${event_filters}= Create List - ... ${event_filter_api_ids_aef_ids_and_api_invoker_ids} - ... ${event_filter_api_ids_aef_ids_and_api_invoker_ids} - ${subscription_id_7}= - ... Subscribe provider ${register_user_info_provider_1} to events ${events_list} with event filters ${event_filters} - - # 1.Log entry for service_1 and invoker_1 - ${request_body_log_1}= Send Log Message to CAPIF - ... ${service_api_id_1} - ... service_1 - ... ${register_user_info_invoker_1} - ... ${register_user_info_provider_1} - ... 200 - ... 400 - - # 2.Log entry for service_2 and invoker_1 - ${request_body_log_2}= Send Log Message to CAPIF - ... ${service_api_id_2} - ... service_2 - ... ${register_user_info_invoker_1} - ... ${register_user_info_provider_2} - ... 200 - - # 3.Log entry for service_2 and invoker_2 - ${request_body_log_3}= Send Log Message to CAPIF - ... ${service_api_id_2} - ... service_2 - ... ${register_user_info_invoker_2} - ... ${register_user_info_provider_2} - ... 200 - - # 4.Log entry for service_1 and invoker_2 - ${request_body_log_4}= Send Log Message to CAPIF - ... ${service_api_id_1} - ... service_1 - ... ${register_user_info_invoker_2} - ... ${register_user_info_provider_1} - ... 400 - - # Check Event Notifications - ## Create check Events to ensure all notifications were received - ### Subscription 1 Checks - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_1} - ... ${request_body_log_1} - - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_1} - ... ${request_body_log_4} - ... events_expected=${events_expected} - - ### Subcription 2 Checks - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_2} - ... ${request_body_log_2} - ... events_expected=${events_expected} - - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_2} - ... ${request_body_log_3} - ... events_expected=${events_expected} - - # Subscription 3 Checks - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_3} - ... ${request_body_log_1} - ... events_expected=${events_expected} - - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_3} - ... ${request_body_log_2} - ... events_expected=${events_expected} - - # Subscription 4 Checks - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_4} - ... ${request_body_log_2} - ... events_expected=${events_expected} - - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_4} - ... ${request_body_log_3} - ... events_expected=${events_expected} - - # Subscription 5 Checks - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_5} - ... ${request_body_log_3} - ... events_expected=${events_expected} - - # Subscription 6 Checks - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_6} - ... ${request_body_log_4} - ... events_expected=${events_expected} - - # Subscription 7 Checks - ${events_expected}= Create Events From InvocationLogs - ... ${subscription_id_7} - ... ${request_body_log_3} - ... events_expected=${events_expected} - - Log List ${events_expected} - ## Check Events Expected towards received notifications at mock server - Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} - - *** Keywords *** Create Security Context between ${invoker_info} and ${provider_info} # Discover APIs by invoker -- GitLab From 986bdd88ad9f704c6d613a8331cc0ce480760e2d Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Fri, 11 Apr 2025 10:49:14 +0200 Subject: [PATCH 106/157] enums in openapi file --- .../openapi/openapi.yaml | 54 +++------- .../openapi/openapi.yaml | 8 +- .../logs/openapi/openapi.yaml | 32 ++---- .../service_apis/openapi/openapi.yaml | 51 +++------- .../capif_events/openapi/openapi.yaml | 99 +++++-------------- .../api_invocation_logs/openapi/openapi.yaml | 32 ++---- .../published_apis/openapi/openapi.yaml | 55 +++-------- .../capif_routing_info/openapi/openapi.yaml | 54 +++------- .../capif_security/openapi/openapi.yaml | 44 +++------ 9 files changed, 110 insertions(+), 319 deletions(-) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml index 43054968..79907464 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml @@ -5431,14 +5431,10 @@ components: title: Resource type: object CommunicationType: - anyOf: - - enum: + enum: - REQUEST_RESPONSE - SUBSCRIBE_NOTIFY - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a communication type of the resource or the custom operation.\ \ \nPossible values are:\n- REQUEST_RESPONSE: The communication is of the\ \ type request-response.\n- SUBSCRIBE_NOTIFY: The communication is of the\ @@ -5479,32 +5475,24 @@ components: title: CustomOperation type: object Operation: - anyOf: - - enum: + enum: - GET - POST - PUT - PATCH - DELETE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates an HTTP method. \nPossible values are:\n- GET: HTTP\ \ GET method.\n- POST: HTTP POST method.\n- PUT: HTTP PUT method.\n- PATCH:\ \ HTTP PATCH method.\n- DELETE: HTTP DELETE method.\n" title: Operation Protocol: - anyOf: - - enum: + enum: - HTTP_1_1 - HTTP_2 - MQTT - WEBSOCKET - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a protocol and protocol version used by the API. \n\ Possible values are:\n- HTTP_1_1: Indicates that the protocol is HTTP version\ \ 1.1.\n- HTTP_2: Indicates that the protocol is HTTP version 2.\n- MQTT:\ @@ -5512,30 +5500,22 @@ components: \ Indicates that the protocol is Websocket.\n" title: Protocol DataFormat: - anyOf: - - enum: + enum: - JSON - XML - PROTOBUF3 - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a data format. \nPossible values are:\n- JSON: Indicates\ \ that the data format is JSON.\n- XML: Indicates that the data format is\ \ Extensible Markup Language.\n- PROTOBUF3: Indicates that the data format\ \ is Protocol buffers version 3.\n" title: DataFormat SecurityMethod: - anyOf: - - enum: + enum: - PSK - PKI - OAUTH - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the security method. \nPossible values are:\n- PSK:\ \ Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122.\n- PKI:\ \ Security method 2 (Using PKI) as described in 3GPP TS 33.122.\n- OAUTH:\ @@ -5846,15 +5826,11 @@ components: title: expTime type: string OAuthGrantType: - anyOf: - - enum: + enum: - CLIENT_CREDENTIALS - AUTHORIZATION_CODE - AUTHORIZATION_CODE_WITH_PKCE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the supported authorization flow (e.g. client credentials\ \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ @@ -6077,8 +6053,7 @@ components: title: GADShape type: object SupportedGADShapes: - anyOf: - - enum: + enum: - POINT - POINT_UNCERTAINTY_CIRCLE - POINT_UNCERTAINTY_ELLIPSE @@ -6091,8 +6066,7 @@ components: - DISTANCE_DIRECTION - RELATIVE_2D_LOCATION_UNCERTAINTY_ELLIPSE - RELATIVE_3D_LOCATION_UNCERTAINTY_ELLIPSOID - type: string - - type: string + type: string description: Indicates supported GAD shapes. title: SupportedGADShapes PointUncertaintyCircle: diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml index 44e8f63d..85be97d0 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/openapi/openapi.yaml @@ -617,15 +617,11 @@ components: title: APIProviderEnrolmentDetailsPatch type: object ApiProviderFuncRole: - anyOf: - - enum: + enum: - AEF - APF - AMF - type: string - - description: | - This string provides forward-compatiblity with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the role (e.g. AEF, APF, etc.) of an API provider domain\ \ function. \nPossible values are:\n- AEF: API provider function is API Exposing\ \ Function.\n- APF: API provider function is API Publishing Function.\n- AMF:\ diff --git a/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml b/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml index 298ad8a4..8fb314ae 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml @@ -323,16 +323,12 @@ components: title: DateTime type: string Protocol: - anyOf: - - enum: + enum: - HTTP_1_1 - HTTP_2 - MQTT - WEBSOCKET - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a protocol and protocol version used by the API. \n\ Possible values are:\n- HTTP_1_1: Indicates that the protocol is HTTP version\ \ 1.1.\n- HTTP_2: Indicates that the protocol is HTTP version 2.\n- MQTT:\ @@ -340,17 +336,13 @@ components: \ Indicates that the protocol is Websocket.\n" title: Protocol Operation: - anyOf: - - enum: + enum: - GET - POST - PUT - PATCH - DELETE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates an HTTP method. \nPossible values are:\n- GET: HTTP\ \ GET method.\n- POST: HTTP POST method.\n- PUT: HTTP PUT method.\n- PATCH:\ \ HTTP PATCH method.\n- DELETE: HTTP DELETE method.\n" @@ -421,15 +413,11 @@ components: title: InterfaceDescription type: object SecurityMethod: - anyOf: - - enum: + enum: - PSK - PKI - OAUTH - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the security method. \nPossible values are:\n- PSK:\ \ Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122.\n- PKI:\ \ Security method 2 (Using PKI) as described in 3GPP TS 33.122.\n- OAUTH:\ @@ -755,15 +743,11 @@ components: title: Port type: integer OAuthGrantType: - anyOf: - - enum: + enum: - CLIENT_CREDENTIALS - AUTHORIZATION_CODE - AUTHORIZATION_CODE_WITH_PKCE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the supported authorization flow (e.g. client credentials\ \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml b/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml index 68dd3e4e..bcdeb091 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml @@ -1240,14 +1240,9 @@ components: type: object CommunicationType: type: string - anyOf: - - enum: + enum: - REQUEST_RESPONSE - SUBSCRIBE_NOTIFY - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string description: "Indicates a communication type of the resource or the custom operation.\ \ \nPossible values are:\n- REQUEST_RESPONSE: The communication is of the\ \ type request-response.\n- SUBSCRIBE_NOTIFY: The communication is of the\ @@ -1255,16 +1250,11 @@ components: title: CommunicationType Protocol: type: string - anyOf: - - enum: + enum: - HTTP_1_1 - HTTP_2 - MQTT - WEBSOCKET - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string description: "Indicates a protocol and protocol version used by the API. \n\ Possible values are:\n- HTTP_1_1: Indicates that the protocol is HTTP version\ \ 1.1.\n- HTTP_2: Indicates that the protocol is HTTP version 2.\n- MQTT:\ @@ -1273,15 +1263,10 @@ components: title: Protocol DataFormat: type: string - anyOf: - - enum: + enum: - JSON - XML - PROTOBUF3 - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string description: "Indicates a data format. \nPossible values are:\n- JSON: Indicates\ \ that the data format is JSON.\n- XML: Indicates that the data format is\ \ Extensible Markup Language.\n- PROTOBUF3: Indicates that the data format\ @@ -1413,15 +1398,11 @@ components: title: ServiceKpis type: object OAuthGrantType: - anyOf: - - enum: + enum: - CLIENT_CREDENTIALS - AUTHORIZATION_CODE - AUTHORIZATION_CODE_WITH_PKCE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the supported authorization flow (e.g. client credentials\ \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ @@ -2484,31 +2465,23 @@ components: title: CustomOperation type: object Operation: - anyOf: - - enum: + enum: - GET - POST - PUT - PATCH - DELETE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates an HTTP method. \nPossible values are:\n- GET: HTTP\ \ GET method.\n- POST: HTTP POST method.\n- PUT: HTTP PUT method.\n- PATCH:\ \ HTTP PATCH method.\n- DELETE: HTTP DELETE method.\n" title: Operation SecurityMethod: - anyOf: - - enum: + enum: - PSK - PKI - OAUTH - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the security method. \nPossible values are:\n- PSK:\ \ Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122.\n- PKI:\ \ Security method 2 (Using PKI) as described in 3GPP TS 33.122.\n- OAUTH:\ @@ -2858,8 +2831,7 @@ components: title: GADShape type: object SupportedGADShapes: - anyOf: - - enum: + enum: - POINT - POINT_UNCERTAINTY_CIRCLE - POINT_UNCERTAINTY_ELLIPSE @@ -2872,8 +2844,7 @@ components: - DISTANCE_DIRECTION - RELATIVE_2D_LOCATION_UNCERTAINTY_ELLIPSE - RELATIVE_3D_LOCATION_UNCERTAINTY_ELLIPSOID - type: string - - type: string + type: string description: Indicates supported GAD shapes. title: SupportedGADShapes PointUncertaintyCircle: diff --git a/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml b/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml index cc8ed018..cdf36c36 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml @@ -4322,8 +4322,7 @@ components: title: EventSubscriptionPatch type: object CAPIFEvent: - anyOf: - - enum: + enum: - SERVICE_API_AVAILABLE - SERVICE_API_UNAVAILABLE - SERVICE_API_UPDATE @@ -4337,10 +4336,7 @@ components: - API_INVOKER_UPDATED - API_TOPOLOGY_HIDING_CREATED - API_TOPOLOGY_HIDING_REVOKED - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Describes the CAPIF event. \nPossible values are:\n- SERVICE_API_AVAILABLE:\n\ \ Events related to the availability of service APIs after the service APIs\ \ are\n published.\n- SERVICE_API_UNAVAILABLE:\n Events related to the unavailability\ @@ -5481,14 +5477,10 @@ components: title: Resource type: object CommunicationType: - anyOf: - - enum: + enum: - REQUEST_RESPONSE - SUBSCRIBE_NOTIFY - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a communication type of the resource or the custom operation.\ \ \nPossible values are:\n- REQUEST_RESPONSE: The communication is of the\ \ type request-response.\n- SUBSCRIBE_NOTIFY: The communication is of the\ @@ -5529,32 +5521,24 @@ components: title: CustomOperation type: object Operation: - anyOf: - - enum: + enum: - GET - POST - PUT - PATCH - DELETE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates an HTTP method. \nPossible values are:\n- GET: HTTP\ \ GET method.\n- POST: HTTP POST method.\n- PUT: HTTP PUT method.\n- PATCH:\ \ HTTP PATCH method.\n- DELETE: HTTP DELETE method.\n" title: Operation Protocol: - anyOf: - - enum: + enum: - HTTP_1_1 - HTTP_2 - MQTT - WEBSOCKET - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a protocol and protocol version used by the API. \n\ Possible values are:\n- HTTP_1_1: Indicates that the protocol is HTTP version\ \ 1.1.\n- HTTP_2: Indicates that the protocol is HTTP version 2.\n- MQTT:\ @@ -5562,30 +5546,22 @@ components: \ Indicates that the protocol is Websocket.\n" title: Protocol DataFormat: - anyOf: - - enum: + enum: - JSON - XML - PROTOBUF3 - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a data format. \nPossible values are:\n- JSON: Indicates\ \ that the data format is JSON.\n- XML: Indicates that the data format is\ \ Extensible Markup Language.\n- PROTOBUF3: Indicates that the data format\ \ is Protocol buffers version 3.\n" title: DataFormat SecurityMethod: - anyOf: - - enum: + enum: - PSK - PKI - OAUTH - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the security method. \nPossible values are:\n- PSK:\ \ Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122.\n- PKI:\ \ Security method 2 (Using PKI) as described in 3GPP TS 33.122.\n- OAUTH:\ @@ -6412,15 +6388,11 @@ components: title: Ipv6AddressRange type: object NotificationMethod: - anyOf: - - enum: + enum: - PERIODIC - ONE_TIME - ON_EVENT_DETECTION - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. - type: string + type: string description: "Represents the notification methods that can be subscribed. \n\ Possible values are:\n- PERIODIC\n- ONE_TIME\n- ON_EVENT_DETECTION\n" title: NotificationMethod @@ -6446,17 +6418,13 @@ components: title: SamplingRatio type: integer PartitioningCriteria: - anyOf: - - enum: + enum: - TAC - SUBPLMN - GEOAREA - SNSSAI - DNN - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: | Possible values are: - "TAC": Type Allocation Code @@ -6466,16 +6434,11 @@ components: - "DNN": DNN title: PartitioningCriteria NotificationFlag: - anyOf: - - enum: + enum: - ACTIVATE - DEACTIVATE - RETRIEVAL - type: string - - description: "This string provides forward-compatibility with future extensions\ - \ to the enumeration but is not used to encode content defined in the present\ - \ version of this API. \n" - type: string + type: string description: "Possible values are:\n- ACTIVATE: The event notification is activated.\n\ - DEACTIVATE: The event notification is deactivated and shall be muted. The\ \ available\n event(s) shall be stored.\n- RETRIEVAL: The event notification\ @@ -6496,24 +6459,20 @@ components: title: MutingExceptionInstructions type: object BufferedNotificationsAction: - anyOf: - - enum: + enum: - SEND_ALL - DISCARD_ALL - DROP_OLD - type: string - - type: string + type: string description: | Indicates the required action by the event producer NF on the buffered Notifications. title: BufferedNotificationsAction SubscriptionAction: - anyOf: - - enum: + enum: - CLOSE - CONTINUE_WITH_MUTING - CONTINUE_WITHOUT_MUTING - type: string - - type: string + type: string description: | Indicates the required action by the event producer NF on the event subscription if an exception occurs while the event is muted. title: SubscriptionAction @@ -6534,15 +6493,11 @@ components: title: MutingNotificationsSettings type: object OAuthGrantType: - anyOf: - - enum: + enum: - CLIENT_CREDENTIALS - AUTHORIZATION_CODE - AUTHORIZATION_CODE_WITH_PKCE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the supported authorization flow (e.g. client credentials\ \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ @@ -6770,8 +6725,7 @@ components: title: GADShape type: object SupportedGADShapes: - anyOf: - - enum: + enum: - POINT - POINT_UNCERTAINTY_CIRCLE - POINT_UNCERTAINTY_ELLIPSE @@ -6784,8 +6738,7 @@ components: - DISTANCE_DIRECTION - RELATIVE_2D_LOCATION_UNCERTAINTY_ELLIPSE - RELATIVE_3D_LOCATION_UNCERTAINTY_ELLIPSOID - type: string - - type: string + type: string description: Indicates supported GAD shapes. title: SupportedGADShapes PointUncertaintyCircle: diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml index 66babaf9..7e794c1a 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml @@ -476,16 +476,12 @@ components: title: supportedFeatures type: string Protocol: - anyOf: - - enum: + enum: - HTTP_1_1 - HTTP_2 - MQTT - WEBSOCKET - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a protocol and protocol version used by the API. \n\ Possible values are:\n- HTTP_1_1: Indicates that the protocol is HTTP version\ \ 1.1.\n- HTTP_2: Indicates that the protocol is HTTP version 2.\n- MQTT:\ @@ -493,17 +489,13 @@ components: \ Indicates that the protocol is Websocket.\n" title: Protocol Operation: - anyOf: - - enum: + enum: - GET - POST - PUT - PATCH - DELETE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates an HTTP method. \nPossible values are:\n- GET: HTTP\ \ GET method.\n- POST: HTTP POST method.\n- PUT: HTTP PUT method.\n- PATCH:\ \ HTTP PATCH method.\n- DELETE: HTTP DELETE method.\n" @@ -579,15 +571,11 @@ components: title: InterfaceDescription type: object SecurityMethod: - anyOf: - - enum: + enum: - PSK - PKI - OAUTH - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the security method. \nPossible values are:\n- PSK:\ \ Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122.\n- PKI:\ \ Security method 2 (Using PKI) as described in 3GPP TS 33.122.\n- OAUTH:\ @@ -618,15 +606,11 @@ components: title: Port type: integer OAuthGrantType: - anyOf: - - enum: + enum: - CLIENT_CREDENTIALS - AUTHORIZATION_CODE - AUTHORIZATION_CODE_WITH_PKCE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the supported authorization flow (e.g. client credentials\ \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml b/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml index 149cc4c7..6fd9b486 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml @@ -1978,16 +1978,12 @@ components: title: IpAddrRange type: object Protocol: - anyOf: - - enum: + enum: - HTTP_1_1 - HTTP_2 - MQTT - WEBSOCKET - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a protocol and protocol version used by the API. \n\ Possible values are:\n- HTTP_1_1: Indicates that the protocol is HTTP version\ \ 1.1.\n- HTTP_2: Indicates that the protocol is HTTP version 2.\n- MQTT:\ @@ -1995,61 +1991,45 @@ components: \ Indicates that the protocol is Websocket.\n" title: Protocol CommunicationType: - anyOf: - - enum: + enum: - REQUEST_RESPONSE - SUBSCRIBE_NOTIFY - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a communication type of the resource or the custom operation.\ \ \nPossible values are:\n- REQUEST_RESPONSE: The communication is of the\ \ type request-response.\n- SUBSCRIBE_NOTIFY: The communication is of the\ \ type subscribe-notify.\n" title: CommunicationType DataFormat: - anyOf: - - enum: + enum: - JSON - XML - PROTOBUF3 - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a data format. \nPossible values are:\n- JSON: Indicates\ \ that the data format is JSON.\n- XML: Indicates that the data format is\ \ Extensible Markup Language.\n- PROTOBUF3: Indicates that the data format\ \ is Protocol buffers version 3.\n" title: DataFormat SecurityMethod: - anyOf: - - enum: + enum: - PSK - PKI - OAUTH - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the security method. \nPossible values are:\n- PSK:\ \ Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122.\n- PKI:\ \ Security method 2 (Using PKI) as described in 3GPP TS 33.122.\n- OAUTH:\ \ Security method 3 (TLS with OAuth token) as described in 3GPP TS 33.122.\n" title: SecurityMethod Operation: - anyOf: - - enum: + enum: - GET - POST - PUT - PATCH - DELETE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates an HTTP method. \nPossible values are:\n- GET: HTTP\ \ GET method.\n- POST: HTTP POST method.\n- PUT: HTTP PUT method.\n- PATCH:\ \ HTTP PATCH method.\n- DELETE: HTTP DELETE method.\n" @@ -2152,15 +2132,11 @@ components: title: Port type: integer OAuthGrantType: - anyOf: - - enum: + enum: - CLIENT_CREDENTIALS - AUTHORIZATION_CODE - AUTHORIZATION_CODE_WITH_PKCE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the supported authorization flow (e.g. client credentials\ \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ @@ -2364,8 +2340,7 @@ components: title: GADShape type: object SupportedGADShapes: - anyOf: - - enum: + enum: - POINT - POINT_UNCERTAINTY_CIRCLE - POINT_UNCERTAINTY_ELLIPSE @@ -2378,8 +2353,8 @@ components: - DISTANCE_DIRECTION - RELATIVE_2D_LOCATION_UNCERTAINTY_ELLIPSE - RELATIVE_3D_LOCATION_UNCERTAINTY_ELLIPSOID - type: string - - type: string + + type: string description: Indicates supported GAD shapes. title: SupportedGADShapes PointUncertaintyCircle: diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml index 7b775ead..21846368 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml @@ -1447,14 +1447,10 @@ components: title: Resource type: object CommunicationType: - anyOf: - - enum: + enum: - REQUEST_RESPONSE - SUBSCRIBE_NOTIFY - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a communication type of the resource or the custom operation.\ \ \nPossible values are:\n- REQUEST_RESPONSE: The communication is of the\ \ type request-response.\n- SUBSCRIBE_NOTIFY: The communication is of the\ @@ -1495,32 +1491,24 @@ components: title: CustomOperation type: object Operation: - anyOf: - - enum: + enum: - GET - POST - PUT - PATCH - DELETE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates an HTTP method. \nPossible values are:\n- GET: HTTP\ \ GET method.\n- POST: HTTP POST method.\n- PUT: HTTP PUT method.\n- PATCH:\ \ HTTP PATCH method.\n- DELETE: HTTP DELETE method.\n" title: Operation Protocol: - anyOf: - - enum: + enum: - HTTP_1_1 - HTTP_2 - MQTT - WEBSOCKET - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a protocol and protocol version used by the API. \n\ Possible values are:\n- HTTP_1_1: Indicates that the protocol is HTTP version\ \ 1.1.\n- HTTP_2: Indicates that the protocol is HTTP version 2.\n- MQTT:\ @@ -1528,30 +1516,22 @@ components: \ Indicates that the protocol is Websocket.\n" title: Protocol DataFormat: - anyOf: - - enum: + enum: - JSON - XML - PROTOBUF3 - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates a data format. \nPossible values are:\n- JSON: Indicates\ \ that the data format is JSON.\n- XML: Indicates that the data format is\ \ Extensible Markup Language.\n- PROTOBUF3: Indicates that the data format\ \ is Protocol buffers version 3.\n" title: DataFormat SecurityMethod: - anyOf: - - enum: + enum: - PSK - PKI - OAUTH - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the security method. \nPossible values are:\n- PSK:\ \ Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122.\n- PKI:\ \ Security method 2 (Using PKI) as described in 3GPP TS 33.122.\n- OAUTH:\ @@ -1788,15 +1768,11 @@ components: title: Ipv4Addr type: string OAuthGrantType: - anyOf: - - enum: + enum: - CLIENT_CREDENTIALS - AUTHORIZATION_CODE - AUTHORIZATION_CODE_WITH_PKCE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the supported authorization flow (e.g. client credentials\ \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ @@ -2019,8 +1995,7 @@ components: title: GADShape type: object SupportedGADShapes: - anyOf: - - enum: + enum: - POINT - POINT_UNCERTAINTY_CIRCLE - POINT_UNCERTAINTY_ELLIPSE @@ -2033,8 +2008,7 @@ components: - DISTANCE_DIRECTION - RELATIVE_2D_LOCATION_UNCERTAINTY_ELLIPSE - RELATIVE_3D_LOCATION_UNCERTAINTY_ELLIPSOID - type: string - - type: string + type: string description: Indicates supported GAD shapes. title: SupportedGADShapes PointUncertaintyCircle: diff --git a/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml b/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml index 19377498..71929d3d 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml @@ -1100,16 +1100,12 @@ components: title: AccessTokenErr type: object Cause: - anyOf: - - enum: + enum: - OVERLIMIT_USAGE - UNEXPECTED_REASON - AUTHORIZATION_ISSUE - OTHER_REASON - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the cause for revoking the API invoker's authorization\ \ to the service API. \nPossible values are:\n- OVERLIMIT_USAGE:\n The\ \ revocation of the authorization of the API invoker is due to the overlimit\n\ @@ -1121,15 +1117,11 @@ components: \ of the API invoker is due to other reason.\n" title: Cause OAuthGrantType: - anyOf: - - enum: + enum: - CLIENT_CREDENTIALS - AUTHORIZATION_CODE - AUTHORIZATION_CODE_WITH_PKCE - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the supported authorization flow (e.g. client credentials\ \ flow, authorization code flow, etc.) to the API invoker. \nPossible\ \ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\ @@ -1383,15 +1375,11 @@ components: title: InterfaceDescription type: object SecurityMethod: - anyOf: - - enum: + enum: - PSK - PKI - OAUTH - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Indicates the security method. \nPossible values are:\n- PSK:\ \ Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122.\n- PKI:\ \ Security method 2 (Using PKI) as described in 3GPP TS 33.122.\n- OAUTH:\ @@ -1611,16 +1599,14 @@ components: title: NoProfileMatchInfo type: object NoProfileMatchReason: - anyOf: - - enum: + enum: - REQUESTER_PLMN_NOT_ALLOWED - TARGET_NF_SUSPENDED - TARGET_NF_UNDISCOVERABLE - QUERY_PARAMS_COMBINATION_NO_MATCH - TARGET_NF_TYPE_NOT_SUPPORTED - UNSPECIFIED - type: string - - type: string + type: string description: No Profile Match Reason title: NoProfileMatchReason QueryParamCombination: @@ -1674,8 +1660,7 @@ components: title: NfInstanceId type: string NFType: - anyOf: - - enum: + enum: - NRF - UDM - AMF @@ -1740,8 +1725,7 @@ components: - MF - SLPKMF - RH - type: string - - type: string + type: string description: NF types known to NRF title: NFType PlmnId: @@ -1875,8 +1859,7 @@ components: title: VendorId type: string NwdafEvent: - anyOf: - - enum: + enum: - SLICE_LOAD_LEVEL - NETWORK_PERFORMANCE - NF_LOAD @@ -1898,10 +1881,7 @@ components: - MOVEMENT_BEHAVIOUR - LOC_ACCURACY - RELATIVE_PROXIMITY - type: string - - description: | - This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - type: string + type: string description: "Describes the NWDAF Events. \nPossible values are:\n- SLICE_LOAD_LEVEL:\ \ Indicates that the event subscribed is load level information of Network\n\ \ Slice.\n- NETWORK_PERFORMANCE: Indicates that the event subscribed is network\ -- GitLab From e22e84d7c7e15085b5a08b43db6616fa7d55e10c Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 15 Apr 2025 16:41:29 +0200 Subject: [PATCH 107/157] Remove ACL test related with supported features and reorder tests numbering --- .../capif_api_access_control_policy.robot | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/tests/features/CAPIF Api Access Control Policy/capif_api_access_control_policy.robot b/tests/features/CAPIF Api Access Control Policy/capif_api_access_control_policy.robot index 05716c20..12844d51 100644 --- a/tests/features/CAPIF Api Access Control Policy/capif_api_access_control_policy.robot +++ b/tests/features/CAPIF Api Access Control Policy/capif_api_access_control_policy.robot @@ -364,12 +364,8 @@ Retrieve ACL filtered by api-invoker-id ... ${resp.json()['apiInvokerPolicies'][0]['apiInvokerId']} ... ${register_user_info_invoker_2['api_invoker_id']} -Retrieve ACL filtered by supported-features - [Tags] capif_api_acl-5 - Skip Test ${TEST_NAME} is not currently supported by CAPIF - Retrieve ACL with aef-id not valid - [Tags] capif_api_acl-6 + [Tags] capif_api_acl-5 ${register_user_info_invoker} ... ${register_user_info_provider} ... ${service_api_description_published}= @@ -393,7 +389,7 @@ Retrieve ACL with aef-id not valid ... cause=Wrong id Retrieve ACL with service-id not valid - [Tags] capif_api_acl-7 + [Tags] capif_api_acl-6 ${register_user_info_invoker} ... ${register_user_info_provider} ... ${service_api_description_published}= @@ -416,7 +412,7 @@ Retrieve ACL with service-id not valid ... cause=Wrong id Retrieve ACL with service-api-id and aef-id not valid - [Tags] capif_api_acl-8 + [Tags] capif_api_acl-7 ${register_user_info_invoker} ... ${register_user_info_provider} ... ${service_api_description_published}= @@ -439,7 +435,7 @@ Retrieve ACL with service-api-id and aef-id not valid ... cause=Wrong id Retrieve ACL without SecurityContext created previously by Invoker - [Tags] capif_api_acl-9 + [Tags] capif_api_acl-8 ${register_user_info_invoker} ... ${register_user_info_provider} ... ${service_api_description_published}= @@ -463,7 +459,7 @@ Retrieve ACL without SecurityContext created previously by Invoker ... cause=Wrong id Retrieve ACL filtered by api-invoker-id not present - [Tags] capif_api_acl-10 + [Tags] capif_api_acl-9 ${register_user_info_invoker} ... ${register_user_info_provider} ... ${service_api_description_published}= @@ -486,7 +482,7 @@ Retrieve ACL filtered by api-invoker-id not present ... cause=Wrong id Retrieve ACL with APF Certificate - [Tags] capif_api_acl-11 + [Tags] capif_api_acl-10 ${register_user_info_invoker} ... ${register_user_info_provider} ... ${service_api_description_published}= @@ -506,7 +502,7 @@ Retrieve ACL with APF Certificate ... cause=Certificate not authorized Retrieve ACL with AMF Certificate - [Tags] capif_api_acl-12 + [Tags] capif_api_acl-11 ${register_user_info_invoker} ... ${register_user_info_provider} ... ${service_api_description_published}= @@ -526,7 +522,7 @@ Retrieve ACL with AMF Certificate ... cause=Certificate not authorized Retrieve ACL with Invoker Certificate - [Tags] capif_api_acl-13 smoke + [Tags] capif_api_acl-12 smoke ${register_user_info_invoker} ... ${register_user_info_provider} ... ${service_api_description_published}= @@ -546,7 +542,7 @@ Retrieve ACL with Invoker Certificate ... cause=Certificate not authorized No ACL for invoker after be removed - [Tags] capif_api_acl-14 + [Tags] capif_api_acl-13 ${register_user_info_invoker} ... ${register_user_info_provider} ... ${service_api_description_published}= -- GitLab From b8632d8fd2a84429161e95fb97a2319861b934dd Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 24 Apr 2025 08:34:08 +0200 Subject: [PATCH 108/157] one_time event logic --- .../capif_events/core/notifications.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index 584e31fe..dca31901 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -150,6 +150,11 @@ class Notifications(): notification = {"notification": data.to_dict(), "next_report_time" : next_report_time, "url": url, "subscription_id": sub["subscription_id"]} self.events_ops.add_notification(notification) + self.events_ops.update_report_nbr(sub["subscription_id"]) + + if sub["event_req"]["notif_method"] == "ONE_TIME": + asyncio.run(self.send(url, serialize_clean_camel_case(data))) + self.events_ops.delete_subscription(sub["subscription_id"]) if sub["event_req"].get("max_report_nbr", None) and sub["report_nbr"] + 1 == sub["event_req"].get("max_report_nbr", None): current_app.logger.debug(f"Limit reached, deleting subscription {sub['subscription_id']}") @@ -157,8 +162,7 @@ class Notifications(): else: asyncio.run(self.send(url, serialize_clean_camel_case(data))) - - self.events_ops.update_report_nbr(sub["subscription_id"]) + self.events_ops.update_report_nbr(sub["subscription_id"]) -- GitLab From 71ca556beb1db1d2f99a317d0b3bfecbf356eaab Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 24 Apr 2025 11:46:12 +0200 Subject: [PATCH 109/157] fix unused cert_validation --- services/TS29222_CAPIF_Access_Control_Policy_API/README.md | 6 +++--- .../capif_acl/controllers/default_controller.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/README.md b/services/TS29222_CAPIF_Access_Control_Policy_API/README.md index 40feae4b..112662bc 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/README.md +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m openapi_server +python3 -m capif_acl ``` and open your browser to here: @@ -42,8 +42,8 @@ To run the server on a Docker container, please execute the following from the r ```bash # building the image -docker build -t openapi_server . +docker build -t capif_acl . # starting up a container -docker run -p 8080:8080 openapi_server +docker run -p 8080:8080 capif_acl ``` \ No newline at end of file diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py index b24e6f00..6c201ea4 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py @@ -24,6 +24,7 @@ def cert_validation(): return __cert_validation return _cert_validation +@cert_validation() def access_control_policy_list_service_api_id_get(service_api_id, aef_id, api_invoker_id=None, supported_features=None): # noqa: E501 """access_control_policy_list_service_api_id_get -- GitLab From b176304f3d6a1f21a1e2777df72334a1c49c944d Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Tue, 29 Apr 2025 14:12:22 +0300 Subject: [PATCH 110/157] Add async gunicorn worker in helper service --- services/helper/helper_service/app.py | 2 ++ services/helper/helper_service/wsgi.py | 4 ++-- services/helper/prepare_helper.sh | 4 ++-- services/helper/requirements.txt | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/services/helper/helper_service/app.py b/services/helper/helper_service/app.py index 6dd56d8c..5d6019cc 100644 --- a/services/helper/helper_service/app.py +++ b/services/helper/helper_service/app.py @@ -7,6 +7,7 @@ from db.db import MongoDatabse import requests from OpenSSL.crypto import PKey, TYPE_RSA, X509Req, dump_certificate_request, FILETYPE_PEM, dump_privatekey from flask import Flask +from asgiref.wsgi import WsgiToAsgi from config import Config from controllers.helper_controller import helper_routes @@ -82,3 +83,4 @@ cert_file.close() app.register_blueprint(helper_routes) app.logger.setLevel(numeric_level) +asgi_app = WsgiToAsgi(app) \ No newline at end of file diff --git a/services/helper/helper_service/wsgi.py b/services/helper/helper_service/wsgi.py index 6026b0fa..55e6ab2d 100644 --- a/services/helper/helper_service/wsgi.py +++ b/services/helper/helper_service/wsgi.py @@ -1,4 +1,4 @@ -from app import app +from app import asgi_app if __name__ == "__main__": - app.run() + asgi_app.run() diff --git a/services/helper/prepare_helper.sh b/services/helper/prepare_helper.sh index d4297f64..3fe4988c 100644 --- a/services/helper/prepare_helper.sh +++ b/services/helper/prepare_helper.sh @@ -1,5 +1,5 @@ #!/bin/bash -gunicorn --bind 0.0.0.0:8080 \ - --chdir /usr/src/app/helper_service wsgi:app \ No newline at end of file +gunicorn -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8080 \ + --chdir /usr/src/app/helper_service wsgi:asgi_app \ No newline at end of file diff --git a/services/helper/requirements.txt b/services/helper/requirements.txt index 2a09c37f..14644ee7 100644 --- a/services/helper/requirements.txt +++ b/services/helper/requirements.txt @@ -7,4 +7,6 @@ pyopenssl == 24.1.0 pyyaml == 6.0.1 requests == 2.32.2 gunicorn == 23.0.0 +uvicorn == 0.34.2 +asgiref == 3.8.1 packaging == 24.0 -- GitLab From 81378162fd2c4b95cba9e0688848489e90b1105f Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Fri, 2 May 2025 11:12:52 +0200 Subject: [PATCH 111/157] immRep logic --- .../capif_events/core/events_apis.py | 38 ++++++++++++++----- services/celery/requirements.txt | 2 +- services/celery/tasks.py | 9 ----- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index d57defba..aaa8860d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -4,16 +4,22 @@ import secrets import rfc3987 from capif_events.models.event_subscription import EventSubscription # noqa: E501 from flask import current_app, Response -from datetime import datetime, timedelta, timezone +from datetime import datetime, timezone +import asyncio from .auth_manager import AuthManager from .resources import Resource from .responses import internal_server_error, not_found_error, make_response, bad_request_error from ..util import serialize_clean_camel_case, clean_empty, dict_to_camel_case +from .notifications import Notifications class EventSubscriptionsOperations(Resource): + def __init__(self): + super().__init__() + self.notifications = Notifications() + def __check_subscriber_id(self, subscriber_id): mycol_invoker= self.db.get_col_by_name(self.db.invoker_collection) mycol_provider= self.db.get_col_by_name(self.db.provider_collection) @@ -58,7 +64,7 @@ class EventSubscriptionsOperations(Resource): return bad_request_error(detail="Bad Param", cause = f"Invalid eventFilter for event {event}", invalid_params=[{"param": "eventFilter", "reason": f"The eventFilter {invalid_filters} for event {event} are not applicable."}]) return None - def __check_event_req(self, event_subscription): + def __check_event_req(self, event_subscription, subscription_id=None): current_app.logger.debug("Checking event requirement.") expired_at = None if event_subscription.event_req.mon_dur: @@ -79,6 +85,14 @@ class EventSubscriptionsOperations(Resource): cause="Periodic notification method selected but repPeriod not provided", invalid_params=[{"param": "repPeriod", "reason": "Periodic notification method selected but repPeriod not provided"}] ) + + if event_subscription.event_req.imm_rep and subscription_id is not None: + current_app.logger.debug("Sending immediate notification") + notifications_col = self.db.get_col_by_name(self.db.notifications_col) + result = notifications_col.find({"subscription_id": subscription_id}) + for notification in result: + asyncio.run(self.notifications.send(notification["url"], notification["notification"])) + return expired_at def __init__(self): @@ -209,6 +223,7 @@ class EventSubscriptionsOperations(Resource): def put_event(self, event_subscription, subscriber_id, subscription_id): try: mycol = self.db.get_col_by_name(self.db.event_collection) + notifications_col = self.db.get_col_by_name(self.db.notifications_col) current_app.logger.debug("Updating event subscription") @@ -224,6 +239,8 @@ class EventSubscriptionsOperations(Resource): if isinstance(result, Response): return result + current_app.logger.debug(event_subscription) + expired_at = None if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"]: if event_subscription.event_filters: current_app.logger.debug(event_subscription.event_filters) @@ -231,8 +248,7 @@ class EventSubscriptionsOperations(Resource): if isinstance(result, Response): return result if event_subscription.event_req: - current_app.logger.debug(event_subscription.event_req) - expired_at = self.__check_event_req(event_subscription) + expired_at = self.__check_event_req(event_subscription, subscription_id) if isinstance(expired_at, Response): return result @@ -252,6 +268,7 @@ class EventSubscriptionsOperations(Resource): body["created_at"] = eventdescription.get("created_at", datetime.now(timezone.utc)) body["expire_at"] = expired_at if expired_at else eventdescription.get("expire_at", None) + notifications_col.delete_many({"subscription_id": subscription_id}) mycol.replace_one(my_query, body) current_app.logger.debug("Event subscription updated from database") @@ -269,6 +286,7 @@ class EventSubscriptionsOperations(Resource): def patch_event(self, event_subscription, subscriber_id, subscription_id): try: mycol = self.db.get_col_by_name(self.db.event_collection) + notifications_col = self.db.get_col_by_name(self.db.notifications_col) current_app.logger.debug("Patching event subscription") @@ -284,7 +302,8 @@ class EventSubscriptionsOperations(Resource): if eventdescription is None: current_app.logger.error("Event subscription not found") return not_found_error(detail="Event subscription not exist", cause="Event API subscription id not found") - + current_app.logger.debug(event_subscription) + expired_at = None if EventSubscription.return_supp_feat_dict(eventdescription.get("supported_features"))["EnhancedEventReport"]: if event_subscription.events and event_subscription.event_filters: result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) @@ -292,13 +311,12 @@ class EventSubscriptionsOperations(Resource): result = self.__check_event_filters(event_subscription.events, eventdescription.get("event_filters")) elif event_subscription.events is None and event_subscription.event_filters: result = self.__check_event_filters(eventdescription.get("events"), clean_empty(event_subscription.to_dict()["event_filters"])) - if isinstance(result, Response): return result if event_subscription.event_req: - current_app.logger.debug(event_subscription.event_req) - expired_at = self.__check_event_req(event_subscription) + updated_data = EventSubscription.from_dict(dict_to_camel_case({**eventdescription, **clean_empty(event_subscription.to_dict())})) + expired_at = self.__check_event_req(updated_data, subscription_id) if isinstance(expired_at, Response): return result else: @@ -308,8 +326,8 @@ class EventSubscriptionsOperations(Resource): return result body = clean_empty(event_subscription.to_dict()) - if expired_at: - body["expire_at"] = expired_at + body["expire_at"] = expired_at + notifications_col.delete_many({"subscription_id": subscription_id}) document = mycol.update_one(my_query, {"$set":body}) document = mycol.find_one(my_query) current_app.logger.debug("Event subscription patched from database") diff --git a/services/celery/requirements.txt b/services/celery/requirements.txt index 64b64cfd..32b0f0c6 100644 --- a/services/celery/requirements.txt +++ b/services/celery/requirements.txt @@ -4,4 +4,4 @@ redis==4.5.4 aiohttp == 3.10.5 async-timeout == 4.0.3 pyyaml == 6.0.2 -python_dateutil >= 2.6.0 +python_dateutil == 2.9.0 diff --git a/services/celery/tasks.py b/services/celery/tasks.py index cdc589b5..01476920 100644 --- a/services/celery/tasks.py +++ b/services/celery/tasks.py @@ -8,13 +8,6 @@ from config import Config import aiohttp import asyncio -# Celery Configuration -# celery = Celery( -# "notifications", -# broker=os.environ.get("CELERY_BROKER_URL", "redis://redis:6379/0"), -# backend=os.environ.get("CELERY_RESULT_BACKEND", "redis://redis:6379/0") -# ) - celery = Celery( "notifications", broker=f"redis://{os.getenv("REDIS_HOST")}:{os.getenv("REDIS_PORT")}/0", @@ -108,7 +101,6 @@ async def send(url, data): @celery.task(name="celery.tasks.check_notifications_collection") def my_periodic_task(): - # print("Checking notifications collection...") while True: try: notification_data = notifications_col.find_one_and_delete( @@ -126,4 +118,3 @@ def my_periodic_task(): except Exception as e: print(f"Error sending notification: {e}") - # print("Finished processing notifications.") -- GitLab From 82d5badad0d2f722a9537d79da34488b8bf72e31 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Mon, 5 May 2025 12:00:24 +0200 Subject: [PATCH 112/157] removed commented line --- services/TS29222_CAPIF_Events_API/capif_events/db/db.py | 1 - 1 file changed, 1 deletion(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/db/db.py b/services/TS29222_CAPIF_Events_API/capif_events/db/db.py index 3af5d6cf..c4888466 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/db/db.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/db/db.py @@ -24,7 +24,6 @@ class MongoDatabse(): self.notifications_col = self.config['mongo']['notifications_col'] self.get_col_by_name(self.event_collection).create_index([("expire_at", 1)],expireAfterSeconds=0) - # self.acls_col = self.config['mongo']['capif_acls_col'] def get_col_by_name(self, name): return self.db[name].with_options(codec_options=CodecOptions(tz_aware=True)) -- GitLab From e6cf22b3361eafc041e123c58b4535cf05bf50ac Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Mon, 19 May 2025 10:42:01 +0200 Subject: [PATCH 113/157] Celery logs in warning --- services/celery/start_celery.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/celery/start_celery.sh b/services/celery/start_celery.sh index 979e325b..a9fe8480 100644 --- a/services/celery/start_celery.sh +++ b/services/celery/start_celery.sh @@ -2,10 +2,10 @@ if [ "$CELERY_MODE" = "worker" ]; then echo "Starting Celery Worker..." - celery -A tasks worker --loglevel=info + celery -A tasks worker --loglevel=WARNING elif [ "$CELERY_MODE" = "beat" ]; then echo "Iniciando Celery Beat..." - celery -A tasks beat --loglevel=info + celery -A tasks beat --loglevel=WARNING else echo "ERROR: The environment variable CELERY_MODE is not set correctly (worker|beat)" exit 1 -- GitLab From d53491a2c2f9cca6a45ef4a6edea22822ec121a9 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 16:42:14 +0200 Subject: [PATCH 114/157] Add initial Helm chart for celery-beat with configuration and templates --- helm/capif/charts/celery-beat/.helmignore | 23 ++++ helm/capif/charts/celery-beat/Chart.yaml | 24 ++++ helm/capif/charts/celery-beat/README.md | 67 +++++++++++ .../charts/celery-beat/templates/NOTES.txt | 8 ++ .../charts/celery-beat/templates/_helpers.tpl | 62 ++++++++++ .../celery-beat/templates/configmap.yaml | 14 +++ .../celery-beat/templates/deployment.yaml | 70 +++++++++++ .../charts/celery-beat/templates/hpa.yaml | 32 +++++ .../charts/celery-beat/templates/ingress.yaml | 61 ++++++++++ .../celery-beat/templates/serviceaccount.yaml | 13 ++ helm/capif/charts/celery-beat/values.yaml | 113 ++++++++++++++++++ 11 files changed, 487 insertions(+) create mode 100644 helm/capif/charts/celery-beat/.helmignore create mode 100644 helm/capif/charts/celery-beat/Chart.yaml create mode 100644 helm/capif/charts/celery-beat/README.md create mode 100644 helm/capif/charts/celery-beat/templates/NOTES.txt create mode 100644 helm/capif/charts/celery-beat/templates/_helpers.tpl create mode 100644 helm/capif/charts/celery-beat/templates/configmap.yaml create mode 100644 helm/capif/charts/celery-beat/templates/deployment.yaml create mode 100644 helm/capif/charts/celery-beat/templates/hpa.yaml create mode 100644 helm/capif/charts/celery-beat/templates/ingress.yaml create mode 100644 helm/capif/charts/celery-beat/templates/serviceaccount.yaml create mode 100644 helm/capif/charts/celery-beat/values.yaml diff --git a/helm/capif/charts/celery-beat/.helmignore b/helm/capif/charts/celery-beat/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/helm/capif/charts/celery-beat/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/capif/charts/celery-beat/Chart.yaml b/helm/capif/charts/celery-beat/Chart.yaml new file mode 100644 index 00000000..35c2eb3f --- /dev/null +++ b/helm/capif/charts/celery-beat/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: celery-beat +description: A Helm chart for Kubernetes of celery-beat + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/helm/capif/charts/celery-beat/README.md b/helm/capif/charts/celery-beat/README.md new file mode 100644 index 00000000..ae8c323f --- /dev/null +++ b/helm/capif/charts/celery-beat/README.md @@ -0,0 +1,67 @@ +# celery-beat + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) + +A Helm chart for Kubernetes of celery-beat + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| env.capifHostname | string | `"capif"` | | +| env.logLevel | string | `"INFO"` | | +| env.mongoInitdbRootPassword | string | `"example"` | | +| env.mongoInitdbRootUsername | string | `"root"` | | +| env.monitoring | string | `"true"` | | +| env.vaultAccessToken | string | `"dev-only-token"` | | +| env.vaultHostname | string | `"vault"` | | +| env.vaultPort | int | `8200` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"celery-beat"` | | +| image.tag | string | `""` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| livenessProbe | string | `nil` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podLabels | object | `{}` | | +| podSecurityContext | object | `{}` | | +| readinessProbe.initialDelaySeconds | int | `10` | | +| readinessProbe.periodSeconds | int | `5` | | +| readinessProbe.tcpSocket.port | int | `8080` | | +| replicaCount | int | `1` | | +| resources.limits.cpu | string | `"100m"` | | +| resources.limits.memory | string | `"128Mi"` | | +| resources.requests.cpu | string | `"100m"` | | +| resources.requests.memory | string | `"128Mi"` | | +| securityContext | object | `{}` | | +| service.port | int | `8080` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.automount | bool | `true` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| tolerations | list | `[]` | | +| volumeMounts[0].mountPath | string | `"/usr/src/app/config.yaml"` | | +| volumeMounts[0].name | string | `"capif-invocation-config"` | | +| volumeMounts[0].subPath | string | `"config.yaml"` | | +| volumes[0].configMap.items[0].key | string | `"config.yaml"` | | +| volumes[0].configMap.items[0].path | string | `"config.yaml"` | | +| volumes[0].configMap.name | string | `"celery-beat-configmap"` | | +| volumes[0].name | string | `"capif-invocation-config"` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/helm/capif/charts/celery-beat/templates/NOTES.txt b/helm/capif/charts/celery-beat/templates/NOTES.txt new file mode 100644 index 00000000..0dc54d5b --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/NOTES.txt @@ -0,0 +1,8 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-beat/templates/_helpers.tpl b/helm/capif/charts/celery-beat/templates/_helpers.tpl new file mode 100644 index 00000000..ece434bb --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "celery-beat.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "celery-beat.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "celery-beat.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "celery-beat.labels" -}} +helm.sh/chart: {{ include "celery-beat.chart" . }} +{{ include "celery-beat.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "celery-beat.selectorLabels" -}} +app.kubernetes.io/name: {{ include "celery-beat.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "celery-beat.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "celery-beat.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-beat/templates/configmap.yaml b/helm/capif/charts/celery-beat/templates/configmap.yaml new file mode 100644 index 00000000..3ae5cde3 --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/configmap.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: celery-beat-configmap +data: + config.yaml: | + mongo: { + 'user': '{{ .Values.env.mongoInitdbRootUsername }}', + 'password': '{{ .Values.env.mongoInitdbRootPassword }}', + 'db': 'capif', + 'notifications_col': 'notifications', + 'host': 'mongo', + 'port': "27017" + } diff --git a/helm/capif/charts/celery-beat/templates/deployment.yaml b/helm/capif/charts/celery-beat/templates/deployment.yaml new file mode 100644 index 00000000..f7094690 --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "celery-beat.fullname" . }} + labels: + {{- include "celery-beat.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "celery-beat.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + date: "{{ now | unixEpoch }}" + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + labels: + {{- include "celery-beat.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "celery-beat.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: CELERY_MODE + value: {{ quote .Values.env.celeryMode }} + - name: REDIS_HOST + value: {{ quote .Values.env.redisHost }} + - name: REDIS_PORT + value: {{ quote .Values.env.redisPort }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/helm/capif/charts/celery-beat/templates/hpa.yaml b/helm/capif/charts/celery-beat/templates/hpa.yaml new file mode 100644 index 00000000..4884b453 --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "celery-beat.fullname" . }} + labels: + {{- include "celery-beat.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "celery-beat.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-beat/templates/ingress.yaml b/helm/capif/charts/celery-beat/templates/ingress.yaml new file mode 100644 index 00000000..aa98da92 --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "celery-beat.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "celery-beat.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-beat/templates/serviceaccount.yaml b/helm/capif/charts/celery-beat/templates/serviceaccount.yaml new file mode 100644 index 00000000..368cfc15 --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "celery-beat.serviceAccountName" . }} + labels: + {{- include "celery-beat.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml new file mode 100644 index 00000000..75799c31 --- /dev/null +++ b/helm/capif/charts/celery-beat/values.yaml @@ -0,0 +1,113 @@ +# Default values for celery-beat. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: celery + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +env: + celeryMode: beat + redisHost: redis + redisPort: 6379 + mongoInitdbRootUsername: root + mongoInitdbRootPassword: example + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: 200m + memory: 256Mi + requests: + cpu: 1m + memory: 1Mi + +livenessProbe: +# httpGet: +# path: / +# port: http +readinessProbe: +# tcpSocket: +# port: 8080 +# initialDelaySeconds: 10 +# periodSeconds: 5 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: + - name: capif-invocation-config + configMap: + name: celery-beat-configmap + items: + - key: "config.yaml" + path: "config.yaml" + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: + - name: capif-invocation-config + mountPath: /celery/config.yaml + subPath: config.yaml + +nodeSelector: {} + +tolerations: [] + +affinity: {} -- GitLab From 478d8d084f39f43b5f8bb01e7c825f2fadd9e08e Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 16:46:35 +0200 Subject: [PATCH 115/157] Update volume and volumeMount names in celery-beat chart to 'celery-beat' --- helm/capif/charts/celery-beat/README.md | 4 ++-- helm/capif/charts/celery-beat/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helm/capif/charts/celery-beat/README.md b/helm/capif/charts/celery-beat/README.md index ae8c323f..35b1639a 100644 --- a/helm/capif/charts/celery-beat/README.md +++ b/helm/capif/charts/celery-beat/README.md @@ -56,12 +56,12 @@ A Helm chart for Kubernetes of celery-beat | serviceAccount.name | string | `""` | | | tolerations | list | `[]` | | | volumeMounts[0].mountPath | string | `"/usr/src/app/config.yaml"` | | -| volumeMounts[0].name | string | `"capif-invocation-config"` | | +| volumeMounts[0].name | string | `"celery-beat"` | | | volumeMounts[0].subPath | string | `"config.yaml"` | | | volumes[0].configMap.items[0].key | string | `"config.yaml"` | | | volumes[0].configMap.items[0].path | string | `"config.yaml"` | | | volumes[0].configMap.name | string | `"celery-beat-configmap"` | | -| volumes[0].name | string | `"capif-invocation-config"` | | +| volumes[0].name | string | `"celery-beat"` | | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index 75799c31..aae6fb88 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -93,7 +93,7 @@ autoscaling: # Additional volumes on the output Deployment definition. volumes: - - name: capif-invocation-config + - name: celery-beat configMap: name: celery-beat-configmap items: @@ -102,7 +102,7 @@ volumes: # Additional volumeMounts on the output Deployment definition. volumeMounts: - - name: capif-invocation-config + - name: celery-beat mountPath: /celery/config.yaml subPath: config.yaml -- GitLab From 4d75f4582161144e662555bb94662c6bf61724e5 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 16:46:56 +0200 Subject: [PATCH 116/157] Add initial Helm chart for celery-worker with templates and configuration --- helm/capif/charts/celery-worker/.helmignore | 23 ++++ helm/capif/charts/celery-worker/Chart.yaml | 24 ++++ helm/capif/charts/celery-worker/README.md | 67 +++++++++++ .../charts/celery-worker/templates/NOTES.txt | 8 ++ .../celery-worker/templates/_helpers.tpl | 62 ++++++++++ .../celery-worker/templates/configmap.yaml | 14 +++ .../celery-worker/templates/deployment.yaml | 70 +++++++++++ .../charts/celery-worker/templates/hpa.yaml | 32 +++++ .../celery-worker/templates/ingress.yaml | 61 ++++++++++ .../templates/serviceaccount.yaml | 13 ++ helm/capif/charts/celery-worker/values.yaml | 113 ++++++++++++++++++ 11 files changed, 487 insertions(+) create mode 100644 helm/capif/charts/celery-worker/.helmignore create mode 100644 helm/capif/charts/celery-worker/Chart.yaml create mode 100644 helm/capif/charts/celery-worker/README.md create mode 100644 helm/capif/charts/celery-worker/templates/NOTES.txt create mode 100644 helm/capif/charts/celery-worker/templates/_helpers.tpl create mode 100644 helm/capif/charts/celery-worker/templates/configmap.yaml create mode 100644 helm/capif/charts/celery-worker/templates/deployment.yaml create mode 100644 helm/capif/charts/celery-worker/templates/hpa.yaml create mode 100644 helm/capif/charts/celery-worker/templates/ingress.yaml create mode 100644 helm/capif/charts/celery-worker/templates/serviceaccount.yaml create mode 100644 helm/capif/charts/celery-worker/values.yaml diff --git a/helm/capif/charts/celery-worker/.helmignore b/helm/capif/charts/celery-worker/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/helm/capif/charts/celery-worker/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/capif/charts/celery-worker/Chart.yaml b/helm/capif/charts/celery-worker/Chart.yaml new file mode 100644 index 00000000..cd71295e --- /dev/null +++ b/helm/capif/charts/celery-worker/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: celery-worker +description: A Helm chart for Kubernetes of celery-worker + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/helm/capif/charts/celery-worker/README.md b/helm/capif/charts/celery-worker/README.md new file mode 100644 index 00000000..1563d79c --- /dev/null +++ b/helm/capif/charts/celery-worker/README.md @@ -0,0 +1,67 @@ +# celery-worker + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) + +A Helm chart for Kubernetes of celery-worker + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| env.capifHostname | string | `"capif"` | | +| env.logLevel | string | `"INFO"` | | +| env.mongoInitdbRootPassword | string | `"example"` | | +| env.mongoInitdbRootUsername | string | `"root"` | | +| env.monitoring | string | `"true"` | | +| env.vaultAccessToken | string | `"dev-only-token"` | | +| env.vaultHostname | string | `"vault"` | | +| env.vaultPort | int | `8200` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"celery-worker"` | | +| image.tag | string | `""` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| livenessProbe | string | `nil` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podLabels | object | `{}` | | +| podSecurityContext | object | `{}` | | +| readinessProbe.initialDelaySeconds | int | `10` | | +| readinessProbe.periodSeconds | int | `5` | | +| readinessProbe.tcpSocket.port | int | `8080` | | +| replicaCount | int | `1` | | +| resources.limits.cpu | string | `"100m"` | | +| resources.limits.memory | string | `"128Mi"` | | +| resources.requests.cpu | string | `"100m"` | | +| resources.requests.memory | string | `"128Mi"` | | +| securityContext | object | `{}` | | +| service.port | int | `8080` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.automount | bool | `true` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| tolerations | list | `[]` | | +| volumeMounts[0].mountPath | string | `"/usr/src/app/config.yaml"` | | +| volumeMounts[0].name | string | `"celery-worker"` | | +| volumeMounts[0].subPath | string | `"config.yaml"` | | +| volumes[0].configMap.items[0].key | string | `"config.yaml"` | | +| volumes[0].configMap.items[0].path | string | `"config.yaml"` | | +| volumes[0].configMap.name | string | `"celery-worker-configmap"` | | +| volumes[0].name | string | `"celery-worker"` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/helm/capif/charts/celery-worker/templates/NOTES.txt b/helm/capif/charts/celery-worker/templates/NOTES.txt new file mode 100644 index 00000000..0dc54d5b --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/NOTES.txt @@ -0,0 +1,8 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-worker/templates/_helpers.tpl b/helm/capif/charts/celery-worker/templates/_helpers.tpl new file mode 100644 index 00000000..c545f56e --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "celery-worker.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "celery-worker.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "celery-worker.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "celery-worker.labels" -}} +helm.sh/chart: {{ include "celery-worker.chart" . }} +{{ include "celery-worker.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "celery-worker.selectorLabels" -}} +app.kubernetes.io/name: {{ include "celery-worker.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "celery-worker.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "celery-worker.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-worker/templates/configmap.yaml b/helm/capif/charts/celery-worker/templates/configmap.yaml new file mode 100644 index 00000000..20d74ecf --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/configmap.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: celery-worker-configmap +data: + config.yaml: | + mongo: { + 'user': '{{ .Values.env.mongoInitdbRootUsername }}', + 'password': '{{ .Values.env.mongoInitdbRootPassword }}', + 'db': 'capif', + 'notifications_col': 'notifications', + 'host': 'mongo', + 'port': "27017" + } diff --git a/helm/capif/charts/celery-worker/templates/deployment.yaml b/helm/capif/charts/celery-worker/templates/deployment.yaml new file mode 100644 index 00000000..8e3607f8 --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "celery-worker.fullname" . }} + labels: + {{- include "celery-worker.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "celery-worker.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + date: "{{ now | unixEpoch }}" + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + labels: + {{- include "celery-worker.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "celery-worker.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: CELERY_MODE + value: {{ quote .Values.env.celeryMode }} + - name: REDIS_HOST + value: {{ quote .Values.env.redisHost }} + - name: REDIS_PORT + value: {{ quote .Values.env.redisPort }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/helm/capif/charts/celery-worker/templates/hpa.yaml b/helm/capif/charts/celery-worker/templates/hpa.yaml new file mode 100644 index 00000000..c89649e8 --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "celery-worker.fullname" . }} + labels: + {{- include "celery-worker.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "celery-worker.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-worker/templates/ingress.yaml b/helm/capif/charts/celery-worker/templates/ingress.yaml new file mode 100644 index 00000000..5d07a917 --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "celery-worker.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "celery-worker.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-worker/templates/serviceaccount.yaml b/helm/capif/charts/celery-worker/templates/serviceaccount.yaml new file mode 100644 index 00000000..2876baf0 --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "celery-worker.serviceAccountName" . }} + labels: + {{- include "celery-worker.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/helm/capif/charts/celery-worker/values.yaml b/helm/capif/charts/celery-worker/values.yaml new file mode 100644 index 00000000..90ac01b3 --- /dev/null +++ b/helm/capif/charts/celery-worker/values.yaml @@ -0,0 +1,113 @@ +# Default values for celery-worker. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: celery + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +env: + celeryMode: worker + redisHost: redis + redisPort: 6379 + mongoInitdbRootUsername: root + mongoInitdbRootPassword: example + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: 200m + memory: 256Mi + requests: + cpu: 1m + memory: 1Mi + +livenessProbe: +# httpGet: +# path: / +# port: http +readinessProbe: +# tcpSocket: +# port: 8080 +# initialDelaySeconds: 10 +# periodSeconds: 5 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: + - name: celery-worker + configMap: + name: celery-worker-configmap + items: + - key: "config.yaml" + path: "config.yaml" + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: + - name: celery-worker + mountPath: /celery/config.yaml + subPath: config.yaml + +nodeSelector: {} + +tolerations: [] + +affinity: {} -- GitLab From dee2b8dcd4db93fcb89ba68bf4b20150c9add778 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 16:49:19 +0200 Subject: [PATCH 117/157] Add celery-beat and celery-worker to chart dependencies --- helm/capif/Chart.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helm/capif/Chart.yaml b/helm/capif/Chart.yaml index 1c49c2c3..89785865 100644 --- a/helm/capif/Chart.yaml +++ b/helm/capif/Chart.yaml @@ -68,6 +68,10 @@ dependencies: version: "*" - name: renderer version: "*" + - name: celery-beat + version: "*" + - name: celery-worker + version: "*" - name: "tempo" condition: tempo.enabled repository: "https://grafana.github.io/helm-charts" -- GitLab From 5b9eca09c4a8aa67dc8e8d7738b4033f57e4c537 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 16:56:48 +0200 Subject: [PATCH 118/157] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index aae6fb88..13696fd0 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -110,4 +110,4 @@ nodeSelector: {} tolerations: [] -affinity: {} +affinity: {} \ No newline at end of file -- GitLab From b110e5272c85ed8b052087ad12044c6b86bda588 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 17:00:57 +0200 Subject: [PATCH 119/157] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index 13696fd0..aae6fb88 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -110,4 +110,4 @@ nodeSelector: {} tolerations: [] -affinity: {} \ No newline at end of file +affinity: {} -- GitLab From be13ffca84b0130608ecf829d99a8f8c9b8ec505 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 17:05:07 +0200 Subject: [PATCH 120/157] Fix formatting in Chart.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/Chart.yaml b/helm/capif/charts/celery-beat/Chart.yaml index 35c2eb3f..140a2ff9 100644 --- a/helm/capif/charts/celery-beat/Chart.yaml +++ b/helm/capif/charts/celery-beat/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.16.0" +appVersion: "1.16.0" \ No newline at end of file -- GitLab From f4210c03341aeaacba7113bc127fc2219b9a7995 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 17:11:31 +0200 Subject: [PATCH 121/157] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index aae6fb88..13696fd0 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -110,4 +110,4 @@ nodeSelector: {} tolerations: [] -affinity: {} +affinity: {} \ No newline at end of file -- GitLab From 3bfde4a27c345501156b90a132aecfaae5012751 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 17:15:04 +0200 Subject: [PATCH 122/157] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index 13696fd0..aae6fb88 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -110,4 +110,4 @@ nodeSelector: {} tolerations: [] -affinity: {} \ No newline at end of file +affinity: {} -- GitLab From ca25d69165cec9d03587f508da8e283f847fa591 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 17:18:34 +0200 Subject: [PATCH 123/157] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index aae6fb88..13696fd0 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -110,4 +110,4 @@ nodeSelector: {} tolerations: [] -affinity: {} +affinity: {} \ No newline at end of file -- GitLab From 815660d7709d6235ebb097349862287f28e25d20 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Tue, 20 May 2025 10:16:06 +0200 Subject: [PATCH 124/157] Celery logs with logging --- services/celery/tasks.py | 67 ++++++++++++++++++++++++++++--- services/docker-compose-capif.yml | 2 + 2 files changed, 63 insertions(+), 6 deletions(-) diff --git a/services/celery/tasks.py b/services/celery/tasks.py index 01476920..21290267 100644 --- a/services/celery/tasks.py +++ b/services/celery/tasks.py @@ -7,7 +7,10 @@ from bson.codec_options import CodecOptions from config import Config import aiohttp import asyncio +import logging +from logging.handlers import RotatingFileHandler +# Initialize Celery celery = Celery( "notifications", broker=f"redis://{os.getenv("REDIS_HOST")}:{os.getenv("REDIS_PORT")}/0", @@ -21,7 +24,54 @@ celery.conf.beat_schedule = { "args": (), }, } + celery.conf.timezone = "UTC" +celery.conf.update(worker_hijack_root_logger=False) + + +# Setting log level +# Set the log level based on the environment variable or default to INFO +log_level = os.getenv('LOG_LEVEL', 'INFO').upper() +numeric_level = getattr(logging, log_level, logging.INFO) + + +def verbose_formatter(): + return logging.Formatter( + '{"timestamp": "%(asctime)s", "level": "%(levelname)s", "logger": "%(name)s", "function": "%(funcName)s", "line": %(lineno)d, "message": %(message)s}', + datefmt='%d/%m/%Y %H:%M:%S' + ) + + +def configure_logging(): + + formatter = verbose_formatter() + + console_handler = logging.StreamHandler() + console_handler.setLevel(numeric_level) + console_handler.setFormatter(formatter) + + file_handler = RotatingFileHandler( + filename="celery_logs.log", + maxBytes=1024 * 1024 * 100, + backupCount=20 + ) + file_handler.setLevel(numeric_level) + file_handler.setFormatter(formatter) + + # Root logger configuration + root_logger = logging.getLogger() + root_logger.setLevel(numeric_level) + root_logger.handlers = [] + root_logger.addHandler(console_handler) + root_logger.addHandler(file_handler) + + # Optional: configure specific logger + logger = logging.getLogger(__name__) + logger.setLevel(numeric_level) + return logger + + +logger = configure_logging() # MongoDB Connection config = Config().get_config() @@ -38,6 +88,7 @@ def serialize_clean_camel_case(obj): return res +# Function to clean empty values from a dictionary def clean_empty(d): if isinstance(d, dict): return { @@ -49,6 +100,7 @@ def clean_empty(d): return [v for v in map(clean_empty, d) if v is not None] return d +# Function to convert snake_case keys to camelCase def dict_to_camel_case(my_dict): @@ -82,6 +134,7 @@ def dict_to_camel_case(my_dict): return result +# Functions to send a request async def send_request(url, data): async with aiohttp.ClientSession() as session: timeout = aiohttp.ClientTimeout(total=10) @@ -91,14 +144,16 @@ async def send_request(url, data): async def send(url, data): try: + logger.info(f"Sending notification to {url} with data: {data}") response = await send_request(url, data) - print(response) + logger.info(response) except asyncio.TimeoutError: - print("Timeout: Request timeout") + logger.info("Timeout: Request timeout") except Exception as e: - print("An exception occurred sending notification::" + str(e)) + logger.info("An exception occurred sending notification::" + str(e)) return False +# Periodic task to check the notifications collection @celery.task(name="celery.tasks.check_notifications_collection") def my_periodic_task(): while True: @@ -109,12 +164,12 @@ def my_periodic_task(): if not notification_data: break except pymongo.errors.AutoReconnect: - print("MongoDB connection failed. Retrying...") + logger.info("MongoDB connection failed. Retrying...") continue try: - print(f"sending notification to {notification_data['url']}") + logger.info(f"Notification for suscription {notification_data["subscription_id"]} ready to send") asyncio.run(send(notification_data["url"], notification_data["notification"])) except Exception as e: - print(f"Error sending notification: {e}") + logger.info(f"Error sending notification: {e}") diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index 06247465..b6e2bfec 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -182,6 +182,7 @@ services: - CELERY_MODE=worker - REDIS_HOST=redis - REDIS_PORT=6379 + - LOG_LEVEL=${LOG_LEVEL} depends_on: - redis - mongo @@ -193,6 +194,7 @@ services: - CELERY_MODE=beat - REDIS_HOST=redis - REDIS_PORT=6379 + - LOG_LEVEL=${LOG_LEVEL} depends_on: - redis - mongo -- GitLab From 88030a99ee994b4b68a2155328e1e4da2dad62ec Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Tue, 20 May 2025 10:39:09 +0200 Subject: [PATCH 125/157] Removed celery log level --- services/celery/start_celery.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/celery/start_celery.sh b/services/celery/start_celery.sh index a9fe8480..778ae7b3 100644 --- a/services/celery/start_celery.sh +++ b/services/celery/start_celery.sh @@ -2,10 +2,10 @@ if [ "$CELERY_MODE" = "worker" ]; then echo "Starting Celery Worker..." - celery -A tasks worker --loglevel=WARNING + celery -A tasks worker elif [ "$CELERY_MODE" = "beat" ]; then echo "Iniciando Celery Beat..." - celery -A tasks beat --loglevel=WARNING + celery -A tasks beat else echo "ERROR: The environment variable CELERY_MODE is not set correctly (worker|beat)" exit 1 -- GitLab From b591d400573e7bd52e85b5945a50284d3af80a85 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 May 2025 11:02:16 +0200 Subject: [PATCH 126/157] Add LOG_LEVEL environment variable to celery-beat and celery-worker deployments --- helm/capif/charts/celery-beat/templates/deployment.yaml | 2 ++ helm/capif/charts/celery-beat/values.yaml | 1 + helm/capif/charts/celery-worker/templates/deployment.yaml | 2 ++ helm/capif/charts/celery-worker/values.yaml | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/templates/deployment.yaml b/helm/capif/charts/celery-beat/templates/deployment.yaml index f7094690..4a231223 100644 --- a/helm/capif/charts/celery-beat/templates/deployment.yaml +++ b/helm/capif/charts/celery-beat/templates/deployment.yaml @@ -42,6 +42,8 @@ spec: value: {{ quote .Values.env.redisHost }} - name: REDIS_PORT value: {{ quote .Values.env.redisPort }} + - name: LOG_LEVEL + value: {{ quote .Values.env.logLevel }} livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index 13696fd0..bd7fc689 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -20,6 +20,7 @@ env: redisPort: 6379 mongoInitdbRootUsername: root mongoInitdbRootPassword: example + logLevel: DEBUG serviceAccount: # Specifies whether a service account should be created diff --git a/helm/capif/charts/celery-worker/templates/deployment.yaml b/helm/capif/charts/celery-worker/templates/deployment.yaml index 8e3607f8..44311740 100644 --- a/helm/capif/charts/celery-worker/templates/deployment.yaml +++ b/helm/capif/charts/celery-worker/templates/deployment.yaml @@ -42,6 +42,8 @@ spec: value: {{ quote .Values.env.redisHost }} - name: REDIS_PORT value: {{ quote .Values.env.redisPort }} + - name: LOG_LEVEL + value: {{ quote .Values.env.logLevel }} livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: diff --git a/helm/capif/charts/celery-worker/values.yaml b/helm/capif/charts/celery-worker/values.yaml index 90ac01b3..9d054bab 100644 --- a/helm/capif/charts/celery-worker/values.yaml +++ b/helm/capif/charts/celery-worker/values.yaml @@ -19,7 +19,8 @@ env: redisHost: redis redisPort: 6379 mongoInitdbRootUsername: root - mongoInitdbRootPassword: example + mongoInitdbRootPassword: + logLevel: DEBUG serviceAccount: # Specifies whether a service account should be created -- GitLab From fe41b29402b869bf328be8f75ba269f0afd368dc Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 May 2025 11:02:41 +0200 Subject: [PATCH 127/157] Add missing MongoDB collection fields to configmap.yaml --- helm/capif/charts/ocf-events/templates/configmap.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helm/capif/charts/ocf-events/templates/configmap.yaml b/helm/capif/charts/ocf-events/templates/configmap.yaml index a928cac5..e599fef3 100644 --- a/helm/capif/charts/ocf-events/templates/configmap.yaml +++ b/helm/capif/charts/ocf-events/templates/configmap.yaml @@ -12,6 +12,8 @@ data: 'certs_col': "certs", 'capif_invokers_col': 'invokerdetails', 'capif_providers_col': 'providerenrolmentdetails', + 'capif_acls_col': 'acls', + 'notifications_col': 'notifications', 'host': 'mongo', 'port': "27017" } -- GitLab From c497438b83de5d74c73d8a0b090448c1695ade2a Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 May 2025 11:11:13 +0200 Subject: [PATCH 128/157] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-worker/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-worker/values.yaml b/helm/capif/charts/celery-worker/values.yaml index 9d054bab..8935d7aa 100644 --- a/helm/capif/charts/celery-worker/values.yaml +++ b/helm/capif/charts/celery-worker/values.yaml @@ -111,4 +111,4 @@ nodeSelector: {} tolerations: [] -affinity: {} +affinity: {} \ No newline at end of file -- GitLab From 5344e80713252bb0735e7ab664d21e094f7a569b Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 May 2025 11:29:00 +0200 Subject: [PATCH 129/157] Add mongoInitdbRootPassword value to celery-worker configuration --- helm/capif/charts/celery-worker/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-worker/values.yaml b/helm/capif/charts/celery-worker/values.yaml index 8935d7aa..dfaf4651 100644 --- a/helm/capif/charts/celery-worker/values.yaml +++ b/helm/capif/charts/celery-worker/values.yaml @@ -19,7 +19,7 @@ env: redisHost: redis redisPort: 6379 mongoInitdbRootUsername: root - mongoInitdbRootPassword: + mongoInitdbRootPassword: example logLevel: DEBUG serviceAccount: -- GitLab From e09664ab2206444ef5d3e94ffda3a2f4cd8cefd5 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 May 2025 16:43:28 +0200 Subject: [PATCH 130/157] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-worker/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-worker/values.yaml b/helm/capif/charts/celery-worker/values.yaml index dfaf4651..c410ac94 100644 --- a/helm/capif/charts/celery-worker/values.yaml +++ b/helm/capif/charts/celery-worker/values.yaml @@ -111,4 +111,4 @@ nodeSelector: {} tolerations: [] -affinity: {} \ No newline at end of file +affinity: {} -- GitLab From abc6cfd1bbf9e2c82f3d8981007f04bdcb6b2fe2 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Thu, 29 May 2025 09:40:52 +0200 Subject: [PATCH 131/157] PSK security method --- .../capif_security/core/servicesecurity.py | 110 +++++++++++++++++- services/docker-compose-capif.yml | 2 +- services/nginx/Dockerfile | 2 +- services/nginx/nginx.conf | 4 + 4 files changed, 113 insertions(+), 5 deletions(-) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py index 2cbc3e77..307580f1 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py @@ -5,9 +5,13 @@ from datetime import datetime, timedelta import rfc3987 from bson import json_util -from flask import current_app +from flask import current_app, request from flask_jwt_extended import create_access_token from pymongo import ReturnDocument +import hmac +import hashlib +import unicodedata + from ..core.publisher import Publisher from ..models.access_token_claims import AccessTokenClaims @@ -81,6 +85,47 @@ class SecurityOperations(Resource): current_app.logger.error("Bad format Scope: " + e) token_error = AccessTokenErr(error="invalid_scope", error_description="malformed scope") return make_response(object=clean_empty(token_error.to_dict()), status=400) + + + def __derive_psk(self, master_key:str, session_id:str, interface:dict): + ## Derive the PSK using the provided master key, session ID, and interface information + + # Interface information + host = None + if 'fqdn' in interface: + host = interface['fqdn'] + elif 'ipv4Addr' in interface: + host = interface['ipv4Addr'] + elif 'ipv6Addr' in interface: + host = interface['ipv6Addr'] + port = interface.get('port', None) + + api_prefix = interface.get('apiPrefix', '') + scheme = "https" if port in (None, 443) else "http" + + interface_info = f"{scheme}://{host}" + if port and port != 443: + interface_info += f":{port}" + interface_info += api_prefix + + # Normalize the strings to NFKC form + p0_string = unicodedata.normalize("NFKC", interface_info).encode("utf-8") + p1_string = unicodedata.normalize("NFKC", session_id).encode("utf-8") + + # Convert to octet format (0xFF) + p0_octet_string = ' '.join(f'0x{byte:02X}' for byte in p0_string) + p1_octet_string = ' '.join(f'0x{byte:02X}' for byte in p1_string) + + # Convert number of bytes to 16-bit big-endian + l0 = ' '.join(f'0x{byte:02X}' for byte in len(p0_octet_string).to_bytes(2, 'big')) + l1 = ' '.join(f'0x{byte:02X}' for byte in len(p1_octet_string).to_bytes(2, 'big')) + + # Create S string using FC (0x7A) and the octet strings with their lengths + S = "0x7A" + ' ' + p0_octet_string + ' ' + l0 + ' ' + p1_octet_string + ' ' + l1 + psk = hmac.new(master_key.encode("utf-8"), S.encode("utf-8"), hashlib.sha256).digest() + + return psk + def __init__(self): Resource.__init__(self) @@ -184,7 +229,7 @@ class SecurityOperations(Resource): return internal_server_error(detail=exception, cause=str(e)) def create_servicesecurity(self, api_invoker_id, service_security): - + mycol = self.db.get_col_by_name(self.db.security_info) try: @@ -259,7 +304,7 @@ class SecurityOperations(Resource): self.db.capif_service_col) services_security_object = capif_service_col.find_one( {"api_id": service_instance.api_id, self.filter_aef_id: service_instance.aef_id}, {"aef_profiles.security_methods.$": 1}) - + current_app.logger.debug("Aef profile: " + str(services_security_object)) if services_security_object is None: current_app.logger.error( "Not found service with this aef id: " + service_instance.aef_id) @@ -291,6 +336,36 @@ class SecurityOperations(Resource): # Select the highest-priority security method service_instance.sel_security_method = sorted_methods[0] + if service_instance.sel_security_method == "PSK": + request.headers.get('X-TLS-Protocol', 'N/A') + sesionId = request.headers.get('X-TLS-Session-ID', 'N/A') + Mkey = request.headers.get('X-TLS-MKey', 'N/A') + current_app.logger.info(f"TLS Protocol: {request.headers.get('X-TLS-Protocol', 'N/A')}, Session id: {sesionId}, Master Key: {Mkey}") + + interface = None + if service_instance.interface_details: + current_app.logger.debug("Interface details found") + interface = service_instance.interface_details.to_dict() + + else: + current_app.logger.error("Interface details not found") + services_security_object = capif_service_col.find_one( + {"api_id": service_instance.api_id}, {"aef_profiles": {"$elemMatch": {"aef_id": service_instance.aef_id}}, "_id": 0}) + current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0])) + if "interface_descriptions" in services_security_object["aef_profiles"][0]: + current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0]["interface_descriptions"])) + interface = services_security_object["aef_profiles"][0]["interface_descriptions"][0] + elif "domain_name" in services_security_object["aef_profiles"][0]: + current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0]["domain_name"])) + interface = services_security_object["aef_profiles"][0]["domain_name"] + + if interface: + current_app.logger.debug("Deriving PSK") + psk = self.__derive_psk(Mkey, sesionId, interface) + current_app.logger.debug("PSK derived : " + str(psk)) + + service_instance.authorization_info = str(psk) + # Send service instance to ACL current_app.logger.debug("Sending message to create ACL") publish_ops.publish_message("acls-messages", "create-acl:"+str( @@ -483,6 +558,35 @@ class SecurityOperations(Resource): valid_security_method)[0] update_acls.append({"api_id": service_instance.api_id, "aef_id": service_instance.aef_id}) + if service_instance.sel_security_method == "PSK": + request.headers.get('X-TLS-Protocol', 'N/A') + sesionId = request.headers.get('X-TLS-Session-ID', 'N/A') + Mkey = request.headers.get('X-TLS-MKey', 'N/A') + current_app.logger.info(f"TLS Protocol: {request.headers.get('X-TLS-Protocol', 'N/A')}, Session id: {sesionId}, Master Key: {Mkey}") + + interface = None + if service_instance.interface_details: + current_app.logger.debug("Interface details found") + interface = service_instance.interface_details.to_dict() + + else: + current_app.logger.error("Interface details not found") + services_security_object = capif_service_col.find_one( + {"api_id": service_instance.api_id}, {"aef_profiles": {"$elemMatch": {"aef_id": service_instance.aef_id}}, "_id": 0}) + current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0])) + if "interface_descriptions" in services_security_object["aef_profiles"][0]: + current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0]["interface_descriptions"])) + interface = services_security_object["aef_profiles"][0]["interface_descriptions"][0] + elif "domain_name" in services_security_object["aef_profiles"][0]: + current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0]["domain_name"])) + interface = services_security_object["aef_profiles"][0]["domain_name"] + + if interface: + current_app.logger.debug("Deriving PSK") + psk = self.__derive_psk(Mkey, sesionId, interface) + current_app.logger.debug("PSK derived : " + str(psk)) + + service_instance.authorization_info = str(psk) service_security = service_security.to_dict() service_security = clean_empty(service_security) diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index 06247465..2c6f40ef 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -306,7 +306,7 @@ services: ports: - "8080:8080" - "443:443" - image: ${REGISTRY_BASE_URL}/nginx:${OCF_VERSION} + image: pelayo222/mi-nginx:1.27.1-arm64 environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - VAULT_HOSTNAME=vault diff --git a/services/nginx/Dockerfile b/services/nginx/Dockerfile index c87732c5..d34d8b94 100644 --- a/services/nginx/Dockerfile +++ b/services/nginx/Dockerfile @@ -1,4 +1,4 @@ -FROM labs.etsi.org:5050/ocf/capif/nginx:1.27.1 +FROM pelayo222/mi-nginx:1.27.1-arm64 RUN apt-get update && apt-get install -y jq && apt-get clean RUN apt-get install -y openssl RUN apt-get install -y curl diff --git a/services/nginx/nginx.conf b/services/nginx/nginx.conf index f51e177f..ecde2dc1 100644 --- a/services/nginx/nginx.conf +++ b/services/nginx/nginx.conf @@ -142,6 +142,10 @@ http { return 401 $security_error_message; } + proxy_set_header X-TLS-Protocol $ssl_protocol; + proxy_set_header X-TLS-Session-ID $ssl_session_id; + proxy_set_header X-TLS-MKey $sslkeylog_mk; + proxy_set_header X-SSL-Client-Cert $ssl_client_cert; proxy_pass http://capif-security:8080; } -- GitLab From a5b9ed8160f6078e001aa8087154e6acb3f4d3c0 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 29 May 2025 18:41:01 +0200 Subject: [PATCH 132/157] add supportedFeatures negotiation to create and update security context --- .../capif_security/core/servicesecurity.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py index 2cbc3e77..df4324ba 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py @@ -24,6 +24,18 @@ security_context_not_found_detail = "Security context not found" api_invoker_no_context_cause = "API Invoker has no security context" +TOTAL_FEATURES = 3 +SUPPORTED_FEATURES_HEX = "4" + +def return_negotiated_supp_feat_dict(supp_feat): + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] + return { + "Notification_test_event": True if final_supp_feat[0] == "1" else False, + "Notification_websocket": True if final_supp_feat[1] == "1" else False, + "SecurityInfoPerAPI": True if final_supp_feat[2] == "1" else False, + "Final": hex(int(final_supp_feat[::-1], 2))[2:] + } + class SecurityOperations(Resource): def __check_invoker(self, api_invoker_id): @@ -207,6 +219,9 @@ class SecurityOperations(Resource): "Already security context defined with same api invoker id") return forbidden_error(detail="Security method already defined", cause="Identical AEF Profile IDs") + negotiated = return_negotiated_supp_feat_dict(service_security.supported_features) + service_security.supported_features = negotiated["Final"] + for service_instance in service_security.security_info: if service_instance.interface_details is not None: @@ -412,6 +427,9 @@ class SecurityOperations(Resource): mycol = self.db.get_col_by_name(self.db.security_info) try: + negotiated_supported_features = return_negotiated_supp_feat_dict(service_security.supported_features) + service_security.supported_features = negotiated_supported_features["Final"] + current_app.logger.debug("Updating security context") result = self.__check_invoker(api_invoker_id) if result != None: -- GitLab From 768ad8c1b4be93b27e2bf7b2b6e693fe38bea035 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Fri, 30 May 2025 12:18:26 +0200 Subject: [PATCH 133/157] launch pipeline -- GitLab From 1fb91bf7d8b64db14d62d3f5b2c5f176c3408fbb Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Tue, 3 Jun 2025 12:24:36 +0200 Subject: [PATCH 134/157] Nginx patched image script --- .../create_nginx_patched_images.sh | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100755 tools/base_images_scripts/create_nginx_patched_images.sh diff --git a/tools/base_images_scripts/create_nginx_patched_images.sh b/tools/base_images_scripts/create_nginx_patched_images.sh new file mode 100755 index 00000000..a46abf82 --- /dev/null +++ b/tools/base_images_scripts/create_nginx_patched_images.sh @@ -0,0 +1,120 @@ +#!/bin/bash + +set -euo pipefail + +NGINX_VERSION=1.27.1 +PLATFORMS=("linux/arm64" +"linux/amd64") +PATCH_REPO="https://labs.etsi.org/rep/ocf/tools/nginx-sslkeylog.git" +REGISTRY="pelayo222" #Change to labs.etsi.org:5050/ocf/capif + +for platform in "${PLATFORMS[@]}";do + image_name="nginx:$NGINX_VERSION-ocf-patched" + echo "$image_name pulled for platform $platform" + + container_id=$(docker run -d --platform=$platform --name build-nginx debian:bullseye sleep infinity) + + docker exec $container_id bash -c " + set -e + + echo 'Installing build dependencies...' + apt-get update && apt-get install -y \ + build-essential \ + libpcre3-dev \ + libssl-dev \ + zlib1g-dev \ + curl \ + patch \ + ca-certificates \ + openssl \ + git \ + jq \ + gettext + + echo 'Creating nginx user...' + useradd -r -d /etc/nginx -s /sbin/nologin nginx + + echo 'Downloading NGINX $NGINX_VERSION...' + curl -LO https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz + tar -xzf nginx-${NGINX_VERSION}.tar.gz + cd nginx-${NGINX_VERSION} + + echo 'Cloning and applying patch...' + git clone ${PATCH_REPO} ../nginx-sslkeylog + patch -p1 < ../nginx-sslkeylog/nginx-patches/${NGINX_VERSION}.patch + + echo 'Configuring NGINX...' + ./configure \ + --prefix=/etc/nginx \ + --sbin-path=/usr/sbin/nginx \ + --modules-path=/usr/lib/nginx/modules \ + --conf-path=/etc/nginx/nginx.conf \ + --error-log-path=/var/log/nginx/error.log \ + --http-log-path=/var/log/nginx/access.log \ + --pid-path=/var/run/nginx.pid \ + --lock-path=/var/run/nginx.lock \ + --http-client-body-temp-path=/var/cache/nginx/client_temp \ + --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ + --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ + --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ + --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ + --user=nginx \ + --group=nginx \ + --with-compat \ + --with-file-aio \ + --with-threads \ + --with-http_addition_module \ + --with-http_auth_request_module \ + --with-http_dav_module \ + --with-http_flv_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_mp4_module \ + --with-http_random_index_module \ + --with-http_realip_module \ + --with-http_secure_link_module \ + --with-http_slice_module \ + --with-http_ssl_module \ + --with-http_stub_status_module \ + --with-http_sub_module \ + --with-http_v2_module \ + --with-http_v3_module \ + --with-mail \ + --with-mail_ssl_module \ + --with-stream \ + --with-stream_realip_module \ + --with-stream_ssl_module \ + --with-stream_ssl_preread_module \ + --with-cc-opt='-g -O2 -ffile-prefix-map=/data/builder/debuild/nginx-${NGINX_VERSION}/debian/debuild-base/nginx-${NGINX_VERSION}=. -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' \ + --with-ld-opt='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' \ + --add-module=../nginx-sslkeylog + + echo 'Building NGINX...' + make -j\$(nproc) && make install + + echo 'Creating required temporary directories...' + mkdir -p /var/cache/nginx/{client_temp,proxy_temp,fastcgi_temp,uwsgi_temp,scgi_temp} + + echo '✅ NGINX build completed.' + " + MANIFEST_AMEND="" + + tag=$(echo $platform | awk -F'/' '{print $NF}') + + docker commit $container_id $image_name + docker tag $image_name $REGISTRY/$image_name-$tag + echo "$REGISTRY/$image_name-$tag tagged" + docker push $REGISTRY/$image_name-$tag + echo "$REGISTRY/$image_name-$tag pushed" + MANIFEST_AMEND="$MANIFEST_AMEND --amend $REGISTRY/$image_name-$tag" + docker stop $container_id + docker rm $container_id + +done + +docker manifest create $REGISTRY/$image_name $MANIFEST_AMEND +echo "$REGISTRY/$image_name Manifest created with amend $MANIFEST_AMEND" +docker manifest push $REGISTRY/$image_name +echo "$REGISTRY/$image_name Manifest pushed" + +echo "🎉 All builds completed successfully." -- GitLab From 28fefd7c27f39f564bbaf8405608e5ec955ee990 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Thu, 5 Jun 2025 10:59:30 +0300 Subject: [PATCH 135/157] Include supported feature negotiation on POST and PUT methods --- .../core/apiinvokerenrolmentdetails.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py index e3164aeb..5956beed 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py @@ -19,6 +19,24 @@ from .redis_internal_event import RedisInternalEvent from .resources import Resource from .responses import bad_request_error, forbidden_error, internal_server_error, make_response, not_found_error + +TOTAL_FEATURES = 4 +SUPPORTED_FEATURES_HEX = "0" + + +def return_negotiated_supp_feat_dict(supp_feat): + + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] + + return { + "Notification_test_event": True if final_supp_feat[0] == "1" else False, + "Notification_websocket": True if final_supp_feat[1] == "1" else False, + "PatchUpdate": True if final_supp_feat[2] == "1" else False, + "ExpirationTime": True if final_supp_feat[3] == "1" else False, + "Final": hex(int(final_supp_feat[::-1], 2))[2:] + } + + publisher_ops = Publisher() @@ -93,6 +111,8 @@ class InvokerManagementOperations(Resource): apiinvokerenrolmentdetail.onboarding_information.api_invoker_certificate = cert[ 'data']['certificate'] + apiinvokerenrolmentdetail.supported_features = return_negotiated_supp_feat_dict(apiinvokerenrolmentdetail.supported_features)["Final"] + # Onboarding Date Record invoker_dict = apiinvokerenrolmentdetail.to_dict() invoker_dict["onboarding_date"] = datetime.now() @@ -136,6 +156,9 @@ class InvokerManagementOperations(Resource): self.auth_manager.update_auth_invoker( cert['data']["certificate"], onboard_id) + apiinvokerenrolmentdetail.supported_features = return_negotiated_supp_feat_dict( + apiinvokerenrolmentdetail.supported_features)["Final"] + apiinvokerenrolmentdetail_update = apiinvokerenrolmentdetail.to_dict() apiinvokerenrolmentdetail_update = { key: value for key, value in apiinvokerenrolmentdetail_update.items() if value is not None -- GitLab From ad9eb0668aa14ca5d5f183574eed0d29995bd4ee Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Fri, 6 Jun 2025 15:28:49 +0300 Subject: [PATCH 136/157] Working version. Needs some fixes. One test fails --- .../controllers/default_controller.py | 3 +- .../core/serviceapidescriptions.py | 33 ++++++++++++++++--- .../models/service_api_description.py | 19 ----------- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py index 27c4b642..29839084 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py @@ -7,6 +7,7 @@ from published_apis.vendor_specific import find_attribute_in_body, vendor_specif from ..core.responses import bad_request_error from ..core.serviceapidescriptions import PublishServiceOperations +from ..core.serviceapidescriptions import return_negotiated_supp_feat_dict from ..core.validate_user import ControlAccess from ..models.service_api_description import ServiceAPIDescription # noqa: E501 @@ -88,7 +89,7 @@ def apf_id_service_apis_post(apf_id, body): # noqa: E501 invalid_params=[{"param": "supportedFeatures", "reason": "not defined"}] ) - supp_feat_dict = ServiceAPIDescription.return_supp_feat_dict( + supp_feat_dict = return_negotiated_supp_feat_dict( body['supportedFeatures']) vendor_specific = [] diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py index d5b45175..15f04886 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py @@ -21,12 +21,33 @@ from .responses import ( unauthorized_error ) + +TOTAL_FEATURES = 10 +SUPPORTED_FEATURES_HEX = "120" + publisher_ops = Publisher() service_api_not_found_message = "Service API not found" +def return_negotiated_supp_feat_dict(supp_feat): + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] + + return { + "ApiSupportedFeaturePublishing": True if final_supp_feat[0] == "1" else False, + "PatchUpdate": True if final_supp_feat[1] == "1" else False, + "ExtendedIntfDesc": True if final_supp_feat[2] == "1" else False, + "MultipleCustomOperations": True if final_supp_feat[3] == "1" else False, + "ProtocDataFormats_Ext1": True if final_supp_feat[4] == "1" else False, + "ApiStatusMonitoring": True if final_supp_feat[5] == "1" else False, + "EdgeApp_2": True if final_supp_feat[6] == "1" else False, + "RNAA": True if final_supp_feat[7] == "1" else False, + "VendorExt": True if final_supp_feat[8] == "1" else False, + "SliceBasedAPIExposure": True if final_supp_feat[9] == "1" else False, + "Final": hex(int(final_supp_feat[::-1], 2))[2:] + } + class PublishServiceOperations(Resource): def check_apf(self, apf_id): @@ -126,7 +147,7 @@ class PublishServiceOperations(Resource): vendor_specific, serviceapidescription_dict) rec.update(serviceapidescription_dict) - if not ServiceAPIDescription.return_supp_feat_dict(rec.get("supported_features"))["ApiStatusMonitoring"] and rec.get("api_status", None) is not None: + if not return_negotiated_supp_feat_dict(rec.get("supported_features"))["ApiStatusMonitoring"] and rec.get("api_status", None) is not None: return bad_request_error( detail="Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed", cause="apiStatus can't be set if apiStatusMonitoring is inactive", @@ -296,8 +317,9 @@ class PublishServiceOperations(Resource): service_api_description["apf_id"] = serviceapidescription_old["apf_id"] service_api_description["onboarding_date"] = serviceapidescription_old["onboarding_date"] service_api_description["api_id"] = serviceapidescription_old["api_id"] + service_api_description["supported_features"] = return_negotiated_supp_feat_dict(service_api_description["supported_features"])["Final"] - if not ServiceAPIDescription.return_supp_feat_dict(service_api_description.get("supported_features"))["ApiStatusMonitoring"] and service_api_description.get("api_status", None) is not None: + if not return_negotiated_supp_feat_dict(service_api_description.get("supported_features"))["ApiStatusMonitoring"] and service_api_description.get("api_status", None) is not None: return bad_request_error( detail="Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed", cause="apiStatus can't be set if apiStatusMonitoring is inactive", @@ -382,11 +404,14 @@ class PublishServiceOperations(Resource): patch_service_api_description = patch_service_api_description.to_dict() api_status = patch_service_api_description.get("api_status", None) + supported_features = patch_service_api_description.get("supported_features", None) patch_service_api_description = clean_empty(patch_service_api_description) if api_status: patch_service_api_description["api_status"]=api_status + if supported_features: + patch_service_api_description["supported_features"] = return_negotiated_supp_feat_dict(patch_service_api_description["supported_features"])["Final"] - if not ServiceAPIDescription.return_supp_feat_dict(serviceapidescription_old.get("supported_features"))["ApiStatusMonitoring"] and patch_service_api_description.get("api_status", None) is not None: + if not return_negotiated_supp_feat_dict(serviceapidescription_old.get("supported_features"))["ApiStatusMonitoring"] and patch_service_api_description.get("api_status", None) is not None: return bad_request_error( detail="Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed", cause="apiStatus can't be set if apiStatusMonitoring is inactive", @@ -471,7 +496,7 @@ class PublishServiceOperations(Resource): def service_api_availability_event(self, service_api_description): service_api_status = "" - if ServiceAPIDescription.return_supp_feat_dict(service_api_description.get("supportedFeatures"))["ApiStatusMonitoring"]: + if return_negotiated_supp_feat_dict(service_api_description.get("supportedFeatures"))["ApiStatusMonitoring"]: current_app.logger.info( "ApiStatusMonitoring active") if service_api_description.get("apiStatus") is None or len(service_api_description.get("apiStatus").get("aefIds")) > 0: diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py index 0111b908..3f97250d 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py @@ -87,25 +87,6 @@ class ServiceAPIDescription(Model): self._ccf_id = ccf_id self._api_prov_name = api_prov_name - @classmethod - def return_supp_feat_dict(cls, supp_feat): - TOTAL_FEATURES = 9 - supp_feat_in_hex = int(supp_feat, 16) - supp_feat_in_bin = bin(supp_feat_in_hex)[2:].zfill(TOTAL_FEATURES)[::-1] - - - return { - "ApiSupportedFeaturePublishing": True if supp_feat_in_bin[0] == "1" else False, - "PatchUpdate": True if supp_feat_in_bin[1] == "1" else False, - "ExtendedIntfDesc": True if supp_feat_in_bin[2] == "1" else False, - "MultipleCustomOperations": True if supp_feat_in_bin[3] == "1" else False, - "ProtocDataFormats_Ext1": True if supp_feat_in_bin[4] == "1" else False, - "ApiStatusMonitoring": True if supp_feat_in_bin[5] == "1" else False, - "EdgeApp_2": True if supp_feat_in_bin[6] == "1" else False, - "RNAA": True if supp_feat_in_bin[7] == "1" else False, - "VendorExt": True if supp_feat_in_bin[8] == "1" else False - } - @classmethod def from_dict(cls, dikt) -> 'ServiceAPIDescription': -- GitLab From 4308c7ac23241d9fe487296d9789f347b907f53a Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 9 Jun 2025 09:44:33 +0200 Subject: [PATCH 137/157] launch pipeline 2 -- GitLab From 407c1a05ea79607c1768f56a697a8a6f7720c0a7 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 9 Jun 2025 11:17:32 +0200 Subject: [PATCH 138/157] launch pipeline 3 -- GitLab From ee54204aa5e08cba3b76f736cadec13bfd68bbb3 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 9 Jun 2025 13:33:43 +0200 Subject: [PATCH 139/157] add supporte features negotiation --- .../logs/core/auditoperations.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py b/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py index b4681ac0..6d41cf70 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py @@ -9,6 +9,17 @@ from .resources import Resource from .responses import bad_request_error, internal_server_error, make_response, not_found_error +TOTAL_FEATURES = 2 +SUPPORTED_FEATURES_HEX = "1" + +def return_negotiated_supp_feat_dict(supp_feat): + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] + return { + "EnQueryInvokeLog": True if final_supp_feat[0] == "1" else False, + "SliceBasedAPIExposure": True if final_supp_feat[1] == "1" else False, + "Final": hex(int(final_supp_feat[::-1], 2))[2:] + } + class AuditOperations (Resource): def get_logs(self, query_parameters): @@ -55,6 +66,13 @@ class AuditOperations (Resource): if not result['logs']: return not_found_error(detail="Parameters do not match any log entry", cause="No logs found") + client_features = query_parameters.get('supported_features') + if client_features: + negotiated = return_negotiated_supp_feat_dict(client_features) + result['supported_features'] = negotiated["Final"] + else: + result['supported_features'] = client_features + invocation_log = InvocationLog(result['aef_id'], result['api_invoker_id'], result['logs'], result['supported_features']) res = make_response(object=serialize_clean_camel_case(invocation_log), status=200) -- GitLab From ca92e9427a39520d992f6fa4f0738401244514fd Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Tue, 10 Jun 2025 10:33:28 +0200 Subject: [PATCH 140/157] New Nginx image --- services/docker-compose-capif.yml | 2 +- services/nginx/Dockerfile | 2 +- tools/base_images_scripts/create_nginx_patched_images.sh | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index a65dd5d4..e021aa52 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -308,7 +308,7 @@ services: ports: - "8080:8080" - "443:443" - image: pelayo222/mi-nginx:1.27.1-arm64 + image: labs.etsi.org:5050/ocf/capif/nginx-ocf-patched:1.27.1 environment: - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} - VAULT_HOSTNAME=vault diff --git a/services/nginx/Dockerfile b/services/nginx/Dockerfile index d34d8b94..b163386e 100644 --- a/services/nginx/Dockerfile +++ b/services/nginx/Dockerfile @@ -1,4 +1,4 @@ -FROM pelayo222/mi-nginx:1.27.1-arm64 +FROM labs.etsi.org:5050/ocf/capif/nginx-ocf-patched:1.27.1 RUN apt-get update && apt-get install -y jq && apt-get clean RUN apt-get install -y openssl RUN apt-get install -y curl diff --git a/tools/base_images_scripts/create_nginx_patched_images.sh b/tools/base_images_scripts/create_nginx_patched_images.sh index a46abf82..07dd769d 100755 --- a/tools/base_images_scripts/create_nginx_patched_images.sh +++ b/tools/base_images_scripts/create_nginx_patched_images.sh @@ -6,10 +6,11 @@ NGINX_VERSION=1.27.1 PLATFORMS=("linux/arm64" "linux/amd64") PATCH_REPO="https://labs.etsi.org/rep/ocf/tools/nginx-sslkeylog.git" -REGISTRY="pelayo222" #Change to labs.etsi.org:5050/ocf/capif +REGISTRY="labs.etsi.org:5050/ocf/capif" +MANIFEST_AMEND="" for platform in "${PLATFORMS[@]}";do - image_name="nginx:$NGINX_VERSION-ocf-patched" + image_name="nginx-ocf-patched:$NGINX_VERSION" echo "$image_name pulled for platform $platform" container_id=$(docker run -d --platform=$platform --name build-nginx debian:bullseye sleep infinity) @@ -97,7 +98,6 @@ for platform in "${PLATFORMS[@]}";do echo '✅ NGINX build completed.' " - MANIFEST_AMEND="" tag=$(echo $platform | awk -F'/' '{print $NF}') -- GitLab From 8bec2f1d93d2ffe39ec30a5302f0db9352638866 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Thu, 12 Jun 2025 12:13:05 +0300 Subject: [PATCH 141/157] Add zfill to negotiation function and edit supportedFeatures in tests to contain 3 characters --- .../published_apis/core/serviceapidescriptions.py | 8 +++++++- tests/features/Api Status/api_status.robot | 6 +++--- tests/features/Event Filter/event_filter.robot | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py index 15f04886..cd1ab91b 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py @@ -45,7 +45,7 @@ def return_negotiated_supp_feat_dict(supp_feat): "RNAA": True if final_supp_feat[7] == "1" else False, "VendorExt": True if final_supp_feat[8] == "1" else False, "SliceBasedAPIExposure": True if final_supp_feat[9] == "1" else False, - "Final": hex(int(final_supp_feat[::-1], 2))[2:] + "Final": hex(int(final_supp_feat[::-1], 2))[2:].zfill(3) } class PublishServiceOperations(Resource): @@ -317,7 +317,13 @@ class PublishServiceOperations(Resource): service_api_description["apf_id"] = serviceapidescription_old["apf_id"] service_api_description["onboarding_date"] = serviceapidescription_old["onboarding_date"] service_api_description["api_id"] = serviceapidescription_old["api_id"] + current_app.logger.debug("************** Diff of suppfeat **************") + current_app.logger.debug(service_api_description["supported_features"]) service_api_description["supported_features"] = return_negotiated_supp_feat_dict(service_api_description["supported_features"])["Final"] + current_app.logger.debug(service_api_description["supported_features"]) + current_app.logger.debug(service_api_description["supported_features"]) + current_app.logger.debug(service_api_description.get("supported_features")) + current_app.logger.debug("************** Diff of suppfeat **************") if not return_negotiated_supp_feat_dict(service_api_description.get("supported_features"))["ApiStatusMonitoring"] and service_api_description.get("api_status", None) is not None: return bad_request_error( diff --git a/tests/features/Api Status/api_status.robot b/tests/features/Api Status/api_status.robot index 9e9f92f9..d4798e76 100644 --- a/tests/features/Api Status/api_status.robot +++ b/tests/features/Api Status/api_status.robot @@ -1155,7 +1155,7 @@ Update published API with apiStatus empty and apiStatusMonitoring active ${service_api_description_modified}= Create Service Api Description ... service_1 ... aef_id=${aef_ids} - ... supported_features=20 + ... supported_features=020 ... api_status=${aef_empty_list} ${resp}= Put Request Capif ... ${resource_url.path} @@ -1260,7 +1260,7 @@ Update published API with apiStatus only aef2 and apiStatusMonitoring active ${service_api_description_modified}= Create Service Api Description ... service_1 ... aef_id=${aef_ids} - ... supported_features=20 + ... supported_features=020 ... api_status=${aef_id_2} ${resp}= Put Request Capif ... ${resource_url.path} @@ -1357,7 +1357,7 @@ Published API without aefs available updated to one aef available ${service_api_description_modified}= Create Service Api Description ... service_1 ... aef_id=${aef_ids} - ... supported_features=20 + ... supported_features=020 ... api_status=${aef_id_2} ${resp}= Put Request Capif ... ${resource_url.path} diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index 95f94310..9853646b 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -84,7 +84,7 @@ Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE ${service_api_description_modified}= Create Service Api Description ... service_1 ... aef_id=${aef_ids} - ... supported_features=20 + ... supported_features=020 ... api_status=${aef_ids} ${resp}= Put Request Capif ... ${resource_url.path} -- GitLab From 12ee9e1d8bf9a5836794732f37d553fff705621d Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Fri, 13 Jun 2025 11:25:19 +0300 Subject: [PATCH 142/157] Fix robot file of capif event to take the response from the publish api when creating an event --- tests/features/CAPIF Api Events/capif_events_api.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index 4b37d0a6..941cb6d0 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -344,7 +344,7 @@ Invoker subscribe to Service API Update ${events_expected}= Create Expected Service Update Event ... ${subscription_id} ... ${resource_url} - ... ${service_api_description_modified} + ... ${resp.json()} ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} -- GitLab From fc843a4a473400760ff3703a5135f773d782d614 Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Mon, 16 Jun 2025 14:11:49 +0200 Subject: [PATCH 143/157] Patch Invoker Management --- ...pi_invoker_enrolment_details_controller.py | 46 +++++++++++++++- .../core/apiinvokerenrolmentdetails.py | 55 ++++++++++++++++++- 2 files changed, 97 insertions(+), 4 deletions(-) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py index 052679b4..a033932b 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py @@ -1,7 +1,44 @@ +from flask import current_app, request +from functools import wraps +from cryptography import x509 +from cryptography.hazmat.backends import default_backend + +from ..core.apiinvokerenrolmentdetails import InvokerManagementOperations +from ..core.validate_user import ControlAccess from api_invoker_management.models.api_invoker_enrolment_details_patch import \ APIInvokerEnrolmentDetailsPatch # noqa: E501 +invoker_operations = InvokerManagementOperations() +valid_user = ControlAccess() + + +def cert_validation(): + def _cert_validation(f): + @wraps(f) + def __cert_validation(*args, **kwargs): + + args = request.view_args + cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_raw = cert_tmp.replace('\t', '') + + cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) + + cn = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value.strip() + + if cn != "superadmin": + cert_signature = cert.signature.hex() + result = valid_user.validate_user_cert(args["onboardingId"], cert_signature) + if result is not None: + return result + + result = f(**kwargs) + return result + return __cert_validation + return _cert_validation + + +@cert_validation() def modify_ind_api_invoke_enrolment(onboarding_id, body): # noqa: E501 """modify_ind_api_invoke_enrolment @@ -14,6 +51,11 @@ def modify_ind_api_invoke_enrolment(onboarding_id, body): # noqa: E501 :rtype: Union[APIInvokerEnrolmentDetails, Tuple[APIInvokerEnrolmentDetails, int], Tuple[APIInvokerEnrolmentDetails, int, Dict[str, str]] """ + current_app.logger.info("Updating invoker") if request.is_json: - api_invoker_enrolment_details_patch = APIInvokerEnrolmentDetailsPatch.from_dict(request.get_json()) # noqa: E501 - return 'do some magic!' + body = APIInvokerEnrolmentDetailsPatch.from_dict(request.get_json()) # noqa: E501 + + res = invoker_operations.patch_apiinvokerenrolmentdetail(onboarding_id, body) + + return res + diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py index e3164aeb..17ec3e5d 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py @@ -11,7 +11,7 @@ from flask import Response, current_app from pymongo import ReturnDocument from ..config import Config -from ..util import dict_to_camel_case, serialize_clean_camel_case +from ..util import dict_to_camel_case, serialize_clean_camel_case, clean_empty from .auth_manager import AuthManager from .publisher import Publisher from .redis_event import RedisEvent @@ -136,6 +136,57 @@ class InvokerManagementOperations(Resource): self.auth_manager.update_auth_invoker( cert['data']["certificate"], onboard_id) + apiinvokerenrolmentdetail.api_invoker_id = onboard_id + apiinvokerenrolmentdetail_update = apiinvokerenrolmentdetail.to_dict() + apiinvokerenrolmentdetail_update = clean_empty(apiinvokerenrolmentdetail_update) + + result = mycol.find_one_and_replace(result, + apiinvokerenrolmentdetail_update, + projection={'_id': 0}, + return_document=ReturnDocument.AFTER, + upsert=False) + + + current_app.logger.debug("Invoker Resource inserted in database") + + invoker_updated = APIInvokerEnrolmentDetails().from_dict(dict_to_camel_case(result)) + current_app.logger.debug(f"Invoker Updated: {invoker_updated}") + + res = make_response(object=serialize_clean_camel_case( + invoker_updated), status=200) + if res.status_code == 200: + current_app.logger.info("Invoker Updated") + RedisEvent("API_INVOKER_UPDATED", + api_invoker_ids=[onboard_id]).send_event() + return res + + except Exception as e: + exception = "An exception occurred in update invoker" + current_app.logger.error(exception + "::" + str(e)) + return internal_server_error(detail=exception, cause=str(e)) + + def patch_apiinvokerenrolmentdetail(self, onboard_id, apiinvokerenrolmentdetail): + + mycol = self.db.get_col_by_name(self.db.invoker_enrolment_details) + + try: + current_app.logger.debug("Patching invoker resource") + result = self.__check_api_invoker_id(onboard_id) + + if isinstance(result, Response): + return result + + if apiinvokerenrolmentdetail.onboarding_information: + if apiinvokerenrolmentdetail.onboarding_information.api_invoker_public_key != result["onboarding_information"]["api_invoker_public_key"]: + cert = self.__sign_cert( + apiinvokerenrolmentdetail.onboarding_information.api_invoker_public_key, result["api_invoker_id"]) + apiinvokerenrolmentdetail.onboarding_information.api_invoker_certificate = cert[ + 'data']['certificate'] + self.auth_manager.update_auth_invoker( + cert['data']["certificate"], onboard_id) + else: + apiinvokerenrolmentdetail.onboarding_information.api_invoker_certificate = result["onboarding_information"]["api_invoker_certificate"] + apiinvokerenrolmentdetail_update = apiinvokerenrolmentdetail.to_dict() apiinvokerenrolmentdetail_update = { key: value for key, value in apiinvokerenrolmentdetail_update.items() if value is not None @@ -158,7 +209,7 @@ class InvokerManagementOperations(Resource): res = make_response(object=serialize_clean_camel_case( invoker_updated), status=200) if res.status_code == 200: - current_app.logger.info("Invoker Updated") + current_app.logger.info("Invoker Patched") RedisEvent("API_INVOKER_UPDATED", api_invoker_ids=[onboard_id]).send_event() return res -- GitLab From 6214d3cd4bdd37366b080f12af8d13a0ea71e6bd Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Mon, 23 Jun 2025 09:48:21 +0300 Subject: [PATCH 144/157] Set supported_features equal to 000 for the Publish API test running --- .../published_apis/core/serviceapidescriptions.py | 6 ------ tests/features/CAPIF Api Events/capif_events_api.robot | 2 +- tests/libraries/api_publish_service/bodyRequests.py | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py index cd1ab91b..658957ef 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py @@ -317,13 +317,7 @@ class PublishServiceOperations(Resource): service_api_description["apf_id"] = serviceapidescription_old["apf_id"] service_api_description["onboarding_date"] = serviceapidescription_old["onboarding_date"] service_api_description["api_id"] = serviceapidescription_old["api_id"] - current_app.logger.debug("************** Diff of suppfeat **************") - current_app.logger.debug(service_api_description["supported_features"]) service_api_description["supported_features"] = return_negotiated_supp_feat_dict(service_api_description["supported_features"])["Final"] - current_app.logger.debug(service_api_description["supported_features"]) - current_app.logger.debug(service_api_description["supported_features"]) - current_app.logger.debug(service_api_description.get("supported_features")) - current_app.logger.debug("************** Diff of suppfeat **************") if not return_negotiated_supp_feat_dict(service_api_description.get("supported_features"))["ApiStatusMonitoring"] and service_api_description.get("api_status", None) is not None: return bad_request_error( diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index 941cb6d0..4b37d0a6 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -344,7 +344,7 @@ Invoker subscribe to Service API Update ${events_expected}= Create Expected Service Update Event ... ${subscription_id} ... ${resource_url} - ... ${resp.json()} + ... ${service_api_description_modified} ## Check Events Expected towards received notifications at mock server Wait Until Keyword Succeeds 5x 5s Check Mock Server Notification Events ${events_expected} diff --git a/tests/libraries/api_publish_service/bodyRequests.py b/tests/libraries/api_publish_service/bodyRequests.py index 046e8e18..5f969a54 100644 --- a/tests/libraries/api_publish_service/bodyRequests.py +++ b/tests/libraries/api_publish_service/bodyRequests.py @@ -1,6 +1,6 @@ def create_service_api_description(api_name="service_1", aef_id="aef_id", - supported_features="0", + supported_features="000", vendor_specific_service_api_description=None, vendor_specific_aef_profile=None, api_status=None, -- GitLab From 08ebf7b1a00f481f89bcf99242b2db386a751f97 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Mon, 23 Jun 2025 16:26:29 +0300 Subject: [PATCH 145/157] Add auth_utils with hashing and verification functions, the functionality for custom and admin users --- services/register/register_service/app.py | 11 ++++++++--- .../controllers/register_controller.py | 8 +++++--- .../register_service/core/register_operations.py | 4 ++++ .../register/register_service/utils/auth_utils.py | 10 ++++++++++ services/register/requirements.txt | 2 +- 5 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 services/register/register_service/utils/auth_utils.py diff --git a/services/register/register_service/app.py b/services/register/register_service/app.py index 378bf88c..60447746 100644 --- a/services/register/register_service/app.py +++ b/services/register/register_service/app.py @@ -10,6 +10,7 @@ from db.db import MongoDatabse from flask import Flask from flask_jwt_extended import JWTManager from OpenSSL.crypto import FILETYPE_PEM, TYPE_RSA, PKey, X509Req, dump_certificate_request, dump_privatekey +from utils.auth_utils import hash_password app = Flask(__name__) @@ -87,9 +88,13 @@ key_data = json.loads(response.text)["data"]["data"]["key"] # Create an Admin in the Admin Collection client = MongoDatabse() -if not client.get_col_by_name(client.capif_admins).find_one({"admin_name": config["register"]["admin_users"]["admin_user"], "admin_pass": config["register"]["admin_users"]["admin_pass"]}): - print(f'Inserting Initial Admin admin_name: {config["register"]["admin_users"]["admin_user"]}, admin_pass: {config["register"]["admin_users"]["admin_pass"]}') - client.get_col_by_name(client.capif_admins).insert_one({"admin_name": config["register"]["admin_users"]["admin_user"], "admin_pass": config["register"]["admin_users"]["admin_pass"]}) +admin_username = config["register"]["admin_users"]["admin_user"] +admin_password = config["register"]["admin_users"]["admin_pass"] + +if not client.get_col_by_name(client.capif_admins).find_one({"admin_name": admin_username}): + print(f'Inserting Initial Admin admin_name: {config["register"]["admin_users"]["admin_user"]}') + + client.get_col_by_name(client.capif_admins).insert_one({"admin_name": config["register"]["admin_users"]["admin_user"], "admin_pass": hash_password(config["register"]["admin_users"]["admin_pass"])}) app.config['JWT_ALGORITHM'] = 'RS256' diff --git a/services/register/register_service/controllers/register_controller.py b/services/register/register_service/controllers/register_controller.py index 93d7fafd..031185eb 100644 --- a/services/register/register_service/controllers/register_controller.py +++ b/services/register/register_service/controllers/register_controller.py @@ -9,6 +9,7 @@ from core.register_operations import RegisterOperations from db.db import MongoDatabse from flask import Blueprint, current_app, jsonify, request from flask_httpauth import HTTPBasicAuth +from utils.auth_utils import check_password auth = HTTPBasicAuth() @@ -39,15 +40,16 @@ def verify_password(username, password): current_app.logger.debug("Checking user credentials...") users = register_operation.get_users()[0].json["users"] client = MongoDatabse() - admin = client.get_col_by_name(client.capif_admins).find_one({"admin_name": username, "admin_pass": password}) - if admin: + admin = client.get_col_by_name(client.capif_admins).find_one({"admin_name": username}) + if admin and check_password(password, admin["admin_pass"]): current_app.logger.debug(f"Verified admin {username}") return username, "admin" for user in users: - if user["username"] == username and user["password"]==password: + if user["username"] == username and check_password(password, user["password"]): current_app.logger.debug(f"Verified user {username}") return username, "client" + # Function responsible for verifying the token def admin_required(): def decorator(f): diff --git a/services/register/register_service/core/register_operations.py b/services/register/register_service/core/register_operations.py index 844ce951..8dc4a2ea 100644 --- a/services/register/register_service/core/register_operations.py +++ b/services/register/register_service/core/register_operations.py @@ -8,6 +8,7 @@ from db.db import MongoDatabse from flask import current_app, jsonify from flask_jwt_extended import create_access_token from utils.utils import convert_dict_keys_to_snake_case, to_snake_case, validate_snake_case_keys +from utils.auth_utils import hash_password class RegisterOperations: @@ -31,6 +32,7 @@ class RegisterOperations: user_info["uuid"] = user_uuid user_info["onboarding_date"]=datetime.now() + user_info["password"] = hash_password(user_info["password"]) mycol.insert_one(user_info) current_app.logger.debug(f"User with uuid {user_uuid} and username {user_info["username"]} registered successfully") @@ -90,7 +92,9 @@ class RegisterOperations: mycol = self.db.get_col_by_name(self.db.capif_users) try: + current_app.logger.debug(f"users") users=list(mycol.find({}, {"_id":0})) + current_app.logger.debug(f"{users}") return jsonify(message="Users successfully obtained", users=users), 200 except Exception as e: return jsonify(message=f"Error trying to get users: {e}"), 500 diff --git a/services/register/register_service/utils/auth_utils.py b/services/register/register_service/utils/auth_utils.py new file mode 100644 index 00000000..1216989b --- /dev/null +++ b/services/register/register_service/utils/auth_utils.py @@ -0,0 +1,10 @@ +import bcrypt + + +def hash_password(password): + hashed_password = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt()) + return hashed_password.decode('utf-8') + + +def check_password(input_password, stored_password): + return bcrypt.checkpw(input_password.encode('utf-8'), stored_password.encode('utf-8')) \ No newline at end of file diff --git a/services/register/requirements.txt b/services/register/requirements.txt index 15c8c083..dc9b58d9 100644 --- a/services/register/requirements.txt +++ b/services/register/requirements.txt @@ -6,7 +6,7 @@ flask_jwt_extended == 4.6.0 pyopenssl == 24.1.0 pyyaml == 6.0.1 requests == 2.32.2 -bcrypt == 4.0.1 +bcrypt == 4.3.0 flask_httpauth == 4.8.0 gunicorn == 23.0.0 packaging == 24.0 -- GitLab From 41cfb42f265591d27d4bf2f377c0dc75bfa6f29d Mon Sep 17 00:00:00 2001 From: fragkosd Date: Tue, 24 Jun 2025 12:11:07 +0000 Subject: [PATCH 146/157] add supported features for Logging API --- .../api_invocation_logs/core/invocationlogs.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py index 1e8ddf4f..614181d9 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py @@ -12,6 +12,17 @@ from .redis_event import RedisEvent from .resources import Resource from .responses import internal_server_error, make_response, not_found_error, unauthorized_error +TOTAL_FEATURES = 1 +SUPPORTED_FEATURES_HEX = "0" + +def return_negotiated_supp_feat_dict(supp_feat): + + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] + + return { + "SliceBasedAPIExposure": True if final_supp_feat[0] == "1" else False, + "Final": hex(int(final_supp_feat[::-1], 2))[2:] + } class LoggingInvocationOperations(Resource): @@ -78,6 +89,8 @@ class LoggingInvocationOperations(Resource): if result is not None: return result + invocationlog.supported_features = return_negotiated_supp_feat_dict(invocationlog.supported_features)["Final"] + current_app.logger.debug("Check service apis") event = None invocation_log_base = json.loads(json.dumps( -- GitLab From afd06a811be779a9585ed0b1df20537c76a67779 Mon Sep 17 00:00:00 2001 From: fragkosd Date: Tue, 24 Jun 2025 12:11:50 +0000 Subject: [PATCH 147/157] set supported_features equal to 0 for the Logging API test --- tests/libraries/api_logging_service/bodyRequests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/libraries/api_logging_service/bodyRequests.py b/tests/libraries/api_logging_service/bodyRequests.py index a4d2a187..0de84c28 100644 --- a/tests/libraries/api_logging_service/bodyRequests.py +++ b/tests/libraries/api_logging_service/bodyRequests.py @@ -3,7 +3,7 @@ def create_log_entry(aefId, apiInvokerId, apiId, apiName, results=['200','500'], "aefId": aefId, "apiInvokerId": apiInvokerId, "logs": [], - "supportedFeatures": "ffff" + "supportedFeatures": "0" } if len(results) > 0: count=0 @@ -52,7 +52,7 @@ def create_log_entry_bad_service(aefId, apiInvokerId, result='500'): "fwdInterface": "string" } ], - "supportedFeatures": "ffff" + "supportedFeatures": "0" } return data @@ -89,4 +89,4 @@ def create_log(apiId, apiName, result, api_version='v1'): ] } } - return log \ No newline at end of file + return log -- GitLab From 2b00570e28d55884506c9982777ff3acf0a3cd64 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Tue, 24 Jun 2025 16:48:36 +0300 Subject: [PATCH 148/157] Add cert_validation in Discover --- .../config.yaml | 1 + .../controllers/default_controller.py | 33 ++++++++++++++- .../service_apis/core/validate_user.py | 42 +++++++++++++++++++ .../service_apis/db/db.py | 1 + 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 services/TS29222_CAPIF_Discover_Service_API/service_apis/core/validate_user.py diff --git a/services/TS29222_CAPIF_Discover_Service_API/config.yaml b/services/TS29222_CAPIF_Discover_Service_API/config.yaml index 6257115b..47851c02 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/config.yaml +++ b/services/TS29222_CAPIF_Discover_Service_API/config.yaml @@ -5,6 +5,7 @@ mongo: { 'col': 'serviceapidescriptions', 'invokers_col': 'invokerdetails', 'capif_users_col': "user", + 'certs_col': "certs", 'host': 'mongo', 'port': "27017" } diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py index d1922947..f742f499 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py @@ -1,13 +1,44 @@ import json - +from functools import wraps +from cryptography import x509 +from cryptography.hazmat.backends import default_backend from flask import current_app, request from service_apis.models.discovered_apis import DiscoveredAPIs # noqa: E501 from ..core.discoveredapis import DiscoverApisOperations, return_negotiated_supp_feat_dict +from ..core.validate_user import ControlAccess discover_apis = DiscoverApisOperations() +valid_user = ControlAccess() + +def cert_validation(): + def _cert_validation(f): + @wraps(f) + def __cert_validation(*args, **kwargs): + + args = request.view_args + cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_raw = cert_tmp.replace('\t', '') + + cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) + + cn = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value.strip() + + if cn != "superadmin": + cert_signature = cert.signature.hex() + current_app.logger.debug(request.args) + result = valid_user.validate_user_cert(request.args["api-invoker-id"], cert_signature) + + if result is not None: + return result + + result = f(**kwargs) + return result + return __cert_validation + return _cert_validation +@cert_validation() def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_type=None, protocol=None, aef_id=None, data_format=None, api_cat=None, preferred_aef_loc=None, req_api_prov_name=None, supported_features=None, api_supported_features=None, ue_ip_addr=None, service_kpis=None, grant_types=None): # noqa: E501 """all_service_apis_get diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/validate_user.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/validate_user.py new file mode 100644 index 00000000..acde719f --- /dev/null +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/validate_user.py @@ -0,0 +1,42 @@ +import json + +from flask import Response, current_app + +from ..encoder import CustomJSONEncoder +from ..models.problem_details import ProblemDetails +from ..util import serialize_clean_camel_case +from .resources import Resource +from .responses import internal_server_error + + +class ControlAccess(Resource): + + def validate_user_cert(self, api_invoker_id, cert_signature): + + cert_col = self.db.get_col_by_name(self.db.certs_col) + + try: + my_query = {'invoker_id':api_invoker_id} + cert_entry = cert_col.find_one(my_query) + + current_app.logger.debug("*****************") + current_app.logger.debug(cert_entry) + current_app.logger.debug("*****************") + + my_query = {'id': api_invoker_id} + cert_entry = cert_col.find_one(my_query) + + current_app.logger.debug("*****************") + current_app.logger.debug(cert_entry) + current_app.logger.debug("*****************") + + if cert_entry is not None: + if cert_entry["cert_signature"] != cert_signature: + prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") + prob = serialize_clean_camel_case(prob) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") + + except Exception as e: + exception = "An exception occurred in validate invoker" + current_app.logger.error(exception + "::" + str(e)) + return internal_server_error(detail=exception, cause=str(e)) \ No newline at end of file diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/db/db.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/db/db.py index 39b1889d..15e7e138 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/db/db.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/db/db.py @@ -20,6 +20,7 @@ class MongoDatabse(): self.invoker_col = self.config['mongo']['invokers_col'] self.service_api_descriptions = self.config['mongo']['col'] self.capif_users = self.config['mongo']['capif_users_col'] + self.certs_col = self.config['mongo']['certs_col'] def get_col_by_name(self, name): -- GitLab From fc6dd09aa57fca3ad765cba6fdeb3484b2ab152c Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Wed, 25 Jun 2025 14:38:06 +0300 Subject: [PATCH 149/157] Add cert_validation in Event APIs --- .../controllers/default_controller.py | 11 +++++++--- .../capif_events/core/validate_user.py | 20 +++++++++++++++++++ .../CAPIF Api Events/capif_events_api.robot | 8 ++++---- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py b/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py index f55aeb40..5779552f 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py @@ -27,7 +27,10 @@ def cert_validation(): if cn != "superadmin": cert_signature = cert.signature.hex() - result = valid_user.validate_user_cert(args["subscriptionId"], args["subscriberId"], cert_signature) + if request.method != 'POST': + result = valid_user.validate_user_cert(args["subscriptionId"], args["subscriberId"], cert_signature) + else: + result = valid_user.validate_user_cert_post(args["subscriberId"], cert_signature) if result is not None: return result @@ -37,6 +40,8 @@ def cert_validation(): return __cert_validation return _cert_validation + +@cert_validation() def subscriber_id_subscriptions_post(subscriber_id, body): # noqa: E501 """subscriber_id_subscriptions_post @@ -76,7 +81,7 @@ def subscriber_id_subscriptions_subscription_id_delete(subscriber_id, subscripti return res - +@cert_validation() def subscriber_id_subscriptions_subscription_id_patch(subscriber_id, subscription_id, body): # noqa: E501 """subscriber_id_subscriptions_subscription_id_patch @@ -97,7 +102,7 @@ def subscriber_id_subscriptions_subscription_id_patch(subscriber_id, subscriptio res = events_ops.patch_event(body, subscriber_id, subscription_id) return res - +@cert_validation() def subscriber_id_subscriptions_subscription_id_put(subscriber_id, subscription_id, body): # noqa: E501 """subscriber_id_subscriptions_subscription_id_put diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py b/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py index 2357408a..40d0bb5c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py @@ -26,6 +26,26 @@ class ControlAccess(Resource): return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") + except Exception as e: + exception = "An exception occurred in validate subscriber" + current_app.logger.error(exception + "::" + str(e)) + return internal_server_error(detail=exception, cause=str(e)) + + def validate_user_cert_post(self, subscriber_id, cert_signature): + + cert_col = self.db.get_col_by_name(self.db.certs_col) + + try: + my_query = {'id':subscriber_id} + cert_entry = cert_col.find_one(my_query) + + if cert_entry is not None: + if cert_entry["cert_signature"] != cert_signature: + prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") + prob = serialize_clean_camel_case(prob) + + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") + except Exception as e: exception = "An exception occurred in validate subscriber" current_app.logger.error(exception + "::" + str(e)) diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index 4b37d0a6..f78c9320 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -528,7 +528,7 @@ Provider receives an ACL unavailable event when invoker remove Security Context. ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing ... supported_features=4 ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions + ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt @@ -603,7 +603,7 @@ Invoker receives an Invoker Authorization Revoked and ACL unavailable event when ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing ... supported_features=4 ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions + ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt @@ -1065,7 +1065,7 @@ Provider receives an ACL unavailable event when invoker remove Security Context ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing ... supported_features=0 ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions + ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt @@ -1141,7 +1141,7 @@ Invoker receives an Invoker Authorization Revoked and ACL unavailable event when ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing ... supported_features=0 ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions + ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt -- GitLab From 941d69d3fd4d1c92a370c497c4c795f758d7f9e6 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Wed, 25 Jun 2025 16:04:25 +0300 Subject: [PATCH 150/157] Add cert_validation in Audit and Logging APIs. Fix some tests according to cert validation --- .../TS29222_CAPIF_Auditing_API/config.yaml | 1 + .../logs/controllers/default_controller.py | 32 +++++++++++++++++++ .../TS29222_CAPIF_Auditing_API/logs/db/db.py | 1 + .../controllers/default_controller.py | 3 ++ .../api_invocation_logs/db/db.py | 1 + .../config.yaml | 1 + .../features/Event Filter/event_filter.robot | 2 +- 7 files changed, 40 insertions(+), 1 deletion(-) diff --git a/services/TS29222_CAPIF_Auditing_API/config.yaml b/services/TS29222_CAPIF_Auditing_API/config.yaml index 6943b303..116076c1 100644 --- a/services/TS29222_CAPIF_Auditing_API/config.yaml +++ b/services/TS29222_CAPIF_Auditing_API/config.yaml @@ -4,6 +4,7 @@ mongo: { 'db': 'capif', 'logs_col': 'invocationlogs', 'capif_users_col': "user", + 'certs_col': "certs", 'host': 'mongo', 'port': "27017" } diff --git a/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py b/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py index 0ff05f0d..0f2866e5 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py @@ -3,13 +3,45 @@ from logs import util from logs.models.interface_description import InterfaceDescription # noqa: E501 from logs.models.operation import Operation # noqa: E501 from logs.models.protocol import Protocol # noqa: E501 +from functools import wraps +from cryptography import x509 +from cryptography.hazmat.backends import default_backend from ..core.auditoperations import AuditOperations from ..core.responses import bad_request_error +from ..core.validate_user import ControlAccess audit_operations = AuditOperations() +valid_user = ControlAccess() +def cert_validation(): + def _cert_validation(f): + @wraps(f) + def __cert_validation(*args, **kwargs): + + args = request.view_args + cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_raw = cert_tmp.replace('\t', '') + + cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) + + cn = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value.strip() + + if cn != "superadmin": + cert_signature = cert.signature.hex() + result = valid_user.validate_user_cert(cert_signature) + + if result is not None: + return result + + result = f(**kwargs) + return result + return __cert_validation + return _cert_validation + + +@cert_validation() def api_invocation_logs_get(aef_id=None, api_invoker_id=None, time_range_start=None, time_range_end=None, api_id=None, api_name=None, api_version=None, protocol=None, operation=None, result=None, resource_name=None, src_interface=None, dest_interface=None, supported_features=None): # noqa: E501 """api_invocation_logs_get diff --git a/services/TS29222_CAPIF_Auditing_API/logs/db/db.py b/services/TS29222_CAPIF_Auditing_API/logs/db/db.py index 4520c846..108793c1 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/db/db.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/db/db.py @@ -19,6 +19,7 @@ class MongoDatabse(): self.db = self.__connect() self.invocation_logs = self.config['mongo']['logs_col'] self.capif_users = self.config['mongo']['capif_users_col'] + self.certs_col = self.config['mongo']['certs_col'] def get_col_by_name(self, name): return self.db[name] diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py index c91cce60..f23e6028 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py @@ -2,6 +2,7 @@ from api_invocation_logs.models.invocation_log import InvocationLog # noqa: E50 from cryptography import x509 from cryptography.hazmat.backends import default_backend from flask import current_app, request +from functools import wraps from ..core.invocationlogs import LoggingInvocationOperations from ..core.validate_user import ControlAccess @@ -10,6 +11,7 @@ logging_invocation_operations = LoggingInvocationOperations() valid_user = ControlAccess() + def cert_validation(): def _cert_validation(f): @wraps(f) @@ -36,6 +38,7 @@ def cert_validation(): return _cert_validation +@cert_validation() def aef_id_logs_post(aef_id, body): # noqa: E501 """aef_id_logs_post diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/db/db.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/db/db.py index 1999a2da..5cf1f6c7 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/db/db.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/db/db.py @@ -22,6 +22,7 @@ class MongoDatabse(): self.provider_details = self.config['mongo']['prov_col'] self.service_apis = self.config['mongo']['serv_col'] self.capif_users = self.config['mongo']['capif_users_col'] + self.certs_col = self.config['mongo']['certs_col'] def get_col_by_name(self, name): return self.db[name] diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/config.yaml b/services/TS29222_CAPIF_Logging_API_Invocation_API/config.yaml index 0625fc64..8b8825bd 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/config.yaml +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/config.yaml @@ -7,6 +7,7 @@ mongo: { 'prov_col': 'providerenrolmentdetails', 'serv_col': 'serviceapidescriptions', 'capif_users_col': "user", + 'certs_col': "certs", 'host': 'mongo', 'port': "27017" } diff --git a/tests/features/Event Filter/event_filter.robot b/tests/features/Event Filter/event_filter.robot index 9853646b..a480248e 100644 --- a/tests/features/Event Filter/event_filter.robot +++ b/tests/features/Event Filter/event_filter.robot @@ -1007,7 +1007,7 @@ Send Log Message to CAPIF ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt - ... username=${provider_info['amf_username']} + ... username=${provider_info['aef_username']} Check Response Variable Type And Values ${resp} 201 InvocationLog ${resource_url}= Check Location Header ${resp} ${LOCATION_LOGGING_RESOURCE_REGEX} -- GitLab From 940efcb61a374192bc142bfd06fc0d3e4a0c428c Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Wed, 25 Jun 2025 16:05:26 +0300 Subject: [PATCH 151/157] Add neccesary file to vaildate user in Audit --- .../logs/core/validate_user.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 services/TS29222_CAPIF_Auditing_API/logs/core/validate_user.py diff --git a/services/TS29222_CAPIF_Auditing_API/logs/core/validate_user.py b/services/TS29222_CAPIF_Auditing_API/logs/core/validate_user.py new file mode 100644 index 00000000..545642e1 --- /dev/null +++ b/services/TS29222_CAPIF_Auditing_API/logs/core/validate_user.py @@ -0,0 +1,31 @@ +import json + +from flask import Response, current_app + +from ..encoder import CustomJSONEncoder +from ..models.problem_details import ProblemDetails +from ..util import serialize_clean_camel_case +from .resources import Resource +from .responses import internal_server_error + + +class ControlAccess(Resource): + + def validate_user_cert(self, cert_signature): + + cert_col = self.db.get_col_by_name(self.db.certs_col) + + try: + my_query = {'cert_signature': cert_signature} + cert_entry = cert_col.find_one(my_query) + + if cert_entry is not None: + if cert_entry["role"] != "AMF": + prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") + prob = serialize_clean_camel_case(prob) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") + + except Exception as e: + exception = "An exception occurred in validate invoker" + current_app.logger.error(exception + "::" + str(e)) + return internal_server_error(detail=exception, cause=str(e)) \ No newline at end of file -- GitLab From b14f07fa6d3c4308dd04d56134cd85e4fedc2e87 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Wed, 25 Jun 2025 16:38:45 +0300 Subject: [PATCH 152/157] Remove unneccessary logs --- .../service_apis/core/validate_user.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/validate_user.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/validate_user.py index acde719f..6d2ea40f 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/validate_user.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/validate_user.py @@ -16,20 +16,10 @@ class ControlAccess(Resource): cert_col = self.db.get_col_by_name(self.db.certs_col) try: - my_query = {'invoker_id':api_invoker_id} - cert_entry = cert_col.find_one(my_query) - - current_app.logger.debug("*****************") - current_app.logger.debug(cert_entry) - current_app.logger.debug("*****************") my_query = {'id': api_invoker_id} cert_entry = cert_col.find_one(my_query) - current_app.logger.debug("*****************") - current_app.logger.debug(cert_entry) - current_app.logger.debug("*****************") - if cert_entry is not None: if cert_entry["cert_signature"] != cert_signature: prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") -- GitLab From 4059cc8d89b0c6032554abe4f0ff8a03562405db Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Thu, 26 Jun 2025 17:02:05 +0300 Subject: [PATCH 153/157] Removed the second validation function in Events --- .../controllers/default_controller.py | 2 +- .../capif_events/core/validate_user.py | 32 +++++-------------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py b/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py index 5779552f..5e6cba2d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py @@ -30,7 +30,7 @@ def cert_validation(): if request.method != 'POST': result = valid_user.validate_user_cert(args["subscriptionId"], args["subscriberId"], cert_signature) else: - result = valid_user.validate_user_cert_post(args["subscriberId"], cert_signature) + result = valid_user.validate_user_cert(None, args["subscriberId"], cert_signature) if result is not None: return result diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py b/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py index 40d0bb5c..8d1f8b05 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py @@ -20,33 +20,17 @@ class ControlAccess(Resource): cert_entry = cert_col.find_one(my_query) if cert_entry is not None: - if cert_entry["cert_signature"] != cert_signature or "event_subscriptions" not in cert_entry["resources"] or event_id not in cert_entry["resources"]["event_subscriptions"]: - prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") - prob = serialize_clean_camel_case(prob) + if (event_id is None and cert_entry["cert_signature"] != cert_signature): + prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") + prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") + elif event_id is not None and (cert_entry["cert_signature"] != cert_signature or "event_subscriptions" not in cert_entry["resources"] or event_id not in cert_entry["resources"]["event_subscriptions"]): + prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") + prob = serialize_clean_camel_case(prob) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") except Exception as e: exception = "An exception occurred in validate subscriber" current_app.logger.error(exception + "::" + str(e)) return internal_server_error(detail=exception, cause=str(e)) - - def validate_user_cert_post(self, subscriber_id, cert_signature): - - cert_col = self.db.get_col_by_name(self.db.certs_col) - - try: - my_query = {'id':subscriber_id} - cert_entry = cert_col.find_one(my_query) - - if cert_entry is not None: - if cert_entry["cert_signature"] != cert_signature: - prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") - prob = serialize_clean_camel_case(prob) - - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") - - except Exception as e: - exception = "An exception occurred in validate subscriber" - current_app.logger.error(exception + "::" + str(e)) - return internal_server_error(detail=exception, cause=str(e)) \ No newline at end of file -- GitLab From fbf3d0595e2c9384f635fce460aca343d93985cf Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Thu, 26 Jun 2025 17:23:00 +0300 Subject: [PATCH 154/157] Fix invocator of two tests --- tests/features/CAPIF Api Events/capif_events_api.robot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index f78c9320..4da4228d 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -528,11 +528,11 @@ Provider receives an ACL unavailable event when invoker remove Security Context. ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing ... supported_features=4 ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions + ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt - ... username=${INVOKER_USERNAME} + ... username=${AMF_PROVIDER_USERNAME} # Check Results Check Response Variable Type And Values ${resp} 201 EventSubscription @@ -1065,11 +1065,11 @@ Provider receives an ACL unavailable event when invoker remove Security Context ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing ... supported_features=0 ${resp}= Post Request Capif - ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions + ... /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions ... json=${request_body} ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt - ... username=${INVOKER_USERNAME} + ... username=${AMF_PROVIDER_USERNAME} # Check Results Check Response Variable Type And Values ${resp} 201 EventSubscription -- GitLab From f844a2b7de8a7ae54da7e8f7938c9d971922ad67 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 14 Jul 2025 09:29:59 +0200 Subject: [PATCH 155/157] Fix configmap of discover service --- .../charts/ocf-discover-service-api/templates/configmap.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/helm/capif/charts/ocf-discover-service-api/templates/configmap.yaml b/helm/capif/charts/ocf-discover-service-api/templates/configmap.yaml index 96d0c367..1db82bbf 100644 --- a/helm/capif/charts/ocf-discover-service-api/templates/configmap.yaml +++ b/helm/capif/charts/ocf-discover-service-api/templates/configmap.yaml @@ -11,6 +11,7 @@ data: 'col': 'serviceapidescriptions', 'invokers_col': 'invokerdetails', 'capif_users_col': "user", + 'certs_col': "certs", 'host': 'mongo', 'port': "27017" } -- GitLab From e631ec759ba8530bdb68e7e1bb955c67d189dfdd Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 14 Jul 2025 12:51:03 +0200 Subject: [PATCH 156/157] Add configmap with certs table to each service that need it --- .../charts/ocf-api-invocation-logs/templates/configmap.yaml | 3 ++- .../ocf-api-invoker-management/templates/configmap.yaml | 4 ++-- .../ocf-api-provider-management/templates/configmap.yaml | 2 +- .../charts/ocf-auditing-api-logs/templates/configmap.yaml | 3 ++- .../charts/ocf-discover-service-api/templates/configmap.yaml | 4 ++-- helm/capif/charts/ocf-events/templates/configmap.yaml | 2 +- .../charts/ocf-publish-service-api/templates/configmap.yaml | 4 ++-- helm/capif/charts/ocf-security/templates/configmap.yaml | 2 +- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/helm/capif/charts/ocf-api-invocation-logs/templates/configmap.yaml b/helm/capif/charts/ocf-api-invocation-logs/templates/configmap.yaml index bd13f9f1..8d814ea3 100644 --- a/helm/capif/charts/ocf-api-invocation-logs/templates/configmap.yaml +++ b/helm/capif/charts/ocf-api-invocation-logs/templates/configmap.yaml @@ -12,7 +12,8 @@ data: 'invoker_col': 'invokerdetails', 'prov_col': 'providerenrolmentdetails', 'serv_col': 'serviceapidescriptions', - 'capif_users_col': "user", + 'capif_users_col': 'user', + 'certs_col': 'certs', 'host': 'mongo', 'port': "27017" } diff --git a/helm/capif/charts/ocf-api-invoker-management/templates/configmap.yaml b/helm/capif/charts/ocf-api-invoker-management/templates/configmap.yaml index 4d83c986..f0688893 100644 --- a/helm/capif/charts/ocf-api-invoker-management/templates/configmap.yaml +++ b/helm/capif/charts/ocf-api-invoker-management/templates/configmap.yaml @@ -9,8 +9,8 @@ data: 'password': '{{ .Values.env.mongoInitdbRootPassword }}', 'db': 'capif', 'col': 'invokerdetails', - 'capif_users_col': "user", - 'certs_col': "certs", + 'capif_users_col': 'user', + 'certs_col': 'certs', 'service_col': 'serviceapidescriptions', 'host': 'mongo', 'port': "27017" diff --git a/helm/capif/charts/ocf-api-provider-management/templates/configmap.yaml b/helm/capif/charts/ocf-api-provider-management/templates/configmap.yaml index e59cfe17..6da59dd8 100644 --- a/helm/capif/charts/ocf-api-provider-management/templates/configmap.yaml +++ b/helm/capif/charts/ocf-api-provider-management/templates/configmap.yaml @@ -9,7 +9,7 @@ data: 'password': '{{ .Values.env.mongoInitdbRootPassword }}', 'db': 'capif', 'col': 'providerenrolmentdetails', - 'certs_col': "certs", + 'certs_col': 'certs', 'capif_users': 'user', 'host': 'mongo', 'port': "27017" diff --git a/helm/capif/charts/ocf-auditing-api-logs/templates/configmap.yaml b/helm/capif/charts/ocf-auditing-api-logs/templates/configmap.yaml index 729d751f..b06b6d15 100644 --- a/helm/capif/charts/ocf-auditing-api-logs/templates/configmap.yaml +++ b/helm/capif/charts/ocf-auditing-api-logs/templates/configmap.yaml @@ -9,7 +9,8 @@ data: 'password': '{{ .Values.env.mongoInitdbRootPassword }}', 'db': 'capif', 'logs_col': 'invocationlogs', - 'capif_users_col': "user", + 'capif_users_col': 'user', + 'certs_col': 'certs', 'host': 'mongo', 'port': "27017" } diff --git a/helm/capif/charts/ocf-discover-service-api/templates/configmap.yaml b/helm/capif/charts/ocf-discover-service-api/templates/configmap.yaml index 1db82bbf..1e217915 100644 --- a/helm/capif/charts/ocf-discover-service-api/templates/configmap.yaml +++ b/helm/capif/charts/ocf-discover-service-api/templates/configmap.yaml @@ -10,8 +10,8 @@ data: 'db': 'capif', 'col': 'serviceapidescriptions', 'invokers_col': 'invokerdetails', - 'capif_users_col': "user", - 'certs_col': "certs", + 'capif_users_col': 'user', + 'certs_col': 'certs', 'host': 'mongo', 'port': "27017" } diff --git a/helm/capif/charts/ocf-events/templates/configmap.yaml b/helm/capif/charts/ocf-events/templates/configmap.yaml index e599fef3..92697a2c 100644 --- a/helm/capif/charts/ocf-events/templates/configmap.yaml +++ b/helm/capif/charts/ocf-events/templates/configmap.yaml @@ -9,7 +9,7 @@ data: 'password': '{{ .Values.env.mongoInitdbRootPassword }}', 'db': 'capif', 'col': 'eventsdetails', - 'certs_col': "certs", + 'certs_col': 'certs', 'capif_invokers_col': 'invokerdetails', 'capif_providers_col': 'providerenrolmentdetails', 'capif_acls_col': 'acls', diff --git a/helm/capif/charts/ocf-publish-service-api/templates/configmap.yaml b/helm/capif/charts/ocf-publish-service-api/templates/configmap.yaml index a76b2f2b..651ad05b 100644 --- a/helm/capif/charts/ocf-publish-service-api/templates/configmap.yaml +++ b/helm/capif/charts/ocf-publish-service-api/templates/configmap.yaml @@ -9,8 +9,8 @@ data: 'password': '{{ .Values.env.mongoInitdbRootPassword }}', 'db': 'capif', 'col': 'serviceapidescriptions', - 'certs_col': "certs", - 'capif_provider_col': "providerenrolmentdetails", + 'certs_col': 'certs', + 'capif_provider_col': 'providerenrolmentdetails', 'host': 'mongo', 'port': "27017" } diff --git a/helm/capif/charts/ocf-security/templates/configmap.yaml b/helm/capif/charts/ocf-security/templates/configmap.yaml index 5d099d19..19e0c99b 100644 --- a/helm/capif/charts/ocf-security/templates/configmap.yaml +++ b/helm/capif/charts/ocf-security/templates/configmap.yaml @@ -10,7 +10,7 @@ data: 'db': 'capif', 'col': 'security', 'capif_service_col': 'serviceapidescriptions', - 'certs_col': "certs", + 'certs_col': 'certs', 'capif_invokers' : 'invokerdetails', 'host': 'mongo', 'port': "27017" -- GitLab From b64590c4f4db91ed1644e768da0fc24c306861f0 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 15 Jul 2025 13:48:45 +0200 Subject: [PATCH 157/157] event req moved to a new folder under tests folders --- tests/features/Event Req/__init__.robot | 2 ++ tests/features/{Event Filter => Event Req}/event_req.robot | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 tests/features/Event Req/__init__.robot rename tests/features/{Event Filter => Event Req}/event_req.robot (99%) diff --git a/tests/features/Event Req/__init__.robot b/tests/features/Event Req/__init__.robot new file mode 100644 index 00000000..2b28f206 --- /dev/null +++ b/tests/features/Event Req/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Force Tags event_filter \ No newline at end of file diff --git a/tests/features/Event Filter/event_req.robot b/tests/features/Event Req/event_req.robot similarity index 99% rename from tests/features/Event Filter/event_req.robot rename to tests/features/Event Req/event_req.robot index caddaf9f..26b1b635 100644 --- a/tests/features/Event Filter/event_req.robot +++ b/tests/features/Event Req/event_req.robot @@ -20,7 +20,7 @@ ${SUBSCRIPTION_ID_NOT_VALID} not-valid *** Test Cases *** Invoker subscribe to Service API Available - [Tags] pelayo-1 mockserver + [Tags] event_req-1 mockserver # Initialize Mock server Init Mock Server -- GitLab