From 6a042f98ecc1d7e7444bdb00e19971b9e41576b4 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Wed, 3 Sep 2025 14:06:56 +0200 Subject: [PATCH 01/30] jms versions --- setup.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index fe14cdf..4034c8f 100644 --- a/setup.py +++ b/setup.py @@ -7,9 +7,9 @@ with open(os.path.join(this_directory, "README_pipy.md"), encoding="utf-8") as f setup( name="opencapif_sdk", - version="0.1.21", - author="JorgeEcheva, dgs-cgm", - author_email="jorge.echevarriauribarri.practicas@telefonica.com, daniel.garciasanchez@telefonica.com", + version="0.1.22", + author="Guillermo Sanz LΓ³pez. Miguel Ángel Adorna Ruiz", + author_email="guillermo.sanzlopez@telefonica.com, miguelangel.adornaruiz@telefonica.com", description=( "This repository develops a Python Software Development Kit(SDK) which focuses on " "connecting to OpenCAPIF (Common API Framework for 3GPP Northbound APIs) in a simple way, " @@ -30,8 +30,8 @@ setup( install_requires=[ "requests==2.32.3", "PyYAML==6.0.1", - "cryptography==38.0.4", - "pyOpenSSL==22.1.0", + "cryptography==43.0.1", + "pyOpenSSL==24.2.1", "urllib3==2.2.2", "certifi==2024.7.4", "idna==3.7", @@ -40,7 +40,7 @@ setup( "Jinja2==3.1.4", "MarkupSafe==2.1.5", "six==1.16.0", - "typing-extensions>=4.8.0", + "typing-extensions>=4.11.0", "Werkzeug==3.0.4", "pytest==8.3.2", "flake8==3.9.2", @@ -52,6 +52,7 @@ setup( "jinja2-time==0.2.0", "text-unidecode==1.3", "binaryornot==0.4.4", + "connexion[flask]>=3.0.0" ], url="https://github.com/Telefonica/pesp_capif_sdk", ) -- GitLab From b62d6a280fe05d8bd3476ae6afca4ee3be526283 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Wed, 3 Sep 2025 14:50:21 +0200 Subject: [PATCH 02/30] ajust for pipelines --- ci_cd_test/Dockerfile | 15 ++++++--------- clean_test_sdk.sh => ci_cd_test/clean_test_sdk.sh | 0 test_sdk.sh => ci_cd_test/test_sdk.sh | 9 ++++++--- 3 files changed, 12 insertions(+), 12 deletions(-) rename clean_test_sdk.sh => ci_cd_test/clean_test_sdk.sh (100%) rename test_sdk.sh => ci_cd_test/test_sdk.sh (64%) diff --git a/ci_cd_test/Dockerfile b/ci_cd_test/Dockerfile index 2d1fe73..79dcd39 100644 --- a/ci_cd_test/Dockerfile +++ b/ci_cd_test/Dockerfile @@ -4,24 +4,21 @@ RUN apt update RUN apt update && apt install -y git nano && \ rm -rf /var/lib/apt/lists/* -ARG BRANCH=main - -RUN echo "Cloning branch: ${BRANCH}" && \ - git clone -b ${BRANCH} https://labs.etsi.org/rep/ocf/sdk.git - WORKDIR /sdk +COPY .. . + RUN python -m pip install --upgrade pip RUN pip install -r installation/requirements.txt RUN pip install . ENTRYPOINT sh -c '\ set -e && \ - echo "πŸš€ Ejecutando provider..." && \ + echo "Executing provider..." && \ cd ci_cd_test/testing_samples/testing_provider_sample && \ python testing_provider.py && \ - echo "βœ… Provider finalizado." && \ - echo "πŸš€ Ejecutando invoker..." && \ + echo "βœ… Provider finished." && \ + echo "πŸš€ Executing invoker..." && \ cd ../testing_invoker_sample && \ python network_app_invoker.py && \ - echo "βœ… Invoker finalizado."' \ No newline at end of file + echo "βœ… Invoker finished."' \ No newline at end of file diff --git a/clean_test_sdk.sh b/ci_cd_test/clean_test_sdk.sh similarity index 100% rename from clean_test_sdk.sh rename to ci_cd_test/clean_test_sdk.sh diff --git a/test_sdk.sh b/ci_cd_test/test_sdk.sh similarity index 64% rename from test_sdk.sh rename to ci_cd_test/test_sdk.sh index 3452e07..017daa9 100755 --- a/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -6,14 +6,17 @@ IMAGE_NAME=opencapif_sdk BRANCH_NAME=SDK15-create-dockerfile-image-with-sdk NETWORK_NAME=capif-network +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" + echo "πŸ› οΈ Building image: $IMAGE_NAME from branch: $BRANCH_NAME with no cache..." -docker build --no-cache . -t $IMAGE_NAME -f ci_cd_test/Dockerfile --build-arg BRANCH=$BRANCH_NAME +docker build --no-cache "$PROJECT_ROOT" -t $IMAGE_NAME -f "$SCRIPT_DIR/Dockerfile" --build-arg BRANCH=$BRANCH_NAME echo "πŸš€ Running container: $CONTAINER_NAME in network: $NETWORK_NAME..." docker run \ + --rm \ --name $CONTAINER_NAME \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "End" - +echo "βœ… End" -- GitLab From 053d81eb755c05686e52c42ac72ad8fb792f2551 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Thu, 4 Sep 2025 08:56:11 +0200 Subject: [PATCH 03/30] Enhance Dockerfile: improve logging messages for provider and invoker execution --- ci_cd_test/Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ci_cd_test/Dockerfile b/ci_cd_test/Dockerfile index 79dcd39..5f2496b 100644 --- a/ci_cd_test/Dockerfile +++ b/ci_cd_test/Dockerfile @@ -1,24 +1,27 @@ FROM labs.etsi.org:5050/ocf/capif/python:3-slim-bullseye -RUN apt update +# Update package index and install required tools RUN apt update && apt install -y git nano && \ rm -rf /var/lib/apt/lists/* WORKDIR /sdk +# Copy project files into the container COPY .. . +# Install Python dependencies RUN python -m pip install --upgrade pip RUN pip install -r installation/requirements.txt RUN pip install . +# Define entrypoint: run provider first, then invoker ENTRYPOINT sh -c '\ set -e && \ - echo "Executing provider..." && \ + echo "πŸš€ Starting provider execution..." && \ cd ci_cd_test/testing_samples/testing_provider_sample && \ python testing_provider.py && \ - echo "βœ… Provider finished." && \ - echo "πŸš€ Executing invoker..." && \ + echo "βœ… Provider execution finished." && \ + echo "πŸš€ Starting invoker execution..." && \ cd ../testing_invoker_sample && \ python network_app_invoker.py && \ - echo "βœ… Invoker finished."' \ No newline at end of file + echo "βœ… Invoker execution finished."' \ No newline at end of file -- GitLab From ef102d71cfc65b5b3bbbdae94364919eea74a362 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Thu, 4 Sep 2025 09:00:44 +0200 Subject: [PATCH 04/30] Fix script echo statement to correctly format end message --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index 017daa9..40788b5 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End" +echo "βœ… End" of script" \ No newline at end of file -- GitLab From 2f44b2ea3ebef2929f4741e532c5b200f962ac3e Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Thu, 4 Sep 2025 09:40:58 +0200 Subject: [PATCH 05/30] Fix echo statement to correctly format end message in test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index 40788b5..b5ecbde 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End" of script" \ No newline at end of file +echo "βœ… End of script" \ No newline at end of file -- GitLab From 10b9e254d6985cd601352e8baecb776ee1ffa841 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Thu, 4 Sep 2025 09:50:03 +0200 Subject: [PATCH 06/30] Add exclusions file and configure ruff settings for code linting --- cicd/exclusions | 1 + cicd/ruff.toml | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 cicd/exclusions create mode 100644 cicd/ruff.toml diff --git a/cicd/exclusions b/cicd/exclusions new file mode 100644 index 0000000..0d5d60e --- /dev/null +++ b/cicd/exclusions @@ -0,0 +1 @@ +../doc/ diff --git a/cicd/ruff.toml b/cicd/ruff.toml new file mode 100644 index 0000000..bff59ea --- /dev/null +++ b/cicd/ruff.toml @@ -0,0 +1,3 @@ +line-length = 120 +target-version = "py39" +select = ["E", "W"] \ No newline at end of file -- GitLab From f45337c49cc1edfe0643cc97cba1f68d1d510099 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Thu, 4 Sep 2025 09:51:08 +0200 Subject: [PATCH 07/30] Fix: add newline at the end of the script in test_sdk.sh --- ci_cd_test/test_sdk.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index b5ecbde..6d52463 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,5 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME + echo "βœ… End of script" \ No newline at end of file -- GitLab From d72ef140ccbbf69d8335e45739a7ba084ef5678f Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Thu, 4 Sep 2025 09:53:51 +0200 Subject: [PATCH 08/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index 6d52463..b5ecbde 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,5 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME - echo "βœ… End of script" \ No newline at end of file -- GitLab From d0875996a182cdb01e661b1c4720bd18cddf5afa Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Thu, 4 Sep 2025 11:18:42 +0200 Subject: [PATCH 09/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index b5ecbde..5bd68d0 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" \ No newline at end of file +echo "βœ… End of script" -- GitLab From 8df0905226298fdc95511004140f4cd973a8623d Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Thu, 4 Sep 2025 11:34:34 +0200 Subject: [PATCH 10/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index 5bd68d0..b5ecbde 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" +echo "βœ… End of script" \ No newline at end of file -- GitLab From 52e17aff494c5883c6bc54c2ebe81fd4c0be8baf Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Thu, 4 Sep 2025 12:40:36 +0200 Subject: [PATCH 11/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index b5ecbde..5bd68d0 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" \ No newline at end of file +echo "βœ… End of script" -- GitLab From 94457857c944c8b6622a5d1223a93d0686df47cf Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 12:33:06 +0200 Subject: [PATCH 12/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index 5bd68d0..b5ecbde 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" +echo "βœ… End of script" \ No newline at end of file -- GitLab From 9e7072bf11fdaf4744c62c7ae5f573421033e276 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 12:37:22 +0200 Subject: [PATCH 13/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index b5ecbde..5bd68d0 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" \ No newline at end of file +echo "βœ… End of script" -- GitLab From 895885fc98e260be3bb72ecea3b4a35e8e995f47 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 12:41:03 +0200 Subject: [PATCH 14/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index 5bd68d0..b5ecbde 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" +echo "βœ… End of script" \ No newline at end of file -- GitLab From d54461bf3d2833018f7496b67f7c316aaa850a62 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 12:44:15 +0200 Subject: [PATCH 15/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index b5ecbde..5bd68d0 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" \ No newline at end of file +echo "βœ… End of script" -- GitLab From f629ed6838b2c7d716b91efff7a6216e95e62b65 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 12:47:53 +0200 Subject: [PATCH 16/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index 5bd68d0..b5ecbde 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" +echo "βœ… End of script" \ No newline at end of file -- GitLab From 112253d1b9caaebfd9da5d3dc903297ee37a520b Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 12:52:36 +0200 Subject: [PATCH 17/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index b5ecbde..5bd68d0 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" \ No newline at end of file +echo "βœ… End of script" -- GitLab From c6e7b2e061f5dc5d054f1e86a3394b9648e87627 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Fri, 5 Sep 2025 12:55:48 +0200 Subject: [PATCH 18/30] update versions --- installation/requirements.txt | 55 ++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/installation/requirements.txt b/installation/requirements.txt index 416b0d8..8ea624b 100644 --- a/installation/requirements.txt +++ b/installation/requirements.txt @@ -1,24 +1,33 @@ -requests==2.32.3 -PyYAML==6.0.1 -cryptography==38.0.4 -pyOpenSSL==22.1.0 -urllib3==2.2.2 -certifi==2024.7.4 -idna==3.7 -Flask==3.0.3 -Flask-JWT-Extended==4.6.0 -Jinja2==3.1.4 -MarkupSafe==2.1.5 -six==1.16.0 -typing-extensions==3.10.0.2 -Werkzeug==3.0.4 -pytest==8.3.2 -flake8==3.9.2 -coverage==4.5.4 -mccabe==0.6.1 -pycodestyle==2.7.0 -pyflakes==2.3.1 -python-dateutil==2.9.0.post0 +# --- Core web --- +Flask>=3.1.2,<4 +Werkzeug>=3.1.2,<4 +Jinja2>=3.1.4,<4 +MarkupSafe>=2.1.5,<4 + +# --- Auth/JWT --- +Flask-JWT-Extended>=4.6.0,<5 + +# --- HTTP stack --- +requests>=2.32.3,<3 +urllib3>=2.2.2,<3 +certifi>=2024.7.4 +idna>=3.7,<4 + +# --- YAML --- +PyYAML>=6.0.1,<7 + +# --- Crypto/TLS --- +cryptography>=43.0.1,<46 +pyOpenSSL>=25.1.0,<26 + +# --- Utilities --- +python-dateutil>=2.9.0.post0,<3 +six>=1.16.0,<2 +typing-extensions>=4.12.0,<5; python_version<"3.11" + +# --- Dev / QA --- +pytest>=8.3.2,<9 +coverage>=7.4.0,<8 +flake8>=7.1.0,<8 +binaryornot>=0.4.4,<0.5 jinja2-time==0.2.0 -text-unidecode==1.3 -binaryornot==0.4.4 -- GitLab From 3349cb32aed8775ab3f5ac1758a593ea1756436f Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 12:57:42 +0200 Subject: [PATCH 19/30] Fix: update exclusions to include .doc and .git directories --- cicd/exclusions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cicd/exclusions b/cicd/exclusions index 0d5d60e..c90c0f7 100644 --- a/cicd/exclusions +++ b/cicd/exclusions @@ -1 +1,2 @@ -../doc/ +.doc/ +.git/ \ No newline at end of file -- GitLab From fbc3b5c1bb3a349b82a8c1f552b3c54ad15fbc6c Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 12:59:51 +0200 Subject: [PATCH 20/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index 5bd68d0..b5ecbde 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" +echo "βœ… End of script" \ No newline at end of file -- GitLab From 32a409bfcd7ddb7f033a3bea22670d112ebfeac4 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Fri, 5 Sep 2025 13:00:15 +0200 Subject: [PATCH 21/30] update package versions --- setup.py | 56 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/setup.py b/setup.py index 4034c8f..c5eb6b2 100644 --- a/setup.py +++ b/setup.py @@ -28,31 +28,35 @@ setup( ], packages=find_packages(include=["opencapif_sdk", "opencapif_sdk.*"]), # Ajusta segΓΊn tus necesidades install_requires=[ - "requests==2.32.3", - "PyYAML==6.0.1", - "cryptography==43.0.1", - "pyOpenSSL==24.2.1", - "urllib3==2.2.2", - "certifi==2024.7.4", - "idna==3.7", - "Flask==3.0.3", - "Flask-JWT-Extended==4.6.0", - "Jinja2==3.1.4", - "MarkupSafe==2.1.5", - "six==1.16.0", - "typing-extensions>=4.11.0", - "Werkzeug==3.0.4", - "pytest==8.3.2", - "flake8==3.9.2", - "coverage==4.5.4", - "mccabe==0.6.1", - "pycodestyle==2.7.0", - "pyflakes==2.3.1", - "python-dateutil==2.9.0.post0", - "jinja2-time==0.2.0", - "text-unidecode==1.3", - "binaryornot==0.4.4", - "connexion[flask]>=3.0.0" + "Flask>=3.1.2,<4", + "Werkzeug>=3.1.2,<4", + "Jinja2>=3.1.4,<4", + "MarkupSafe>=2.1.5,<4", + "Flask-JWT-Extended>=4.6.0,<5", + "requests>=2.32.3,<3", + "urllib3>=2.2.2,<3", + "certifi>=2024.7.4", + "idna>=3.7,<4", + "PyYAML>=6.0.1,<7", + "cryptography>=43.0.1,<46", + "pyOpenSSL>=25.1.0,<26", + "python-dateutil>=2.9.0.post0,<3", + "six>=1.16.0,<2", + 'typing-extensions>=4.12.0,<5; python_version<"3.11"', + "connexion[flask]>=3.0.0,<4", + "text-unidecode>=1.3,<2", ], - url="https://github.com/Telefonica/pesp_capif_sdk", + extras_require={ + "dev": [ + "pytest>=8.3.2,<9", + "coverage>=7.4.0,<8", + "flake8>=7.1.0,<8", + "jinja2-time==0.2.0", + "binaryornot>=0.4.4,<0.5", + "pycodestyle>=2.14,<2.15", + "pyflakes>=3.4,<3.5", + "mccabe>=0.7,<0.8", + ], + }, + url="https://labs.etsi.org/rep/ocf/sdk", ) -- GitLab From 6c5c772a4b7acec771556c51b1543677ab76628b Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 13:04:15 +0200 Subject: [PATCH 22/30] Fix: add missing newline at the end of test_sdk.sh --- ci_cd_test/test_sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index b5ecbde..5bd68d0 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" \ No newline at end of file +echo "βœ… End of script" -- GitLab From 92651c1a3dc22f1f6ad475567ac4aa5f99e36343 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 13:08:19 +0200 Subject: [PATCH 23/30] Fix: update exclusions to correctly include network_app_samples and ci_cd_test directories --- cicd/exclusions | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cicd/exclusions b/cicd/exclusions index c90c0f7..78753ab 100644 --- a/cicd/exclusions +++ b/cicd/exclusions @@ -1,2 +1,4 @@ -.doc/ -.git/ \ No newline at end of file +doc/ +.git/ +network_app_samples/ +ci_cd_test/ \ No newline at end of file -- GitLab From 1439c2de0d4a842a06d2aa7caf90f535c7c2fc98 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 13:21:21 +0200 Subject: [PATCH 24/30] Fix: update lint configuration to specify 'lint.select' instead of 'select' --- cicd/ruff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cicd/ruff.toml b/cicd/ruff.toml index bff59ea..a75ab12 100644 --- a/cicd/ruff.toml +++ b/cicd/ruff.toml @@ -1,3 +1,3 @@ line-length = 120 target-version = "py39" -select = ["E", "W"] \ No newline at end of file +lint.select = ["E", "W"] \ No newline at end of file -- GitLab From 923ae02ef072beeccf4b1ecc3f2c8cbec4572a04 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Fri, 5 Sep 2025 13:43:46 +0200 Subject: [PATCH 25/30] Fix: update comments to use English for container and image names --- ci_cd_test/clean_test_sdk.sh | 2 +- ci_cd_test/test_sdk.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci_cd_test/clean_test_sdk.sh b/ci_cd_test/clean_test_sdk.sh index 382dbbb..67555f0 100755 --- a/ci_cd_test/clean_test_sdk.sh +++ b/ci_cd_test/clean_test_sdk.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Nombre del contenedor e imagen +# Name of container image CONTAINER_NAME=capif-sdk-runner IMAGE_NAME=opencapif_sdk diff --git a/ci_cd_test/test_sdk.sh b/ci_cd_test/test_sdk.sh index 5bd68d0..860a869 100755 --- a/ci_cd_test/test_sdk.sh +++ b/ci_cd_test/test_sdk.sh @@ -1,9 +1,9 @@ #!/bin/bash -# Nombre del contenedor e imagen +# Name of container image CONTAINER_NAME=capif-sdk-runner IMAGE_NAME=opencapif_sdk -BRANCH_NAME=SDK15-create-dockerfile-image-with-sdk +BRANCH_NAME=${CI_COMMIT_REF_NAME} NETWORK_NAME=capif-network SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -19,4 +19,4 @@ docker run \ --network $NETWORK_NAME \ $IMAGE_NAME -echo "βœ… End of script" +echo "βœ… End of script" \ No newline at end of file -- GitLab From b52bd7661a2378623e0386c15cbedc5ca37ad783 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 15 Sep 2025 09:55:59 +0200 Subject: [PATCH 26/30] update versions --- installation/requirements.txt | 6 +++--- setup.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/installation/requirements.txt b/installation/requirements.txt index 416b0d8..59ee89f 100644 --- a/installation/requirements.txt +++ b/installation/requirements.txt @@ -1,13 +1,13 @@ requests==2.32.3 PyYAML==6.0.1 -cryptography==38.0.4 -pyOpenSSL==22.1.0 +cryptography>=43.0.1,<46 +pyOpenSSL>=25.1.0,<26 urllib3==2.2.2 certifi==2024.7.4 idna==3.7 Flask==3.0.3 Flask-JWT-Extended==4.6.0 -Jinja2==3.1.4 +Jinja2>=3.1.6,<4 MarkupSafe==2.1.5 six==1.16.0 typing-extensions==3.10.0.2 diff --git a/setup.py b/setup.py index fe14cdf..433630b 100644 --- a/setup.py +++ b/setup.py @@ -30,14 +30,14 @@ setup( install_requires=[ "requests==2.32.3", "PyYAML==6.0.1", - "cryptography==38.0.4", - "pyOpenSSL==22.1.0", + "cryptography>=43.0.1,<46", + "pyOpenSSL>=25.1.0,<26", "urllib3==2.2.2", "certifi==2024.7.4", "idna==3.7", "Flask==3.0.3", "Flask-JWT-Extended==4.6.0", - "Jinja2==3.1.4", + "Jinja2>=3.1.6,<4", "MarkupSafe==2.1.5", "six==1.16.0", "typing-extensions>=4.8.0", -- GitLab From 610d82ef09d441437523b206e7468bbe2ee2d2c8 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Mon, 15 Sep 2025 10:36:45 +0200 Subject: [PATCH 27/30] update more versions to fix vulnerabilities --- installation/requirements.txt | 6 +++--- setup.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/installation/requirements.txt b/installation/requirements.txt index 59ee89f..2459d4b 100644 --- a/installation/requirements.txt +++ b/installation/requirements.txt @@ -1,8 +1,8 @@ -requests==2.32.3 +requests>=2.32.3,<3 PyYAML==6.0.1 cryptography>=43.0.1,<46 pyOpenSSL>=25.1.0,<26 -urllib3==2.2.2 +requests>=2.32.3,<3 certifi==2024.7.4 idna==3.7 Flask==3.0.3 @@ -11,7 +11,7 @@ Jinja2>=3.1.6,<4 MarkupSafe==2.1.5 six==1.16.0 typing-extensions==3.10.0.2 -Werkzeug==3.0.4 +Werkzeug>=3.1.2,<4 pytest==8.3.2 flake8==3.9.2 coverage==4.5.4 diff --git a/setup.py b/setup.py index 433630b..01a20e6 100644 --- a/setup.py +++ b/setup.py @@ -28,11 +28,11 @@ setup( ], packages=find_packages(include=["opencapif_sdk", "opencapif_sdk.*"]), # Ajusta segΓΊn tus necesidades install_requires=[ - "requests==2.32.3", + "requests>=2.32.3,<3", "PyYAML==6.0.1", "cryptography>=43.0.1,<46", "pyOpenSSL>=25.1.0,<26", - "urllib3==2.2.2", + "urllib3>=2.2.2,<3", "certifi==2024.7.4", "idna==3.7", "Flask==3.0.3", @@ -41,7 +41,7 @@ setup( "MarkupSafe==2.1.5", "six==1.16.0", "typing-extensions>=4.8.0", - "Werkzeug==3.0.4", + "Werkzeug>=3.1.2,<4", "pytest==8.3.2", "flake8==3.9.2", "coverage==4.5.4", -- GitLab From 3dac5d8b3d50815251ce7ab07f14a15f72132845 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 18 Sep 2025 08:52:35 +0200 Subject: [PATCH 28/30] add timeout for requests --- opencapif_sdk/capif_invoker_connector.py | 4 ++++ opencapif_sdk/service_discoverer.py | 3 ++- scripts/deregister_and_login.py | 4 +++- scripts/register_and_login.py | 3 ++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/opencapif_sdk/capif_invoker_connector.py b/opencapif_sdk/capif_invoker_connector.py index e973a69..9f85869 100644 --- a/opencapif_sdk/capif_invoker_connector.py +++ b/opencapif_sdk/capif_invoker_connector.py @@ -219,6 +219,7 @@ class capif_invoker_connector: url, cert=(self.signed_key_crt_path, self.private_key_path), verify=self.pathca, + timeout=60, ) response.raise_for_status() self.logger.info("Invoker offboarded successfully") @@ -306,6 +307,7 @@ class capif_invoker_connector: auth=HTTPBasicAuth(self.capif_username, self.capif_invoker_password), verify=False, + timeout=60, ) response.raise_for_status() @@ -350,6 +352,7 @@ class capif_invoker_connector: headers=headers, data=payload, verify=self.pathca, + timeout=60, ) response.raise_for_status() response_payload = json.loads(response.text) @@ -455,6 +458,7 @@ class capif_invoker_connector: data=payload, cert=(self.signed_key_crt_path, self.private_key_path), verify=self.pathca, + timeout=60, ) response.raise_for_status() diff --git a/opencapif_sdk/service_discoverer.py b/opencapif_sdk/service_discoverer.py index a000142..0129420 100644 --- a/opencapif_sdk/service_discoverer.py +++ b/opencapif_sdk/service_discoverer.py @@ -525,7 +525,8 @@ class service_discoverer: "POST", url, headers=headers, - json=payload + json=payload, + timeout=60 ) response.raise_for_status() diff --git a/scripts/deregister_and_login.py b/scripts/deregister_and_login.py index d44d914..529ccf1 100644 --- a/scripts/deregister_and_login.py +++ b/scripts/deregister_and_login.py @@ -39,6 +39,7 @@ def __log_to_capif(variables): headers={"Content-Type": "application/json"}, auth=HTTPBasicAuth(variables["capif_register_username"], variables["capif_register_password"]), verify=False, + timeout=60, ) response.raise_for_status() response_payload = json.loads(response.text) @@ -64,7 +65,8 @@ def de_register_from_capif(admin_token, variables): url, headers=headers, data=None, - verify=False + verify=False, + timeout=60 ) response.raise_for_status() logger.info("User deleted") diff --git a/scripts/register_and_login.py b/scripts/register_and_login.py index 76646b7..659da1c 100644 --- a/scripts/register_and_login.py +++ b/scripts/register_and_login.py @@ -35,6 +35,7 @@ def __log_to_capif(variables): headers={"Content-Type": "application/json"}, auth=HTTPBasicAuth(variables["capif_register_username"], variables["capif_register_password"]), verify=False, + timeout=60, ) response.raise_for_status() response_payload = json.loads(response.text) @@ -64,7 +65,7 @@ def __create_user(admin_token, variables): } response = requests.request( - "POST", url, headers=headers, data=json.dumps(payload), verify=False + "POST", url, headers=headers, data=json.dumps(payload), verify=False, timeout=60 ) response.raise_for_status() response_payload = json.loads(response.text) -- GitLab From 767cde47bf6358c3073cbe1604b379a7d34a182d Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 18 Sep 2025 09:11:32 +0200 Subject: [PATCH 29/30] reduce timeout --- opencapif_sdk/capif_invoker_connector.py | 8 ++++---- opencapif_sdk/service_discoverer.py | 2 +- scripts/deregister_and_login.py | 4 ++-- scripts/register_and_login.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/opencapif_sdk/capif_invoker_connector.py b/opencapif_sdk/capif_invoker_connector.py index 9f85869..3ba5aac 100644 --- a/opencapif_sdk/capif_invoker_connector.py +++ b/opencapif_sdk/capif_invoker_connector.py @@ -219,7 +219,7 @@ class capif_invoker_connector: url, cert=(self.signed_key_crt_path, self.private_key_path), verify=self.pathca, - timeout=60, + timeout=10, ) response.raise_for_status() self.logger.info("Invoker offboarded successfully") @@ -307,7 +307,7 @@ class capif_invoker_connector: auth=HTTPBasicAuth(self.capif_username, self.capif_invoker_password), verify=False, - timeout=60, + timeout=10, ) response.raise_for_status() @@ -352,7 +352,7 @@ class capif_invoker_connector: headers=headers, data=payload, verify=self.pathca, - timeout=60, + timeout=10, ) response.raise_for_status() response_payload = json.loads(response.text) @@ -458,7 +458,7 @@ class capif_invoker_connector: data=payload, cert=(self.signed_key_crt_path, self.private_key_path), verify=self.pathca, - timeout=60, + timeout=10, ) response.raise_for_status() diff --git a/opencapif_sdk/service_discoverer.py b/opencapif_sdk/service_discoverer.py index 0129420..c20ad02 100644 --- a/opencapif_sdk/service_discoverer.py +++ b/opencapif_sdk/service_discoverer.py @@ -526,7 +526,7 @@ class service_discoverer: url, headers=headers, json=payload, - timeout=60 + timeout=10 ) response.raise_for_status() diff --git a/scripts/deregister_and_login.py b/scripts/deregister_and_login.py index 529ccf1..dd16698 100644 --- a/scripts/deregister_and_login.py +++ b/scripts/deregister_and_login.py @@ -39,7 +39,7 @@ def __log_to_capif(variables): headers={"Content-Type": "application/json"}, auth=HTTPBasicAuth(variables["capif_register_username"], variables["capif_register_password"]), verify=False, - timeout=60, + timeout=10, ) response.raise_for_status() response_payload = json.loads(response.text) @@ -66,7 +66,7 @@ def de_register_from_capif(admin_token, variables): headers=headers, data=None, verify=False, - timeout=60 + timeout=10 ) response.raise_for_status() logger.info("User deleted") diff --git a/scripts/register_and_login.py b/scripts/register_and_login.py index 659da1c..7fd63c1 100644 --- a/scripts/register_and_login.py +++ b/scripts/register_and_login.py @@ -35,7 +35,7 @@ def __log_to_capif(variables): headers={"Content-Type": "application/json"}, auth=HTTPBasicAuth(variables["capif_register_username"], variables["capif_register_password"]), verify=False, - timeout=60, + timeout=10, ) response.raise_for_status() response_payload = json.loads(response.text) @@ -65,7 +65,7 @@ def __create_user(admin_token, variables): } response = requests.request( - "POST", url, headers=headers, data=json.dumps(payload), verify=False, timeout=60 + "POST", url, headers=headers, data=json.dumps(payload), verify=False, timeout=10 ) response.raise_for_status() response_payload = json.loads(response.text) -- GitLab From 634894324f4f54732e9b0d0a37dc15911c5302d5 Mon Sep 17 00:00:00 2001 From: guillecxb Date: Thu, 18 Sep 2025 09:49:05 +0200 Subject: [PATCH 30/30] verify test --- opencapif_sdk/capif_invoker_connector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencapif_sdk/capif_invoker_connector.py b/opencapif_sdk/capif_invoker_connector.py index 3ba5aac..fa5e94e 100644 --- a/opencapif_sdk/capif_invoker_connector.py +++ b/opencapif_sdk/capif_invoker_connector.py @@ -306,7 +306,7 @@ class capif_invoker_connector: headers={"Content-Type": "application/json"}, auth=HTTPBasicAuth(self.capif_username, self.capif_invoker_password), - verify=False, + verify=True, timeout=10, ) -- GitLab