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 a85597dcd2119dfb44f955d47fdd07ec5afc4e42..b4594103fdeb9f9b0c7be4ae9d3ab2deb0a1165d 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 @@ -127,7 +127,8 @@ config = Config() jwt = JWTManager(app.app) configure_logging(app.app) -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": configure_monitoring(app.app, config.get_config()) executor = Executor(app.app) 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 3c3c38bdcc8f19bcf05deb7573e2a1f40110ccee..5a265b6b128a159fbb10f87d0ef375fc32c94a29 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,7 +41,7 @@ class InvokerManagementOperations(Resource): 'common_name': invoker_id } - response = requests.request("POST", url, headers=headers, data=data, verify = False) + response = requests.request("POST", url, headers=headers, data=data, verify = self.config["ca_factory"].get("verify", False)) print(response) response_payload = json.loads(response.text) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/db/db.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/db/db.py index 6cb5a93bca3e130f884139e55951259ee7cb412a..1ef0262504047495eba1c6f05d4d2e3de8d5391d 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/db/db.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/db/db.py @@ -6,7 +6,8 @@ from bson.codec_options import CodecOptions import os from opentelemetry.instrumentation.pymongo import PymongoInstrumentor -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": PymongoInstrumentor().instrument() class MongoDatabse(): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/config.yaml b/services/TS29222_CAPIF_API_Invoker_Management_API/config.yaml index 2a14561d485ebb8a81779e988a54b31f9c894fbb..3107e411fbdaecb7e9bf44f86025d4b27fd81e49 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/config.yaml +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/config.yaml @@ -12,7 +12,8 @@ mongo: { ca_factory: { "url": "vault", "port": "8200", - "token": "dev-only-token" + "token": "dev-only-token", + "verify": False } monitoring: { diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt b/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt index 10f300b8eb9f0ed04ef0b6a98f16796a0f1db207..dbf0f198c54c3dea4807fe473ffcde6d560a528c 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt @@ -1,11 +1,11 @@ connexion[swagger-ui] == 2.14.2; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools >= 21.0.0 +setuptools == 68.2.2 Flask == 2.0.3 -pymongo == 4.3.3 +pymongo == 4.7.3 flask_jwt_extended == 4.4.4 -pyopenssl == 23.0.0 +cryptography == 42.0.8 rfc3987 == 1.3.8 redis == 4.5.4 opentelemetry-instrumentation == 0.40b0 @@ -13,11 +13,12 @@ opentelemetry-instrumentation-flask == 0.40b0 opentelemetry-instrumentation-redis == 0.40b0 opentelemetry-instrumentation-pymongo == 0.40b0 opentelemetry-exporter-otlp == 1.19.0 -opentelemetry-exporter-jaeger==1.17.0 +opentelemetry-exporter-jaeger == 1.17.0 fluent == 0.10.0 fluent-logger == 0.10.0 opentelemetry-api == 1.19.0 opentelemetry-sdk == 1.19.0 flask_executor == 1.0.0 -gunicorn==22.0.0 -packaging==24.0 \ No newline at end of file +Werkzeug == 2.2.3 +gunicorn == 22.0.0 +packaging == 24.0 diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/test-requirements.txt b/services/TS29222_CAPIF_API_Invoker_Management_API/test-requirements.txt index 0970f28c7c5a344d7fd9b9c893c584e7336df266..202a684feef71ff540d6aa528d348febf0b37d1e 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/test-requirements.txt +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/test-requirements.txt @@ -1,4 +1,4 @@ pytest~=4.6.7 # needed for python 2.7+3.4 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 # needed for python 2.7+3.4 +Flask-Testing == 0.8.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 37692057f86f0d0900039edd99576dfcca7e4863..94ca3edcb2b4b9ea9b93ad9b63171ecc6f1d9822 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 @@ -118,7 +118,8 @@ app.add_api('openapi.yaml', config = Config() configure_logging(app.app) -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": configure_monitoring(app.app, config.get_config()) app.app.config['JWT_ALGORITHM'] = 'RS256' 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 159947e476ac184261ecb2f48f3d952537ee0ce9..1e23a8104ede297eaa13a2c870c7df5635ad412c 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 @@ -15,7 +15,7 @@ def sign_certificate(publick_key, provider_id): 'common_name': provider_id } - response = requests.request("POST", url, headers=headers, data=json.dumps(data), verify = False) + response = requests.request("POST", url, headers=headers, data=json.dumps(data), verify = config["ca_factory"].get("verify", False)) response_payload = json.loads(response.text) return response_payload["data"]["certificate"] \ No newline at end of file diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/db/db.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/db/db.py index fcc6169db2432423538a7ea2dbf07ca0b3f3824c..024529c6927f900e815804567bf3dd283c3d2a57 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/db/db.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/db/db.py @@ -6,7 +6,8 @@ from bson.codec_options import CodecOptions import os from opentelemetry.instrumentation.pymongo import PymongoInstrumentor -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": PymongoInstrumentor().instrument() diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/config.yaml b/services/TS29222_CAPIF_API_Provider_Management_API/config.yaml index 7d1899ab7a860fa1a6a0390f5fa4cf85271dc434..ce684f368f6bec6f91775710f96ed097fe0d6bf3 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/config.yaml +++ b/services/TS29222_CAPIF_API_Provider_Management_API/config.yaml @@ -12,7 +12,8 @@ mongo: { ca_factory: { "url": "vault", "port": "8200", - "token": "dev-only-token" + "token": "dev-only-token", + "verify": False } diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt b/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt index c93b338e3de87e1e1261088d59a122d5c38d8c29..a5c9ccef16b0c711e5d502db5efc6f574eb97476 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt +++ b/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt @@ -1,12 +1,12 @@ connexion[swagger-ui] == 2.14.2; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools >= 21.0.0 +setuptools == 68.2.2 Flask == 2.0.3 -pymongo == 4.0.1 +pymongo == 4.7.3 redis == 4.5.4 flask_jwt_extended == 4.4.4 -pyopenssl == 23.0.0 +cryptography == 42.0.8 rfc3987 == 1.3.8 opentelemetry-instrumentation == 0.38b0 opentelemetry-instrumentation-flask == 0.38b0 @@ -18,5 +18,6 @@ fluent-logger == 0.10.0 opentelemetry-api == 1.17.0 opentelemetry-sdk == 1.17.0 flask_executor == 1.0.0 -gunicorn==22.0.0 -packaging==24.0 \ No newline at end of file +Werkzeug == 2.2.3 +gunicorn == 22.0.0 +packaging == 24.0 diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/test-requirements.txt b/services/TS29222_CAPIF_API_Provider_Management_API/test-requirements.txt index 0970f28c7c5a344d7fd9b9c893c584e7336df266..202a684feef71ff540d6aa528d348febf0b37d1e 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/test-requirements.txt +++ b/services/TS29222_CAPIF_API_Provider_Management_API/test-requirements.txt @@ -1,4 +1,4 @@ pytest~=4.6.7 # needed for python 2.7+3.4 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 # needed for python 2.7+3.4 +Flask-Testing == 0.8.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 344df6b7ff0ea76a7014ec411948ba9ed31cc9a6..a47335578bcb2c66a5392cc3d9d830a8f2e1723e 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 @@ -120,8 +120,8 @@ config = Config() jwt = JWTManager(app.app) configure_logging(app.app) - -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": configure_monitoring(app.app, config.get_config()) app.app.config["invocations"]=config.get_config()["invocations"] diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/db/db.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/db/db.py index d1185c2d34134104a5daa57938ab29c628db2f00..e485c8923ea861c669454a68eb99716f86406023 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/db/db.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/db/db.py @@ -7,7 +7,8 @@ from bson.codec_options import CodecOptions import os from opentelemetry.instrumentation.pymongo import PymongoInstrumentor -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": PymongoInstrumentor().instrument() class MongoDatabse(): diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt b/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt index 087fc12410d50fa32f5acf232478cc220e921adf..2e82931ce42ddc44d6ae7c6e86961fcbe4751d7a 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt @@ -1,31 +1,26 @@ connexion[swagger-ui] == 2.14.2; python_version>="3.6" -# 2.3 is the last version that supports python 3.4-3.5 -connexion[swagger-ui] <= 2.3.0; python_version=="3.5" or python_version=="3.4" -# connexion requires werkzeug but connexion < 2.4.0 does not install werkzeug -# we must peg werkzeug versions below to fix connexion -# https://github.com/zalando/connexion/pull/1044 -werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4" +Werkzeug == 2.2.3 swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools >= 21.0.0 -Flask == 2.1.1 -pymongo == 4.3.3 +setuptools == 68.2.2 +Flask == 2.0.3 +pymongo == 4.7.3 flask_jwt_extended == 4.4.4 opentelemetry-instrumentation == 0.38b0 opentelemetry-instrumentation-flask == 0.38b0 opentelemetry-instrumentation-redis == 0.38b0 opentelemetry-instrumentation-pymongo == 0.38b0 opentelemetry-exporter-otlp == 1.17.0 -opentelemetry-exporter-jaeger==1.17.0 +opentelemetry-exporter-jaeger == 1.17.0 fluent == 0.10.0 fluent-logger == 0.10.0 opentelemetry-api == 1.17.0 opentelemetry-sdk == 1.17.0 flask_executor == 1.0.0 -pyopenssl == 23.0.0 +cryptography == 42.0.8 redis == 4.5.4 flask_executor == 1.0.0 Flask-APScheduler == 1.12.4 Flask-Script == 2.0.6 -gunicorn==22.0.0 -packaging==24.0 \ No newline at end of file +gunicorn == 22.0.0 +packaging == 24.0 \ No newline at end of file diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/test-requirements.txt b/services/TS29222_CAPIF_Access_Control_Policy_API/test-requirements.txt index 58f51d6a00272d7515a20e3618f345b73c68afa0..422ece88482f451c08b57e0109939c09bead2c20 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/test-requirements.txt +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/test-requirements.txt @@ -1,4 +1,4 @@ pytest~=7.1.0 pytest-cov>=2.8.1 pytest-randomly>=1.2.3 -Flask-Testing==0.8.1 +Flask-Testing == 0.8.1 diff --git a/services/TS29222_CAPIF_Auditing_API/logs/app.py b/services/TS29222_CAPIF_Auditing_API/logs/app.py index 9a94d5ad140cba523740852a36f10ae518dc7ccb..a0bd01c992a215111595507f5e5a105ac57bf387 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/app.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/app.py @@ -109,5 +109,6 @@ app.add_api('openapi.yaml', configure_logging(app.app) config = Config() -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": configure_monitoring(app.app, config.get_config()) diff --git a/services/TS29222_CAPIF_Auditing_API/logs/db/db.py b/services/TS29222_CAPIF_Auditing_API/logs/db/db.py index 17a93fe7e254ad1192a95b7fe0300c4384a31623..cf7c0d2ca60425a2e5a842aad94d97c095a47761 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/db/db.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/db/db.py @@ -6,7 +6,8 @@ from config import Config import os from opentelemetry.instrumentation.pymongo import PymongoInstrumentor -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": PymongoInstrumentor().instrument() diff --git a/services/TS29222_CAPIF_Auditing_API/requirements.txt b/services/TS29222_CAPIF_Auditing_API/requirements.txt index cb1e43905a79b1fdcbe01282175cd884eb958efa..c2ef0b45391bea561624453a9049889ab0dd1567 100644 --- a/services/TS29222_CAPIF_Auditing_API/requirements.txt +++ b/services/TS29222_CAPIF_Auditing_API/requirements.txt @@ -1,9 +1,9 @@ connexion[swagger-ui] == 2.14.2; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools >= 21.0.0 +setuptools == 68.2.2 Flask == 2.0.3 -pymongo == 4.0.1 +pymongo == 4.7.3 elasticsearch == 8.4.3 flask_jwt_extended == 4.4.4 opentelemetry-instrumentation == 0.38b0 @@ -11,12 +11,14 @@ opentelemetry-instrumentation-flask == 0.38b0 opentelemetry-instrumentation-redis == 0.38b0 opentelemetry-instrumentation-pymongo == 0.38b0 opentelemetry-exporter-otlp == 1.17.0 -opentelemetry-exporter-jaeger==1.17.0 +opentelemetry-exporter-jaeger == 1.17.0 fluent == 0.10.0 fluent-logger == 0.10.0 opentelemetry-api == 1.17.0 opentelemetry-sdk == 1.17.0 flask_executor == 1.0.0 -pyopenssl == 23.0.0 -gunicorn==22.0.0 -packaging==24.0 \ No newline at end of file +cryptography == 42.0.8 +Werkzeug == 2.2.3 +pyopenssl == 24.1.0 +gunicorn == 22.0.0 +packaging == 24.0 diff --git a/services/TS29222_CAPIF_Auditing_API/test-requirements.txt b/services/TS29222_CAPIF_Auditing_API/test-requirements.txt index 0970f28c7c5a344d7fd9b9c893c584e7336df266..202a684feef71ff540d6aa528d348febf0b37d1e 100644 --- a/services/TS29222_CAPIF_Auditing_API/test-requirements.txt +++ b/services/TS29222_CAPIF_Auditing_API/test-requirements.txt @@ -1,4 +1,4 @@ pytest~=4.6.7 # needed for python 2.7+3.4 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 # needed for python 2.7+3.4 +Flask-Testing == 0.8.0 diff --git a/services/TS29222_CAPIF_Discover_Service_API/requirements.txt b/services/TS29222_CAPIF_Discover_Service_API/requirements.txt index 1732b50d295c03701cf7001b7c96b917d79a655e..1c57f79a6c75be2813dbca4d36f7c119adabe6a2 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/requirements.txt +++ b/services/TS29222_CAPIF_Discover_Service_API/requirements.txt @@ -1,11 +1,11 @@ connexion[swagger-ui] == 2.14.2; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools >= 21.0.0 +setuptools == 68.2.2 Flask == 2.0.3 -pymongo == 4.0.1 +pymongo == 4.7.3 flask_jwt_extended == 4.4.4 -pyopenssl == 23.0.0 +cryptography == 42.0.8 rfc3987 == 1.3.8 redis == 4.5.4 opentelemetry-instrumentation == 0.38b0 @@ -13,12 +13,13 @@ opentelemetry-instrumentation-flask == 0.38b0 opentelemetry-instrumentation-redis == 0.38b0 opentelemetry-instrumentation-pymongo == 0.38b0 opentelemetry-exporter-otlp == 1.17.0 -opentelemetry-exporter-jaeger==1.17.0 +opentelemetry-exporter-jaeger == 1.17.0 fluent == 0.10.0 fluent-logger == 0.10.0 opentelemetry-api == 1.17.0 opentelemetry-sdk == 1.17.0 flask_executor == 1.0.0 flask_executor == 1.0.0 -gunicorn==22.0.0 -packaging==24.0 \ No newline at end of file +Werkzeug == 2.2.3 +gunicorn == 22.0.0 +packaging == 24.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 d3cbec7019c0cacefc299ca0099e21fc4cc061ec..2e37d0ef069c123196aea32416201aaf5f161992 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/app.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/app.py @@ -117,7 +117,8 @@ configure_logging(app.app) config = Config() -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": configure_monitoring(app.app, config.get_config()) jwt = JWTManager(app.app) 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 2b259ceadf253f8530d7097f3bb53bf934bb312e..fb741fbfa6d23a29ce7df142f68a02b7885c946c 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 @@ -6,7 +6,8 @@ from bson.codec_options import CodecOptions import os from opentelemetry.instrumentation.pymongo import PymongoInstrumentor -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": PymongoInstrumentor().instrument() diff --git a/services/TS29222_CAPIF_Discover_Service_API/test-requirements.txt b/services/TS29222_CAPIF_Discover_Service_API/test-requirements.txt index 0970f28c7c5a344d7fd9b9c893c584e7336df266..202a684feef71ff540d6aa528d348febf0b37d1e 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~=4.6.7 # needed for python 2.7+3.4 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 # needed for python 2.7+3.4 +Flask-Testing == 0.8.0 diff --git a/services/TS29222_CAPIF_Events_API/capif_events/app.py b/services/TS29222_CAPIF_Events_API/capif_events/app.py index ead8b5288edadaa94c078a7f410af31a31430f2e..eb43ca1920fc5ac7e37e4f5ebf091e66da19c09a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/app.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/app.py @@ -133,7 +133,8 @@ notifications = Notifications() jwt = JWTManager(app.app) configure_logging(app.app) -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": configure_monitoring(app.app, config.get_config()) config = Config() 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 c68c8098fdb1a0139c1053fad19f2584c60bd856..68391d8866eaa6f88cbbbb5ab90fe07e792b17d6 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/db/db.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/db/db.py @@ -7,7 +7,8 @@ from bson.codec_options import CodecOptions import os from opentelemetry.instrumentation.pymongo import PymongoInstrumentor -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": PymongoInstrumentor().instrument() 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 7ff1d4e3a3b7bd28cc89b4db118d9d602ef00065..a4e4d0719a767c8424312da786c0a14163c66276 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 @@ -11,10 +11,6 @@ from capif_events.models.ipv4_address_range import Ipv4AddressRange 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.ipv4_address_range import Ipv4AddressRange # 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/requirements.txt b/services/TS29222_CAPIF_Events_API/requirements.txt index 8cc1fc1c02bd25ce5c4782ce9ca3a284f4c55ee8..22b0d352078a44b38cf8d82c4d4cbfcc083ae5c0 100644 --- a/services/TS29222_CAPIF_Events_API/requirements.txt +++ b/services/TS29222_CAPIF_Events_API/requirements.txt @@ -1,27 +1,28 @@ connexion[swagger-ui] == 2.14.2; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools >= 21.0.0 +setuptools == 68.2.2 Flask == 2.0.3 -pymongo == 4.0.1 +pymongo == 4.7.3 opentelemetry-instrumentation == 0.38b0 opentelemetry-instrumentation-flask == 0.38b0 opentelemetry-instrumentation-redis == 0.38b0 opentelemetry-instrumentation-pymongo == 0.38b0 opentelemetry-exporter-otlp == 1.17.0 -opentelemetry-exporter-jaeger==1.17.0 +opentelemetry-exporter-jaeger == 1.17.0 fluent == 0.10.0 fluent-logger == 0.10.0 opentelemetry-api == 1.17.0 opentelemetry-sdk == 1.17.0 flask_executor == 1.0.0 flask_jwt_extended -pyopenssl -rfc3987 -redis -flask_executor -Flask-APScheduler -aiohttp==3.9.5 -async-timeout==4.0.3 -gunicorn==22.0.0 -packaging==24.0 \ No newline at end of file +cryptography == 42.0.8 +rfc3987 == 1.3.8 +redis == 4.5.4 +Flask-APScheduler == 1.12.4 +aiohttp == 3.9.5 +async-timeout == 4.0.3 +Werkzeug == 2.2.3 +pyopenssl == 24.1.0 +gunicorn == 22.0.0 +packaging == 24.0 diff --git a/services/TS29222_CAPIF_Events_API/test-requirements.txt b/services/TS29222_CAPIF_Events_API/test-requirements.txt index 0970f28c7c5a344d7fd9b9c893c584e7336df266..202a684feef71ff540d6aa528d348febf0b37d1e 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-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 # needed for python 2.7+3.4 +Flask-Testing == 0.8.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 e7b839742c0c2584df24bd6bcb9c384e0c5d3566..5eb97b36adedad2c2f900925a4eb013884cef02f 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 @@ -112,5 +112,6 @@ configure_logging(app.app) config = Config() -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": configure_monitoring(app.app, config.get_config()) 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 f706e5f11a4943337740a7d7cf1ffa2cb1cdf5f6..87cc3a65f5101267a9c81ca548812a533b6bca23 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 @@ -6,7 +6,8 @@ from config import Config import os from opentelemetry.instrumentation.pymongo import PymongoInstrumentor -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": PymongoInstrumentor().instrument() diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt b/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt index b08bd828f28be3597ba68c0748cbc4ac7ca6c1ce..e92ae36d8fb1b0a19b8530808df64a440334547c 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt @@ -1,9 +1,9 @@ connexion[swagger-ui] == 2.14.2; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools >= 21.0.0 +setuptools == 68.2.2 Flask == 2.0.3 -pymongo == 4.0.1 +pymongo == 4.7.3 elasticsearch == 8.4.3 flask_jwt_extended == 4.4.4 redis == 4.5.4 @@ -12,12 +12,14 @@ opentelemetry-instrumentation-flask == 0.38b0 opentelemetry-instrumentation-redis == 0.38b0 opentelemetry-instrumentation-pymongo == 0.38b0 opentelemetry-exporter-otlp == 1.17.0 -opentelemetry-exporter-jaeger==1.17.0 +opentelemetry-exporter-jaeger == 1.17.0 fluent == 0.10.0 fluent-logger == 0.10.0 opentelemetry-api == 1.17.0 opentelemetry-sdk == 1.17.0 flask_executor == 1.0.0 -pyopenssl == 23.0.0 -gunicorn==22.0.0 -packaging==24.0 \ No newline at end of file +cryptography == 42.0.8 +Werkzeug == 2.2.3 +pyopenssl == 24.1.0 +gunicorn == 22.0.0 +packaging == 24.0 diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/test-requirements.txt b/services/TS29222_CAPIF_Logging_API_Invocation_API/test-requirements.txt index 0970f28c7c5a344d7fd9b9c893c584e7336df266..202a684feef71ff540d6aa528d348febf0b37d1e 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/test-requirements.txt +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/test-requirements.txt @@ -1,4 +1,4 @@ pytest~=4.6.7 # needed for python 2.7+3.4 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 # needed for python 2.7+3.4 +Flask-Testing == 0.8.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 d8c3fc57d3933da040184fdb26e1ea17b0fe4efa..3c0c4735b508ff2ac60322d2a28ce31b81306700 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/app.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/app.py @@ -125,7 +125,8 @@ config = Config() jwt = JWTManager(app.app) configure_logging(app.app) -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": configure_monitoring(app.app, config.get_config()) executor = Executor(app.app) diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/db/db.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/db/db.py index e30cb6667667f6cf055b1ea88bec89de6044e4a2..643dda4f7a96c4e663d6aac3fd956ba0797bb39b 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/db/db.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/db/db.py @@ -6,7 +6,8 @@ from bson.codec_options import CodecOptions import os from opentelemetry.instrumentation.pymongo import PymongoInstrumentor -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": PymongoInstrumentor().instrument() diff --git a/services/TS29222_CAPIF_Publish_Service_API/requirements.txt b/services/TS29222_CAPIF_Publish_Service_API/requirements.txt index cd12aa41e801e40c417bf01b4d04edb1e6677d0c..0b1b9e8c227957eae80431cd7df84296dabeb2c4 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/requirements.txt +++ b/services/TS29222_CAPIF_Publish_Service_API/requirements.txt @@ -1,23 +1,24 @@ connexion[swagger-ui] == 2.14.2; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools >= 21.0.0 +setuptools == 68.2.2 Flask == 2.0.3 -pymongo == 4.0.1 +pymongo == 4.7.3 flask_jwt_extended == 4.4.4 opentelemetry-instrumentation == 0.38b0 opentelemetry-instrumentation-flask == 0.38b0 opentelemetry-instrumentation-redis == 0.38b0 opentelemetry-instrumentation-pymongo == 0.38b0 opentelemetry-exporter-otlp == 1.17.0 -opentelemetry-exporter-jaeger==1.17.0 +opentelemetry-exporter-jaeger == 1.17.0 fluent == 0.10.0 fluent-logger == 0.10.0 opentelemetry-api == 1.17.0 opentelemetry-sdk == 1.17.0 flask_executor == 1.0.0 -pyopenssl == 23.0.0 +cryptography == 42.0.8 redis == 4.5.4 flask_executor == 1.0.0 -gunicorn==22.0.0 -packaging==24.0 +Werkzeug == 2.2.3 +gunicorn == 22.0.0 +packaging == 24.0 diff --git a/services/TS29222_CAPIF_Publish_Service_API/test-requirements.txt b/services/TS29222_CAPIF_Publish_Service_API/test-requirements.txt index 0970f28c7c5a344d7fd9b9c893c584e7336df266..202a684feef71ff540d6aa528d348febf0b37d1e 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/test-requirements.txt +++ b/services/TS29222_CAPIF_Publish_Service_API/test-requirements.txt @@ -1,4 +1,4 @@ pytest~=4.6.7 # needed for python 2.7+3.4 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 # needed for python 2.7+3.4 +Flask-Testing == 0.8.0 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 8bf453284830c0d9696da8ccd2b8deea4ae98178..5f8e7c0745d8183a852e265bedb4a42dbe445f4e 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 @@ -70,7 +70,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("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 @@ -95,6 +95,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("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/routing_rule.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py index f177670a723ccc3594611b7ee85a8f6bbfff6e90..29c0930b40676c276cdd8df190b8b5a31d410dd7 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 @@ -11,10 +11,6 @@ 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.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/requirements.txt b/services/TS29222_CAPIF_Routing_Info_API/requirements.txt index e4be1ef6b91acd656f04127c542692abdb9b7b6b..afaac687767e9f9669d7f6baadf40a77ceddedb8 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/requirements.txt +++ b/services/TS29222_CAPIF_Routing_Info_API/requirements.txt @@ -1,7 +1,8 @@ connexion[swagger-ui] == 2.14.2; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools >= 21.0.0 +setuptools == 68.2.2 Flask == 2.0.3 -gunicorn==22.0.0 -packaging==24.0 \ No newline at end of file +Werkzeug == 2.2.3 +gunicorn == 22.0.0 +packaging == 24.0 diff --git a/services/TS29222_CAPIF_Routing_Info_API/test-requirements.txt b/services/TS29222_CAPIF_Routing_Info_API/test-requirements.txt index 0970f28c7c5a344d7fd9b9c893c584e7336df266..202a684feef71ff540d6aa528d348febf0b37d1e 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/test-requirements.txt +++ b/services/TS29222_CAPIF_Routing_Info_API/test-requirements.txt @@ -1,4 +1,4 @@ pytest~=4.6.7 # needed for python 2.7+3.4 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 # needed for python 2.7+3.4 +Flask-Testing == 0.8.0 diff --git a/services/TS29222_CAPIF_Security_API/capif_security/__main__.py b/services/TS29222_CAPIF_Security_API/capif_security/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..26eec192939283fcf44e849e3926bfa1f9d490cd --- /dev/null +++ b/services/TS29222_CAPIF_Security_API/capif_security/__main__.py @@ -0,0 +1,149 @@ +#!/usr/bin/env python3 + +import connexion +import logging +from capif_security import encoder +from flask_jwt_extended import JWTManager +from .config import Config +from .core.consumer_messager import Subscriber +from threading import Thread +from flask_executor import Executor +from logging.handlers import RotatingFileHandler +import sys +import os +from fluent import sender +from flask_executor import Executor +from opentelemetry.instrumentation.flask import FlaskInstrumentor +from opentelemetry import trace +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from opentelemetry.sdk.resources import Resource +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import BatchSpanProcessor +from opentelemetry.instrumentation.redis import RedisInstrumentor + + + +NAME = "Security-Service" + +def configure_monitoring(app, config): + + resource = Resource(attributes={"service.name": NAME}) + + 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() + + tracer_provider = TracerProvider(resource=resource) + trace.set_tracer_provider(tracer_provider) + exporter = OTLPSpanExporter(endpoint=f"http://{config['monitoring']['opentelemetry_url']}:{config['monitoring']['opentelemetry_port']}", insecure=True) + span_processor = BatchSpanProcessor( + exporter, + max_queue_size=config['monitoring']['opentelemetry_max_queue_size'], + schedule_delay_millis=config['monitoring']['opentelemetry_schedule_delay_millis'], + max_export_batch_size=config['monitoring']['opentelemetry_max_export_batch_size'], + export_timeout_millis=config['monitoring']['opentelemetry_export_timeout_millis'], + ) + + trace.get_tracer_provider().add_span_processor(span_processor) + + FlaskInstrumentor().instrument_app(app) + + RedisInstrumentor().instrument() + + class FluentBitHandler(logging.Handler): + + def __init__(self): + logging.Handler.__init__(self) + + def emit(self, record): + log_entry = self.format(record) + log_data = { + 'message': log_entry, + 'level': record.levelname, + 'timestamp': record.created, + 'logger': record.name, + 'function': record.funcName, + 'line': record.lineno, + 'container_name': os.environ.get('CONTAINER_NAME', ''), + } + + # # Obtener el trace ID actual + current_context = trace.get_current_span().get_span_context() + + trace_id = current_context.trace_id + traceparent_id = current_context.span_id + log_data['traceID'] = hex(trace_id)[2:] + if traceparent_id != None: + log_data['traceparent'] = hex(traceparent_id)[2:] + fluent_bit_sender.emit('Security-Service', log_data) + + loggers = [app.logger, ] + for l in loggers: + l.addHandler(FluentBitHandler()) + + +def configure_logging(app): + del app.logger.handlers[:] + loggers = [app.logger, ] + handlers = [] + console_handler = logging.StreamHandler() + console_handler.setLevel(logging.DEBUG) + console_handler.setFormatter(verbose_formatter()) + file_handler = RotatingFileHandler(filename="security_logs.log", maxBytes=1024 * 1024 * 100, backupCount=20) + file_handler.setLevel(logging.DEBUG) + file_handler.setFormatter(verbose_formatter()) + handlers.append(console_handler) + handlers.append(file_handler) + + for l in loggers: + for handler in handlers: + l.addHandler(handler) + l.propagate = False + l.setLevel(logging.DEBUG) + + +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 main(): + + with open("/usr/src/app/capif_security/server.key", "rb") as key_file: + key_data = key_file.read() + + app = connexion.App(__name__, specification_dir='./openapi/') + app.app.json_encoder = encoder.JSONEncoder + + + app.app.config['JWT_ALGORITHM'] = 'RS256' + app.app.config['JWT_PRIVATE_KEY'] = key_data + app.add_api('openapi.yaml', + arguments={'title': 'CAPIF_Security_API'}, + pythonic_params=True) + + JWTManager(app.app) + subscriber = Subscriber() + + config = Config() + configure_logging(app.app) + + monitoring_value = os.environ.get("MONITORING", "").lower() + if monitoring_value == "true": + configure_monitoring(app.app, config.get_config()) + + executor = Executor(app.app) + + @app.app.before_first_request + def up_listener(): + executor.submit(subscriber.listen) + + + app.run(port=8080, debug=True) + +if __name__ == '__main__': + main() + diff --git a/services/TS29222_CAPIF_Security_API/capif_security/app.py b/services/TS29222_CAPIF_Security_API/capif_security/app.py index 975488eeff6a4d89c2b71328d17a0b3ff15c912b..0f06b7a28d353ea9627dc7a771d279c430c9be67 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/app.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/app.py @@ -126,7 +126,8 @@ subscriber = Subscriber() config = Config() configure_logging(app.app) -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": configure_monitoring(app.app, config.get_config()) executor = Executor(app.app) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/db/db.py b/services/TS29222_CAPIF_Security_API/capif_security/db/db.py index 4a009dbf6a4712da2fac7020841a2e7e4ec10962..47a9538c9c70be0cb96fee4119eb024db27b79cc 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/db/db.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/db/db.py @@ -7,7 +7,8 @@ from bson.codec_options import CodecOptions import os from opentelemetry.instrumentation.pymongo import PymongoInstrumentor -if eval(os.environ.get("MONITORING").lower().capitalize()): +monitoring_value = os.environ.get("MONITORING", "").lower() +if monitoring_value == "true": PymongoInstrumentor().instrument() diff --git a/services/TS29222_CAPIF_Security_API/requirements.txt b/services/TS29222_CAPIF_Security_API/requirements.txt index 835b8ca6c9732a845de5129511f58e62f4e7b4a5..b92f321e856892a89171bb517ae90e604445af75 100644 --- a/services/TS29222_CAPIF_Security_API/requirements.txt +++ b/services/TS29222_CAPIF_Security_API/requirements.txt @@ -1,11 +1,11 @@ connexion[swagger-ui] == 2.14.2; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools >= 21.0.0 +setuptools == 68.2.2 Flask == 2.0.3 -pymongo == 4.0.1 +pymongo == 4.7.3 flask_jwt_extended == 4.4.4 -pyopenssl == 23.0.0 +cryptography == 42.0.8 rfc3987 == 1.3.8 redis == 4.5.4 flask_executor == 1.0.0 @@ -14,11 +14,12 @@ opentelemetry-instrumentation-flask == 0.38b0 opentelemetry-instrumentation-redis == 0.38b0 opentelemetry-instrumentation-pymongo == 0.38b0 opentelemetry-exporter-otlp == 1.17.0 -opentelemetry-exporter-jaeger==1.17.0 +opentelemetry-exporter-jaeger == 1.17.0 fluent == 0.10.0 fluent-logger == 0.10.0 opentelemetry-api == 1.17.0 opentelemetry-sdk == 1.17.0 flask_executor == 1.0.0 -gunicorn==22.0.0 -packaging==24.0 \ No newline at end of file +Werkzeug == 2.2.3 +gunicorn == 22.0.0 +packaging == 24.0 diff --git a/services/TS29222_CAPIF_Security_API/test-requirements.txt b/services/TS29222_CAPIF_Security_API/test-requirements.txt index 0970f28c7c5a344d7fd9b9c893c584e7336df266..202a684feef71ff540d6aa528d348febf0b37d1e 100644 --- a/services/TS29222_CAPIF_Security_API/test-requirements.txt +++ b/services/TS29222_CAPIF_Security_API/test-requirements.txt @@ -1,4 +1,4 @@ pytest~=4.6.7 # needed for python 2.7+3.4 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 # needed for python 2.7+3.4 +Flask-Testing == 0.8.0 diff --git a/services/clean_capif_docker_services.sh b/services/clean_capif_docker_services.sh index cfc5b716dacf2f058c8e868b2fdef97efb96b3ce..617ffed8ee9ead75cb5825199e91274d9a6cf392 100755 --- a/services/clean_capif_docker_services.sh +++ b/services/clean_capif_docker_services.sh @@ -68,7 +68,7 @@ echo "${FILES[@]}" for FILE in "${FILES[@]}"; do echo "Executing 'docker compose down' for file $FILE" - docker compose -f "$FILE" down --rmi all + CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 DUID=$DUID DGID=$DGID MONITORING=$MONITORING_STATE docker compose -f "$FILE" down --rmi all status=$? if [ $status -eq 0 ]; then echo "*** Removed Service from $FILE ***" diff --git a/services/helper/config.yaml b/services/helper/config.yaml index 46e5801bef78265a4d572d2a59f9628814dfafb5..bb090f086263a17001d9952b13befc7030696ef6 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -14,5 +14,6 @@ mongo: { ca_factory: { "url": "vault", "port": "8200", - "token": "dev-only-token" + "token": "dev-only-token", + "verify": False } diff --git a/services/helper/helper_service/app.py b/services/helper/helper_service/app.py index bdc0007da01ff45d6b886fb2fd9eeee52bc983e6..c0af3df2c5ae9f8f58e515f3c8b512bc81ecdfb1 100644 --- a/services/helper/helper_service/app.py +++ b/services/helper/helper_service/app.py @@ -40,7 +40,7 @@ data = { 'common_name': "superadmin" } -response = requests.request("POST", url, headers=headers, data=data, verify = False) +response = requests.request("POST", url, headers=headers, data=data, verify = config["ca_factory"].get("verify", False)) superadmin_cert = json.loads(response.text)['data']['certificate'] # Save the superadmin certificate @@ -53,7 +53,7 @@ headers = { 'X-Vault-Token': config['ca_factory']['token'] } -response = requests.request("GET", url, headers=headers, verify = False) +response = requests.request("GET", url, headers=headers, verify = config["ca_factory"].get("verify", False)) ca_root = json.loads(response.text)['data']['data']['ca'] cert_file = open("certs/ca_root.crt", 'wb') diff --git a/services/helper/requirements.txt b/services/helper/requirements.txt index 0e444da92643ea1dacd4f451aef1ccd8c1a7beb4..23c2931293b753eb0580dae37dab345cd1335869 100644 --- a/services/helper/requirements.txt +++ b/services/helper/requirements.txt @@ -1,10 +1,10 @@ python_dateutil == 2.9.0.post0 setuptools == 68.2.2 Flask == 3.0.3 -pymongo == 4.0.1 +pymongo == 4.7.3 flask_jwt_extended == 4.6.0 pyopenssl == 24.1.0 pyyaml == 6.0.1 requests == 2.32.2 -gunicorn==22.0.0 -packaging==24.0 +gunicorn == 22.0.0 +packaging == 24.0 diff --git a/services/mock_server/requirements.txt b/services/mock_server/requirements.txt index abf28620ee482efbabd6ccf8a2b8d8b554563b03..0764845fe7c34f969d1acfffea0be038793c0e55 100644 --- a/services/mock_server/requirements.txt +++ b/services/mock_server/requirements.txt @@ -1 +1 @@ -flask==3.0.3 \ No newline at end of file +flask == 3.0.3 \ No newline at end of file diff --git a/services/register/config.yaml b/services/register/config.yaml index 258821ff00ad2d1c094a5989098cadc86ae312b1..f1e1a257290897585780b9fe5e8eac6ae5e2e0ee 100644 --- a/services/register/config.yaml +++ b/services/register/config.yaml @@ -10,7 +10,8 @@ mongo: { ca_factory: { "url": "vault", "port": "8200", - "token": "dev-only-token" + "token": "dev-only-token", + "verify": False } ccf: { diff --git a/services/register/register_service/app.py b/services/register/register_service/app.py index 77c3b38121894d3ddc872984e01427eb7ff78642..4dc2deda757d7a3b79f02ee3756d5b6715ed2fcc 100644 --- a/services/register/register_service/app.py +++ b/services/register/register_service/app.py @@ -47,7 +47,7 @@ data = { 'common_name': "superadmin" } -response = requests.request("POST", url, headers=headers, data=data, verify = False) +response = requests.request("POST", url, headers=headers, data=data, verify = config["ca_factory"].get("verify", False)) superadmin_cert = json.loads(response.text)['data']['certificate'] # Save the superadmin certificate @@ -60,7 +60,7 @@ headers = { 'X-Vault-Token': config['ca_factory']['token'] } -response = requests.request("GET", url, headers=headers, verify = False) +response = requests.request("GET", url, headers=headers, verify = config["ca_factory"].get("verify", False)) ca_root = json.loads(response.text)['data']['data']['ca'] cert_file = open("certs/ca_root.crt", 'wb') @@ -70,7 +70,7 @@ cert_file.close() # Request CAPIF private key to encode the CAPIF token url = 'http://{}:{}/v1/secret/data/server_cert/private'.format(config["ca_factory"]["url"], config["ca_factory"]["port"]) headers = {'X-Vault-Token': f"{config["ca_factory"]["token"]}"} -response = requests.request("GET", url, headers=headers, verify = False) +response = requests.request("GET", url, headers=headers, verify = config["ca_factory"].get("verify", False)) key_data = json.loads(response.text)["data"]["data"]["key"] diff --git a/services/register/requirements.txt b/services/register/requirements.txt index 8da8ad4d2a954b95ab42c32773ffdf558b499b3d..bf3e52ccc89c836571bf47bda630499347c54259 100644 --- a/services/register/requirements.txt +++ b/services/register/requirements.txt @@ -1,12 +1,12 @@ python_dateutil >= 2.6.0 -setuptools >= 21.0.0 -Flask >= 2.0.3 -pymongo == 4.0.1 -gunicorn==22.0.0 -packaging==24.0 -flask_jwt_extended -pyopenssl -pyyaml -requests -bcrypt -flask_httpauth \ No newline at end of file +setuptools == 68.2.2 +Flask == 3.0.3 +pymongo == 4.7.3 +flask_jwt_extended == 4.6.0 +pyopenssl == 24.1.0 +pyyaml == 6.0.1 +requests == 2.32.2 +bcrypt == 4.0.1 +flask_httpauth == 4.8.0 +gunicorn == 22.0.0 +packaging == 24.0 diff --git a/services/run.sh b/services/run.sh index 4465aaa49909052f767c9d0bd1e6aeacfe3dfad2..3053019e025371470730e73354780d667972217d 100755 --- a/services/run.sh +++ b/services/run.sh @@ -62,7 +62,7 @@ echo Nginx hostname will be $HOSTNAME, deploy $DEPLOY, monitoring $MONITORING_ST if [ "$MONITORING_STATE" == "true" ] ; then echo '***Monitoring set as true***' - echo '***Creating Monitoging stack***' + echo '***Creating Monitoring stack***' DUID=$DUID DGID=$DGID docker compose -f "../monitoring/docker-compose.yml" up --detach status=$? diff --git a/tools/robot/basicRequirements.txt b/tools/robot/basicRequirements.txt index aa3e60e0f55ee408cb29605ef29446b3dd075d4f..06e5cc276ee6b6b950d1e1cff0cb272deee5a0b6 100644 --- a/tools/robot/basicRequirements.txt +++ b/tools/robot/basicRequirements.txt @@ -1,103 +1,103 @@ # Requirements needed when generating releases. See BUILD.rst for details. -appdirs==1.4.4 -argh==0.26.2 -arrow==1.2.3 -async-generator==1.10 -async-timeout==4.0.2 -attrs==22.1.0 -bcrypt==4.0.1 -beautifulsoup4==4.11.1 -binaryornot==0.4.4 -bson==0.5.10 -certifi==2021.10.8 -cffi==1.15.1 -chardet==5.0.0 -charset-normalizer==2.0.12 -click==8.1.7 -configparser==5.3.0 -cookiecutter==2.1.1 -coverage==4.5.4 -cryptography==38.0.1 -Deprecated==1.2.13 -distlib==0.3.6 -dnspython==2.2.1 -docutils==0.19 -exceptiongroup==1.0.0rc9 -filelock==3.8.0 -flake8==3.9.2 -flask==3.0.3 -h11==0.14.0 -idna==3.4 -iniconfig==1.1.1 -invoke==1.6.0 -ipaddress==1.0.23 -Jinja2==3.1.2 -jinja2-time==0.2.0 -lxml==4.9.1 -MarkupSafe==2.1.1 -mccabe==0.6.1 -numpy==1.23.4 -outcome==1.2.0 -packaging==21.3 -pandas==1.5.1 -paramiko==2.11.0 -pathtools==0.1.2 -platformdirs==2.5.2 -pluggy==0.13.1 -psutil==5.9.3 -py==1.11.0 -pyasn1==0.4.8 -pyasn1-modules==0.2.8 -pycodestyle==2.7.0 -pycparser==2.21 -pyflakes==2.3.1 -PyGithub==1.56 -PyJWT==2.6.0 -pymongo==4.3.2 -PyNaCl==1.5.0 -pyOpenSSL==22.1.0 -pyparsing==3.0.9 -PySocks==1.7.1 -pytest==6.2.4 -python-dateutil==2.8.2 -python-ldap==3.4.3 -python-slugify==6.1.2 -pythonping==1.1.3 -pytz==2022.5 -PyYAML==6.0 -redis==4.3.4 -rellu==0.7 -requests==2.28.1 -rfc3987==1.3.8 -robotframework==7.0 -robotframework-archivelibrary == 0.4.2 -robotframework-httpctrl==0.3.1 -robotframework-lint==1.1 -robotframework-mongodb-library==3.2 -robotframework-pythonlibcore==4.4.1 -robotframework-requests==0.9.3 -robotframework-seleniumlibrary==6.0.0 -robotframework-sshlibrary==3.8.0 -robotremoteserver==1.1 -scp==0.14.4 -selenium==4.5.0 -six==1.16.0 -sniffio==1.3.0 -sortedcontainers==2.4.0 -soupsieve==2.3.2.post1 -sshconf==0.2.5 -text-unidecode==1.3 -toml==0.10.2 -tomli==2.0.1 -tox==3.26.0 -tqdm==4.64.1 -trio==0.22.0 -trio-websocket==0.9.2 -typing-extensions==4.11.0 -urllib3==1.26.12 -virtualenv==20.16.5 -watchdog==4.0.0 -webdrivermanager==0.10.0 -wrapt==1.15.0 -wsproto==1.2.0 -xlrd==2.0.1 +appdirs == 1.4.4 +argh == 0.26.2 +arrow == 1.2.3 +async-generator == 1.10 +async-timeout == 4.0.2 +attrs == 22.1.0 +bcrypt == 4.0.1 +beautifulsoup4 == 4.11.1 +binaryornot == 0.4.4 +bson == 0.5.10 +certifi == 2021.10.8 +cffi == 1.15.1 +chardet == 5.0.0 +charset-normalizer == 2.0.12 +click == 8.1.7 +configparser == 5.3.0 +cookiecutter == 2.1.1 +coverage == 4.5.4 +cryptography == 42.0.8 +Deprecated == 1.2.13 +distlib == 0.3.6 +dnspython == 2.2.1 +docutils == 0.19 +exceptiongroup == 1.0.0rc9 +filelock == 3.8.0 +flake8 == 3.9.2 +flask == 3.0.3 +h11 == 0.14.0 +idna == 3.4 +iniconfig == 1.1.1 +invoke == 1.6.0 +ipaddress == 1.0.23 +Jinja2 == 3.1.2 +jinja2-time == 0.2.0 +lxml == 4.9.1 +MarkupSafe == 2.1.1 +mccabe == 0.6.1 +numpy == 1.23.4 +outcome == 1.2.0 +packaging == 21.3 +pandas == 1.5.1 +paramiko == 2.11.0 +pathtools == 0.1.2 +platformdirs == 2.5.2 +pluggy == 0.13.1 +psutil == 5.9.3 +py == 1.11.0 +pyasn1 == 0.4.8 +pyasn1-modules == 0.2.8 +pycodestyle == 2.7.0 +pycparser == 2.21 +pyflakes == 2.3.1 +PyGithub == 1.56 +PyJWT == 2.6.0 +pymongo == 4.7.3 +PyNaCl == 1.5.0 +pyOpenSSL == 24.1.0 +pyparsing == 3.0.9 +PySocks == 1.7.1 +pytest == 6.2.4 +python-dateutil == 2.8.2 +python-ldap == 3.4.3 +python-slugify == 6.1.2 +pythonping == 1.1.3 +pytz == 2022.5 +PyYAML == 6.0 +redis == 4.5.4 +rellu == 0.7 +requests == 2.28.1 +rfc3987 == 1.3.8 +robotframework == 7.0 +robotframework-archivelibrary == 0.4.2 +robotframework-httpctrl == 0.3.1 +robotframework-lint == 1.1 +robotframework-mongodb-library == 3.2 +robotframework-pythonlibcore == 4.4.1 +robotframework-requests == 0.9.3 +robotframework-seleniumlibrary == 6.0.0 +robotframework-sshlibrary == 3.8.0 +robotremoteserver == 1.1 +scp == 0.14.4 +selenium == 4.5.0 +six == 1.16.0 +sniffio == 1.3.0 +sortedcontainers == 2.4.0 +soupsieve == 2.3.2.post1 +sshconf == 0.2.5 +text-unidecode == 1.3 +toml == 0.10.2 +tomli == 2.0.1 +tox == 3.26.0 +tqdm == 4.64.1 +trio == 0.22.0 +trio-websocket == 0.9.2 +typing-extensions == 4.11.0 +urllib3 == 1.26.12 +virtualenv == 20.16.5 +watchdog == 4.0.0 +webdrivermanager == 0.10.0 +wrapt == 1.15.0 +wsproto == 1.2.0 +xlrd == 2.0.1