From ea575627bf5e0b6722874db70597261233e49a59 Mon Sep 17 00:00:00 2001 From: Salvatore Laiso Date: Wed, 24 Jan 2024 14:18:14 +0100 Subject: [PATCH 1/8] fix: github action --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 58add00e..5b67954b 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -43,7 +43,7 @@ jobs: - name: docker compose run: | cd Docker-compose - docker compose -f docker-compose.yml up -d + ./run-docker-compose.sh - name: djangosaml2 SP metadata to Proxy run: | wget http://localhost:8000/saml2/metadata -O example/metadata/sp/djangosaml2_sp.xml @@ -67,4 +67,4 @@ jobs: - name: spid-sp-test eIDAS FiCEP metadata run: | cd docker-example - spid_sp_test --profile ficep-eidas-sp --metadata-url https://localhost/spidSaml2/metadata \ No newline at end of file + spid_sp_test --profile ficep-eidas-sp --metadata-url https://localhost/spidSaml2/metadata From af19c4b9c9fdda40333341c5a45505dc642ea041 Mon Sep 17 00:00:00 2001 From: Salvatore Laiso Date: Wed, 24 Jan 2024 14:33:59 +0100 Subject: [PATCH 2/8] test: ci --- .github/workflows/_python-app.yml | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/_python-app.yml diff --git a/.github/workflows/_python-app.yml b/.github/workflows/_python-app.yml new file mode 100644 index 00000000..8d96592b --- /dev/null +++ b/.github/workflows/_python-app.yml @@ -0,0 +1,70 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Satosa-Saml2Spid + +on: + push: + branches: [ master, dev, eudi, fix-ci ] + pull_request: + branches: [ master, dev, eudi, fix-ci ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: + - '3.10' + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install spid-sp-test>=1.2.8 + pip install flake8 + - name: Lint with flake8 + run: | + ## stop the build if there are Python syntax errors or undefined names + flake8 --count --select=E9,F63,F7,F82 --show-source --statistics example + ## exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 --max-line-length 120 --count --exit-zero --statistics example + - name: Create docker-example folder + run: | + mkdir -p docker-example + cp -r example/. docker-example + - name: docker compose + run: | + cd Docker-compose + ./run-docker-compose.sh + - name: djangosaml2 SP metadata to Proxy + run: | + wget http://localhost:8000/saml2/metadata -O example/metadata/sp/djangosaml2_sp.xml + - name: run satosa-saml2spid + run: | + cd docker-example + mkdir -p metadata/idp + mkdir -p metadata/sp + - name: Metadata proxy to djangosaml2 SP + run: | + wget --no-check-certificate https://localhost/Saml2IDP/metadata -O example_sp/djangosaml2_sp/saml2_sp/saml2_config/satosa-saml2spid.xml + - name: spid-sp-test SPID metadata, requests and responses + run: | + cd docker-example + spid_sp_test --idp-metadata > metadata/idp/spid-sp-test.xml + spid_sp_test --metadata-url https://localhost/spidSaml2/metadata --authn-url "http://localhost:8000/saml2/login/?idp=https://localhost/Saml2IDP/metadata&next=/saml2/echo_attributes&idphint=https%253A%252F%252Flocalhost%253A8080" -ap spid_sp_test.plugins.authn_request.SatosaSaml2Spid --extra --debug ERROR -tr + - name: spid-sp-test CIE id metadata + run: | + cd docker-example + spid_sp_test --profile cie-sp-public --metadata-url https://localhost/cieSaml2/metadata + - name: spid-sp-test eIDAS FiCEP metadata + run: | + cd docker-example + spid_sp_test --profile ficep-eidas-sp --metadata-url https://localhost/spidSaml2/metadata From de05d2977500a532925cf499d02e1c671fabe9e7 Mon Sep 17 00:00:00 2001 From: Salvatore Laiso <32564922+salvatorelaiso@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:41:45 +0100 Subject: [PATCH 3/8] fix: container name instead of localhost --- .github/workflows/_python-app.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_python-app.yml b/.github/workflows/_python-app.yml index 8d96592b..f0684e72 100644 --- a/.github/workflows/_python-app.yml +++ b/.github/workflows/_python-app.yml @@ -54,17 +54,17 @@ jobs: mkdir -p metadata/sp - name: Metadata proxy to djangosaml2 SP run: | - wget --no-check-certificate https://localhost/Saml2IDP/metadata -O example_sp/djangosaml2_sp/saml2_sp/saml2_config/satosa-saml2spid.xml + wget --no-check-certificate https://satosa-nginx/Saml2IDP/metadata -O example_sp/djangosaml2_sp/saml2_sp/saml2_config/satosa-saml2spid.xml - name: spid-sp-test SPID metadata, requests and responses run: | cd docker-example spid_sp_test --idp-metadata > metadata/idp/spid-sp-test.xml - spid_sp_test --metadata-url https://localhost/spidSaml2/metadata --authn-url "http://localhost:8000/saml2/login/?idp=https://localhost/Saml2IDP/metadata&next=/saml2/echo_attributes&idphint=https%253A%252F%252Flocalhost%253A8080" -ap spid_sp_test.plugins.authn_request.SatosaSaml2Spid --extra --debug ERROR -tr + spid_sp_test --metadata-url https://satosa-nginx/spidSaml2/metadata --authn-url "http://localhost:8000/saml2/login/?idp=https://localhost/Saml2IDP/metadata&next=/saml2/echo_attributes&idphint=https%253A%252F%252Flocalhost%253A8080" -ap spid_sp_test.plugins.authn_request.SatosaSaml2Spid --extra --debug ERROR -tr - name: spid-sp-test CIE id metadata run: | cd docker-example - spid_sp_test --profile cie-sp-public --metadata-url https://localhost/cieSaml2/metadata + spid_sp_test --profile cie-sp-public --metadata-url https://satosa-nginx/cieSaml2/metadata - name: spid-sp-test eIDAS FiCEP metadata run: | cd docker-example - spid_sp_test --profile ficep-eidas-sp --metadata-url https://localhost/spidSaml2/metadata + spid_sp_test --profile ficep-eidas-sp --metadata-url https://satosa-nginx/spidSaml2/metadata From 9fe49aed925dd192081920d3bfb91eca4f3496aa Mon Sep 17 00:00:00 2001 From: Salvatore Laiso <32564922+salvatorelaiso@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:48:53 +0100 Subject: [PATCH 4/8] fix: `pyeudiw` set to dev --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8e95bc82..e2fc8fe0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ jinja2 # Wallet RP # pyeudiw[satosa,federation] -pyeudiw +git+https://github.com/italia/eudi-wallet-it-python@dev Pillow>=10.0.0,<10.1 device_detector>=5.0,<6 From 26fd082a0455c1f768ec51ce7ecd0244ffc1ad1d Mon Sep 17 00:00:00 2001 From: Salvatore Laiso <32564922+salvatorelaiso@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:52:17 +0100 Subject: [PATCH 5/8] fix: revert to localhost --- .github/workflows/_python-app.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_python-app.yml b/.github/workflows/_python-app.yml index f0684e72..8d96592b 100644 --- a/.github/workflows/_python-app.yml +++ b/.github/workflows/_python-app.yml @@ -54,17 +54,17 @@ jobs: mkdir -p metadata/sp - name: Metadata proxy to djangosaml2 SP run: | - wget --no-check-certificate https://satosa-nginx/Saml2IDP/metadata -O example_sp/djangosaml2_sp/saml2_sp/saml2_config/satosa-saml2spid.xml + wget --no-check-certificate https://localhost/Saml2IDP/metadata -O example_sp/djangosaml2_sp/saml2_sp/saml2_config/satosa-saml2spid.xml - name: spid-sp-test SPID metadata, requests and responses run: | cd docker-example spid_sp_test --idp-metadata > metadata/idp/spid-sp-test.xml - spid_sp_test --metadata-url https://satosa-nginx/spidSaml2/metadata --authn-url "http://localhost:8000/saml2/login/?idp=https://localhost/Saml2IDP/metadata&next=/saml2/echo_attributes&idphint=https%253A%252F%252Flocalhost%253A8080" -ap spid_sp_test.plugins.authn_request.SatosaSaml2Spid --extra --debug ERROR -tr + spid_sp_test --metadata-url https://localhost/spidSaml2/metadata --authn-url "http://localhost:8000/saml2/login/?idp=https://localhost/Saml2IDP/metadata&next=/saml2/echo_attributes&idphint=https%253A%252F%252Flocalhost%253A8080" -ap spid_sp_test.plugins.authn_request.SatosaSaml2Spid --extra --debug ERROR -tr - name: spid-sp-test CIE id metadata run: | cd docker-example - spid_sp_test --profile cie-sp-public --metadata-url https://satosa-nginx/cieSaml2/metadata + spid_sp_test --profile cie-sp-public --metadata-url https://localhost/cieSaml2/metadata - name: spid-sp-test eIDAS FiCEP metadata run: | cd docker-example - spid_sp_test --profile ficep-eidas-sp --metadata-url https://satosa-nginx/spidSaml2/metadata + spid_sp_test --profile ficep-eidas-sp --metadata-url https://localhost/spidSaml2/metadata From 0d2b350e8d174b8acef774c9017412199649e502 Mon Sep 17 00:00:00 2001 From: Salvatore Laiso <32564922+salvatorelaiso@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:58:28 +0100 Subject: [PATCH 6/8] fix: missing `xmlsec1` --- .github/workflows/_python-app.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_python-app.yml b/.github/workflows/_python-app.yml index 8d96592b..f0a49fc9 100644 --- a/.github/workflows/_python-app.yml +++ b/.github/workflows/_python-app.yml @@ -22,6 +22,8 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install xmlsec1 + run: sudo apt-get install -y xmlsec1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -38,8 +40,8 @@ jobs: flake8 --max-line-length 120 --count --exit-zero --statistics example - name: Create docker-example folder run: | - mkdir -p docker-example - cp -r example/. docker-example + mkdir -p docker-example + cp -r example/. docker-example - name: docker compose run: | cd Docker-compose From 3ef711425a0e8560e55e78094bbf40610379756d Mon Sep 17 00:00:00 2001 From: Salvatore Laiso <32564922+salvatorelaiso@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:59:29 +0100 Subject: [PATCH 7/8] fix: indentation --- .github/workflows/_python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_python-app.yml b/.github/workflows/_python-app.yml index f0a49fc9..caa4ce14 100644 --- a/.github/workflows/_python-app.yml +++ b/.github/workflows/_python-app.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install xmlsec1 - run: sudo apt-get install -y xmlsec1 + run: sudo apt-get install -y xmlsec1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From 6ec0a5231a9268be9cc49e57b9af5352db2db3f4 Mon Sep 17 00:00:00 2001 From: Salvatore Laiso <32564922+salvatorelaiso@users.noreply.github.com> Date: Wed, 24 Jan 2024 16:05:18 +0100 Subject: [PATCH 8/8] ifx: add logs --- .github/workflows/_python-app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/_python-app.yml b/.github/workflows/_python-app.yml index caa4ce14..a5e6696d 100644 --- a/.github/workflows/_python-app.yml +++ b/.github/workflows/_python-app.yml @@ -46,6 +46,7 @@ jobs: run: | cd Docker-compose ./run-docker-compose.sh + docker ps -a - name: djangosaml2 SP metadata to Proxy run: | wget http://localhost:8000/saml2/metadata -O example/metadata/sp/djangosaml2_sp.xml