From c8ee1b79a198aa2d4443f200493873da4afeb265 Mon Sep 17 00:00:00 2001 From: nacho Date: Tue, 7 Mar 2023 15:06:28 +0100 Subject: [PATCH] update README, set versionns of library, remove unnused librarys and fix nginx conf --- README.md | 14 +++++++------- .../requirements.txt | 10 +++++----- .../requirements.txt | 9 +++++---- .../TS29222_CAPIF_Auditing_API/requirements.txt | 5 ++--- .../requirements.txt | 4 ++-- .../capif_events/__main__.py | 4 +--- .../TS29222_CAPIF_Events_API/requirements.txt | 12 ++++++------ .../requirements.txt | 6 +++--- .../requirements.txt | 8 ++++---- .../capif_security/__main__.py | 3 --- .../TS29222_CAPIF_Security_API/requirements.txt | 12 +++++------- services/nginx/nginx.conf | 16 ++++++++-------- 12 files changed, 48 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index fb851b9b..bdf1948c 100644 --- a/README.md +++ b/README.md @@ -244,13 +244,6 @@ Changes at Services: * Query and retrieve service API invocation logs stored on the CAPIF core function. -# CAPIF Tool Release 3.1 - -* Delete a service automatically if the provider that contains the APF that published it is deleted -* Clear the security context of an invoker automatically if the invoker is deleted -* Delete automatically the entry in the security info of the security context if the provider that has the aef that published the service is deleted -* Delete automatically the entry in the security info of the security context if the service on which that context was created is deleted - Changes at Tests: * **New common scenarios** in order to make easy to describe a test. * New Test plan definition format. @@ -258,6 +251,13 @@ Changes at Tests: * Complete code refactor of all tests * Complete test plan review, including all services (except auditing and logging) +# CAPIF Tool Release 3.1 + +* Delete a service automatically if the provider that contains the APF that published it is deleted +* Clear the security context of an invoker automatically if the invoker is deleted +* Delete automatically the entry in the security info of the security context if the provider that has the aef that published the service is deleted +* Delete automatically the entry in the security info of the security context if the service on which that context was created is deleted + diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt b/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt index 86d08f7b..de9d2229 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt @@ -4,8 +4,8 @@ python_dateutil >= 2.6.0 setuptools >= 21.0.0 Flask == 2.0.3 pymongo == 4.0.1 -flask_jwt_extended -pyopenssl -rfc3987 -redis -flask_executor \ No newline at end of file +flask_jwt_extended == 4.4.4 +pyopenssl == 23.0.0 +rfc3987 == 1.3.8 +redis == 4.5.1 +flask_executor == 1.0.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 edd13c6f..84332fb4 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt +++ b/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt @@ -4,8 +4,9 @@ python_dateutil >= 2.6.0 setuptools >= 21.0.0 Flask == 2.0.3 pymongo == 4.0.1 -redis -flask_jwt_extended -flask_executor -pyopenssl +redis == 4.5.1 +flask_executor == 1.0.0 +flask_jwt_extended == 4.4.4 +pyopenssl == 23.0.0 +rfc3987 == 1.3.8 diff --git a/services/TS29222_CAPIF_Auditing_API/requirements.txt b/services/TS29222_CAPIF_Auditing_API/requirements.txt index 45c243e3..ec07ff82 100644 --- a/services/TS29222_CAPIF_Auditing_API/requirements.txt +++ b/services/TS29222_CAPIF_Auditing_API/requirements.txt @@ -5,6 +5,5 @@ setuptools >= 21.0.0 Flask == 2.0.3 pymongo == 4.0.1 elasticsearch == 8.4.3 -flask_jwt_extended -pyopenssl -flask-mqtt +flask_jwt_extended == 4.4.4 +pyopenssl == 23.0.0 diff --git a/services/TS29222_CAPIF_Discover_Service_API/requirements.txt b/services/TS29222_CAPIF_Discover_Service_API/requirements.txt index d348641b..f815469f 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/requirements.txt +++ b/services/TS29222_CAPIF_Discover_Service_API/requirements.txt @@ -4,5 +4,5 @@ python_dateutil >= 2.6.0 setuptools >= 21.0.0 Flask == 2.0.3 pymongo == 4.0.1 -flask_jwt_extended -pyopenssl \ No newline at end of file +flask_jwt_extended == 4.4.4 +pyopenssl == 23.0.0 diff --git a/services/TS29222_CAPIF_Events_API/capif_events/__main__.py b/services/TS29222_CAPIF_Events_API/capif_events/__main__.py index ef555ce5..96c7a164 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/__main__.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/__main__.py @@ -16,7 +16,6 @@ from multiprocessing import Process from threading import Thread from flask_executor import Executor -from flask_apscheduler import APScheduler from logging.handlers import RotatingFileHandler @@ -61,8 +60,7 @@ def verbose_formatter(): configure_logging(app.app) executor = Executor(app.app) subscriber = Subscriber() -scheduler = APScheduler() -scheduler.init_app(app.app) + @app.app.before_first_request def create_listener_message(): diff --git a/services/TS29222_CAPIF_Events_API/requirements.txt b/services/TS29222_CAPIF_Events_API/requirements.txt index 91e31cef..279753e4 100644 --- a/services/TS29222_CAPIF_Events_API/requirements.txt +++ b/services/TS29222_CAPIF_Events_API/requirements.txt @@ -4,9 +4,9 @@ python_dateutil >= 2.6.0 setuptools >= 21.0.0 Flask == 2.0.3 pymongo == 4.0.1 -flask_jwt_extended -pyopenssl -rfc3987 -redis -flask_executor -Flask-APScheduler +flask_jwt_extended == 4.4.4 +pyopenssl == 23.0.0 +rfc3987 == 1.3.8 +redis == 4.5.1 +flask_executor == 1.0.0 + diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt b/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt index 45c243e3..203f4fad 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt @@ -5,6 +5,6 @@ setuptools >= 21.0.0 Flask == 2.0.3 pymongo == 4.0.1 elasticsearch == 8.4.3 -flask_jwt_extended -pyopenssl -flask-mqtt +flask_jwt_extended == 4.4.4 +pyopenssl == 23.0.0 + diff --git a/services/TS29222_CAPIF_Publish_Service_API/requirements.txt b/services/TS29222_CAPIF_Publish_Service_API/requirements.txt index e7e09b43..acf2b9c8 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/requirements.txt +++ b/services/TS29222_CAPIF_Publish_Service_API/requirements.txt @@ -4,8 +4,8 @@ python_dateutil >= 2.6.0 setuptools >= 21.0.0 Flask == 2.0.3 pymongo == 4.0.1 -flask_jwt_extended -flask_executor -pyopenssl -redis +flask_jwt_extended == 4.4.4 +pyopenssl == 23.0.0 +redis == 4.5.1 +flask_executor == 1.0.0 diff --git a/services/TS29222_CAPIF_Security_API/capif_security/__main__.py b/services/TS29222_CAPIF_Security_API/capif_security/__main__.py index e98259b9..d24b496d 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/__main__.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/__main__.py @@ -8,7 +8,6 @@ from .core.consumer_messager import Subscriber from threading import Thread from flask_executor import Executor -from flask_apscheduler import APScheduler from logging.handlers import RotatingFileHandler import sys @@ -56,8 +55,6 @@ def main(): JWTManager(app.app) subscriber = Subscriber() - scheduler = APScheduler() - scheduler.init_app(app.app) configure_logging(app.app) executor = Executor(app.app) diff --git a/services/TS29222_CAPIF_Security_API/requirements.txt b/services/TS29222_CAPIF_Security_API/requirements.txt index 0854cc80..578188ff 100644 --- a/services/TS29222_CAPIF_Security_API/requirements.txt +++ b/services/TS29222_CAPIF_Security_API/requirements.txt @@ -4,10 +4,8 @@ python_dateutil >= 2.6.0 setuptools >= 21.0.0 Flask == 2.0.3 pymongo == 4.0.1 -flask_jwt_extended -pyjwt -rfc3987 -redis -pyopenssl -flask_executor -Flask-APScheduler \ No newline at end of file +flask_jwt_extended == 4.4.4 +pyopenssl == 23.0.0 +rfc3987 == 1.3.8 +redis == 4.5.1 +flask_executor == 1.0.0 diff --git a/services/nginx/nginx.conf b/services/nginx/nginx.conf index 283fdfac..2599f779 100644 --- a/services/nginx/nginx.conf +++ b/services/nginx/nginx.conf @@ -14,11 +14,11 @@ http { } map "$request_method:$uri:$ssl_client_s_dn_cn" $invoker_error_message { default 'SUCCESS'; - "~*(PUT|DELETE):.*:(?!(invoker))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; + "~*(PUT|DELETE):.*:(?!invoker)(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; } map "$request_method:$uri:$ssl_client_s_dn_cn" $provider_error_message { default 'SUCCESS'; - "~*(PUT|DELETE|PATCH):.*:(?!(amf))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be amf"}'; + "~*(PUT|DELETE|PATCH):.*:(?!amf)(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be amf"}'; } map "$request_method:$uri:$ssl_client_s_dn_cn" $publish_error_message { default 'SUCCESS'; @@ -30,12 +30,12 @@ http { } map "$request_method:$uri:$ssl_client_s_dn_cn" $security_error_message { default 'SUCCESS'; - "~*DELETE:.*:(?!(aef))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; - "~*PUT:.*:(?!(invoker))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; - "~*GET:.*:(?!(aef))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; - "~*POST:.*/update:(?!(invoker))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; - "~*POST:.*/delete:(?!(aef))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; - "~*POST:.*/token:(?!(invoker))(.*)" '{"error":"unauthorized_client", "error_description":"Role not authorized for this API route"}'; + "~*DELETE:.*:(?!aef)(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; + "~*PUT:.*:(?!invoker)(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; + "~*GET:.*:(?!aef)(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; + "~*POST:.*/update:(?!invoker)(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; + "~*POST:.*/delete:(?!aef)(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; + "~*POST:.*/token:(?!invoker)(.*)" '{"error":"unauthorized_client", "error_description":"Role not authorized for this API route"}'; } map "$request_method:$uri:$ssl_client_s_dn_cn" $events_error_message { default 'SUCCESS';