Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into satosa_disco_login
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioMurru committed Jul 24, 2023
2 parents 3cb3c65 + 8a1d4b1 commit d4c753f
Show file tree
Hide file tree
Showing 44 changed files with 2,463 additions and 28 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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: eudi_wallet_python
name: pyeudiw

on:
push:
Expand Down Expand Up @@ -39,15 +39,16 @@ jobs:
if [ -f requirements-customizations.txt ]; then pip install -r requirements-customizations.txt; fi
python -m pip install -U setuptools
python -m pip install -e .
python -m pip install "Pillow>=10.0.0,<10.1" "device_detector>=5.0,<6" "satosa>=8.4,<8.6" "jinja2>=3.0,<4"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 eudi_wallet_python --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 pyeudiw --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 eudi_wallet_python --count --exit-zero --statistics --max-line-length 160
flake8 pyeudiw --count --exit-zero --statistics --max-line-length 160
- name: Tests
run: |
pytest --cov
pytest --cov=pyeudiw -v --cov-report term --cov-fail-under=80 pyeudiw/tests/
- name: Bandit Security Scan
run: |
bandit -r -x eudi_wallet_python/tests* eudi_wallet_python/*
bandit -r -x pyeudiw/tests* pyeudiw/*
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
requirements.txt

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -157,7 +158,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

env

Expand Down
20 changes: 20 additions & 0 deletions README-SATOSA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SATOSA backend setup

Install extra dependency: `pip install pyeudiw[satosa]`


1. Customize [example/satosa/pyeudiw_backend.yaml](example/satosa/pyeudiw_backend.yaml), then copy it in your satosa `plugins/backend` project folder. Example `plugins/backends/pyeudiw_backend.yaml`;
2. Add ` - "plugins/backends/pyeudiw_backend.yaml"` in your SATOSA `proxy_conf.yaml` file, within the section `BACKEND_MODULES`;
3. Add ` - "plugins/microservices/disco_to_target_issuer.yaml"` and ` - "plugins/microservices/target_based_routing.yaml"` in your SATOSA `proxy_conf.yaml` file, within the section `MICRO_SERVICES`;
4. In `plugins/microservices/target_based_routing.yaml` please add ` "https://eudi.wallet.gov.it": "OpenID4VP"`
5. Customize [example/satosa/disco.html](example/satosa/disco.html), then copy it in satosa static file folder. Example `example/static/disco.html`

Then start the proxy.

# Parameters

TBD. A Markdown table with:

- parameter name
- description
- example value
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@
[![Get invited](https://slack.developers.italia.it/badge.svg)](https://slack.developers.italia.it/)
[![Join the #spid openid](https://img.shields.io/badge/Slack%20channel-%23spid%20openid-blue.svg)](https://developersitalia.slack.com/archives/C7E85ED1N/)

EUDI Wallet Python toolchain is a suite of Python libraries designed to
The EUDI Wallet Python toolchain is a suite of Python libraries designed to
make it easy the implementation of an EUDI Wallet Relying Party according
to the [Italian specification](https://italia.github.io/eudi-wallet-it-docs/en/).

> Please note: the scope of this project is giving tools and helpers to build a EUDI Wallet compliant to the national specs. All the components listed below are tailored to this scope.
> Please note: the scope of this project is giving tools and helpers to build a EUDI Wallet compliant to the national specs.
All the components listed below are tailored to this scope.

The toolchain contains the following components:

| Name | Description |
| :--- | --- |
| __tools.jwk__ | Creation of JSON Web Key (JWK) according to [RFC7517](https://datatracker.ietf.org/doc/html/rfc7517). | refs to docs |
| __tools.jwt__ | Creation of signed or encrypted JSON Web Token (JWT) according to [RFC7519](https://datatracker.ietf.org/doc/html/rfc7519), [RFC7515](https://datatracker.ietf.org/doc/html/rfc7515) and [RFC7516](https://datatracker.ietf.org/doc/html/rfc7516) | refs to docs |
| __tools.ui.qrcode__ | Creation of QRCodes | refs to docs |
| __jwk__ | Creation of JSON Web Key (JWK) according to [RFC7517](https://datatracker.ietf.org/doc/html/rfc7517). | refs to docs |
| __jwt__ | Creation of signed or encrypted JSON Web Token (JWT) according to [RFC7519](https://datatracker.ietf.org/doc/html/rfc7519), [RFC7515](https://datatracker.ietf.org/doc/html/rfc7515) and [RFC7516](https://datatracker.ietf.org/doc/html/rfc7516) | refs to docs |
| __tools.qrcode__ | Creation of QRCodes | refs to docs |
| __oauth2.dpop__ | Tools for issuing and parsing DPoP artifacts, according to [OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP)](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-dpop) | refs to docs |
| __oauth2.par__ | Tools for issuing and parsing Pushed Authorization Requests, according to [OAuth 2.0 Pushed Authorization Requests](https://datatracker.ietf.org/doc/html/rfc9126) | refs to docs |
| __openid4vp.request__ | Tools for issuing [OpenID4VP](https://openid.net/specs/openid-4-verifiable-presentations-1_0.html) requests objects | refs to docs |
| __openid4vp.redirect__ | Tools for parsing [OpenID4VP](https://openid.net/specs/openid-4-verifiable-presentations-1_0.html) responses | refs to docs |
| __openid4vp.federation__ | OpenID Connect Federation Wallet Relying Party Entities and Trust Mechanisms | refs to docs |
| __dif.presentation_exchange__ | [DiF Presentation Exchange 2.0](https://identity.foundation/presentation-exchange/) | refs to docs |
| __satosa.openid4vp.backend__ | SATOSA Openid4VP Relying Party backend | refs to docs |


## Setup

Install enviroment and dependencies
````
apt install python3-dev python3-pip git
python3 -m pip install --upgrade pip
sudo pip install virtualenv
sudo apt install python3-dev python3-pip git
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install virtualenv
````

Activate the environment. It's optional and up to you if you want to install
Expand All @@ -45,11 +45,11 @@ virtualenv -p python3 env
source env/bin/activate
````

Install using pip
Install using pip:

`pip install eudi-wallet-python`
`pip install pyeudiw`

Install using github
Install using github:

`pip install git+https://github.com/italia/eudi-wallet-it-python`

Expand All @@ -63,6 +63,11 @@ The example project is a docker-compose that runs a demo composed by the followi

## Satosa configuration

To install the OpenID4VP SATOSA backend you just need to do four things:

1. install this package
2. copy and customize [example/pyeudiw_backend.yml](example/pyeudiw_backend.yml)

See [README-SATOSA.md](README-SATOSA.md).

## Contribute
Expand All @@ -86,6 +91,6 @@ Please consider the following branches:

- Giuseppe De Marco
- Pasquale De Rose
- Alessio Amurri
- Nicola ...
- ...
- Alessio Murru
- Salvatore Laiso
- Nicola Saitto
Empty file removed eudi_wallet_python/oauth2/dpop.py
Empty file.
Empty file.
1 change: 0 additions & 1 deletion eudi_wallet_python/tests/__init__.py

This file was deleted.

Empty file removed eudi_wallet_python/tools/jwk.py
Empty file.
Empty file removed eudi_wallet_python/tools/jwt.py
Empty file.
Loading

0 comments on commit d4c753f

Please sign in to comment.