Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next release #63

Merged
merged 58 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
b916c64
fix: JWK and JWT encryption ops and kid resolution
peppelinux Jul 30, 2023
c32138f
fix: JWK and JWT encryption ops and kid resolution - linting
peppelinux Jul 30, 2023
a0699d7
feat: define abstract storage and allow multiple storage using the sa…
peppelinux Jul 30, 2023
ab89a34
Merge pull request #58 from italia/jwtfix
Jul 31, 2023
7bb9e71
Merge pull request #59 from italia/storage
Jul 31, 2023
da75f0f
refactor: from qrcode to pyqrcode (#62)
salvatorelaiso Jul 31, 2023
9c0485d
feat: added federation components
peppelinux Jul 31, 2023
ac42df1
[Feature] Db Engine (#65)
PascalDR Jul 31, 2023
e471919
fix: federation.jwtse and added a better summary for the CI coverage
peppelinux Jul 31, 2023
9db47ba
fix: enable again pytest summary
peppelinux Jul 31, 2023
dcec996
Added critical logging (#67)
PascalDR Aug 1, 2023
00dc7fc
feat: added default algs in general config, added abstract trust chai…
peppelinux Aug 1, 2023
63f4263
wip: federation tests snippets
peppelinux Aug 1, 2023
e413776
feat: add vp token schema (#71)
salvatorelaiso Aug 2, 2023
7c96dd4
Implemented property is_valid in StaticTrustChainValidator (#74)
PascalDR Aug 2, 2023
9d9b68d
fix: Federation chains ops
peppelinux Aug 2, 2023
c4eaeba
fix: Federations tests and code
peppelinux Aug 2, 2023
ee501ca
fix: linting
peppelinux Aug 2, 2023
c94aaa8
chore: TODO comment
peppelinux Aug 3, 2023
f10a6eb
fix: removed comment
pderose Aug 3, 2023
9e80e1d
feat: html linter (#76)
salvatorelaiso Aug 3, 2023
8259ef8
fix: if jwk not exist return false directly
pderose Aug 3, 2023
e967414
test: added test test_is_valid_equals_false
pderose Aug 3, 2023
2571cfb
fix: fixed import
pderose Aug 3, 2023
29accde
Docker wordpress test (#75)
MurruAlessio Aug 3, 2023
989d56e
fix: refactored update
pderose Aug 3, 2023
ddcd727
fix: fixed return value in _retrieve_es
pderose Aug 3, 2023
51fd3d7
fix: refactored _update_st
pderose Aug 3, 2023
ff26a69
test: added some test for update function
pderose Aug 3, 2023
9475d98
feat: add entity configuration schema validation (#79)
salvatorelaiso Aug 3, 2023
293a7f2
fix: moved imports
pderose Aug 4, 2023
1f98e14
fix: fixed variable retriving
pderose Aug 4, 2023
008ace3
test: added test test_update_st_es_case_source_endpoint
pderose Aug 4, 2023
6614618
feat: added is_ec
pderose Aug 4, 2023
3425c59
Satosa disco login (#78)
MurruAlessio Aug 4, 2023
8ce2aae
fix: fixed test test_update_st_es_case_source_endpoint
pderose Aug 4, 2023
1f52b76
fix: removed endpoint
pderose Aug 4, 2023
a3253cc
test: added tests for dchema file
pderose Aug 4, 2023
edda541
test: initial tests for policy.py
pderose Aug 4, 2023
e9df402
refactor: schema validations (#84)
salvatorelaiso Aug 4, 2023
04d65e6
chore: little f-string
peppelinux Aug 4, 2023
0281752
Merge branch 'test/federation' of https://github.com/PascalDR/eudi-wa…
peppelinux Aug 4, 2023
65e3526
chore: little f-string
peppelinux Aug 4, 2023
92ac2b5
Merge branch 'dev' of https://github.com/italia/eudi-wallet-it-python…
peppelinux Aug 4, 2023
4725dc7
ci: added coveragerc file
peppelinux Aug 4, 2023
6d057d0
chore: linting federation cleanup
peppelinux Aug 4, 2023
76c7e0e
chore: federation tc disco assertions
peppelinux Aug 5, 2023
16cc2ce
Merge pull request #61 from italia/fed
Aug 5, 2023
04376bc
Integrated db engine in backend (#87)
PascalDR Aug 7, 2023
55e12ae
Minor fix to db_engine (#88)
PascalDR Aug 7, 2023
93d8fb3
Various fix to handle issuer jwk correctly (#89)
PascalDR Aug 8, 2023
9b3f5f1
feat: status endpoint (#92)
salvatorelaiso Aug 9, 2023
6966817
Feature trust chain storage (#94)
PascalDR Aug 9, 2023
48d4dae
fix: huge cleanup and fix of regressions and missing stuffs
peppelinux Aug 9, 2023
0a5cb06
v0.3.0
peppelinux Aug 9, 2023
ca62127
chore: cleanup
peppelinux Aug 9, 2023
94c8d00
fix: missing import
peppelinux Aug 9, 2023
32bf96e
ci: html linting (#86)
salvatorelaiso Aug 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
branch = true
omit = */tests/*,*/wsgi.py, fabfile.py, /usr/local/*, ./setup.py
source = .

[report]
show_missing = true
24 changes: 22 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ 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" "pymongo>=4.4.1,<4.5"
python -m pip install "Pillow>=10.0.0,<10.1" "device_detector>=5.0,<6" "satosa>=8.4,<8.6" "jinja2>=3.0,<4" "pymongo>=4.4.1,<4.5" aiohttp
python -m pip install git+https://github.com/danielfett/sd-jwt.git

- name: Lint with flake8
Expand All @@ -59,7 +59,27 @@ jobs:
flake8 pyeudiw --count --exit-zero --statistics --max-line-length 160
- name: Tests
run: |
pytest --cov=pyeudiw -v --cov-report term --cov-fail-under=80 pyeudiw/tests/
pytest --cov=pyeudiw --cov-fail-under=80
coverage report -m --skip-covered
- name: Bandit Security Scan
run: |
bandit -r -x pyeudiw/tests* pyeudiw/*
- name: Lint with html linter
run: |
echo -e '\nHTML:'
readarray -d '' array < <(find $SRC example -name "*.html" -print0)
echo "Running linter on (${#array[@]}): "
printf '\t- %s\n' "${array[@]}"
echo "Linter output:"

for file in "${array[@]}"
do
echo -e "\n$file:"
html_lint.py "$file" | awk -v path="file://$PWD/$file:" '$0=path$0' | sed -e 's/: /:\n\t/';
done

for file in "${array[@]}"
do
errors=$(html_lint.py "$file" | grep -c 'Error')
if [ "$errors" -gt 0 ]; then exit 1; fi;
done
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ cython_debug/
.idea/

env
**/.DS_Store

*/wordpress-plugin
*/wordpress-theme
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ The toolchain contains the following components:
| __jwt__ | Signed and 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) |
| __tools.qrcode__ | QRCodes creation |
| __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) |
| __openid4vp.federation__ | OpenID Connect Federation Wallet Relying Party Entities and Trust Mechanisms |
| __satosa.openid4vp.backend__ | SATOSA OpenID4VP Relying Party backend |
| __openid4vp.federation__ | Trust evaluation mechanisms, according to [OpenID Connect Federation 1.0](https://openid.net/specs/openid-connect-federation-1_0.html) |
| __satosa.openid4vp.backend__ | SATOSA Relying Party backend, according to [OpenID for Verifiable Presentations](https://openid.bitbucket.io/connect/openid-4-verifiable-presentations-1_0.html) |


## Setup
Expand Down
26 changes: 25 additions & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,28 @@ After following these steps, your WordPress instance should be up and running wi
2. Under [plugins](http://localhost:8080/wp-admin/plugins.php), activate the plugin OneLogin SAML SSO.
3. Configure the plugin OneLogin SAML SSO in the [settings tab](http://localhost:8080/wp-admin/options-general.php?page=onelogin_saml_configuration).

To configure a generic SAML connection, you will need to enter appropriate values in OneLogin SAML SSO plugin settings. These include Identity Provider URL, Assertion Consumer Service URL, Single Logout Service URL, and other parameters specific to your SAML configuration.
To configure your test environment with the IAM Proxy instance, you'll need to undertake a configuration phase on the OneLogin plugin settings page. The required proxy service configuration metadata is obtainable from https://demo-it-wallet.westeurope.cloudapp.azure.com/Saml2IDP/metadata.

Specifically, you should modify the following fields:

- **IdP Entity Id**: Enter the entityID of the IAMProxy, which can be located within the metadata.
- **Single Sign-On Service Url**: Input the Location of the SingleSignOnService you desire to connect with, as specified in the metadata file.
- **X.509 Certificate**: Include the X.509 Certificate associated with the IAMProxy, found within the metadata.
- **Create user if not exists**: Set this to `true`.
- **Update user data**: Set this to `true`.
- **Attribute Mapping - Username**: Set this to `fiscalNumber`.
- **Attribute Mapping - E-mail**: Set this to `urn:oid:1.2.840.113549.1.9.1.1`.
- **Attribute Mapping - First Name**: Set this to `Name`.
- **Attribute Mapping - Last Name**: Set this to `familyName`.
- **Service Provider Entity Id**: Enter the URL of your SP metadata as the entityID. For example: http://\<wordpress-domain\>/wp-login.php?saml_metadata
- **Encrypt nameID**: Set this to `true`.
- **Sign AuthnRequest**: Set this to `true`.
- **Reject Unsigned Assertions**: Set this to `true`.
- **NameIDFormat**: Set this to `urn:oasis:names:tc:SAML:2.0:attrname-format:uri`.
- **requestedAuthnContext**: Set this to `urn:oasis:names:tc:SAML:2.0:ac:classes:X509`.
- **Service Provider X.509 Certificate**: Insert your SP's X.509 certificate here.
- **Service Provider Private Key**: Input the private key of your SP.
- **Signature Algorithm**: Set this to `rsa-sha256`.
- **Digest Algorithm**: Set this to `sha256`.

After you've filled all the fields, save your settings and download the SP metadata for configuration on the IAM Proxy.
4 changes: 4 additions & 0 deletions example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ services:
volumes:
- ./wordpress-plugin/onelogin-saml-sso/:/var/www/html/wp-content/plugins/onelogin-saml-sso/
- ./wordpress-theme/italiawp2/:/var/www/html/wp-content/themes/italiawp2/
- ./onelogin_custom_settings/functions.php:/var/www/html/wp-content/plugins/onelogin-saml-sso/php/functions.php
- ./onelogin_custom_settings/configuration.php:/var/www/html/wp-content/plugins/onelogin-saml-sso/php/configuration.php
- ./onelogin_custom_settings/settings.php:/var/www/html/wp-content/plugins/onelogin-saml-sso/php/settings.php
- ./italiaWP2_custom_settings/header.php:/var/www/html/wp-content/themes/italiawp2/header.php
networks:
- wordpress-network

Expand Down
60 changes: 60 additions & 0 deletions example/italiaWP2_custom_settings/header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge; <?php bloginfo('html_type') ?>; charset=<?php bloginfo('charset') ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1">

<?php if(get_option('custom-meta-keywords')!=""): ?>
<meta name="keywords" content="<?php echo get_option('custom-meta-keywords'); ?>">
<?php endif; ?>

<?php if(get_option('custom-meta-description')!=""): ?>
<meta name="description" content="<?php echo get_option('custom-meta-description'); ?>">
<?php else: ?>
<meta name="description" content="<?php echo get_bloginfo('description'); ?>">
<?php endif; ?>

<?php wp_head(); ?>
</head>

<body class="t-Pac">

<?php get_template_part('template-parts/section-cookies'); ?>

<div class="body_wrapper push_container clearfix" id="page_top">
<div class="skiplink sr-only">
<ul>
<li>
<a accesskey="2" href="#main_container"><?php echo __('Go to content','italiawp2'); ?></a>
</li>
<li>
<a accesskey="3" href="#menup"><?php echo __('Go to the navigation menu','italiawp2'); ?></a>
</li>
<li><a accesskey="4" href="#footer"><?php echo __('Go to the footer','italiawp2'); ?></a></li>
</ul>
</div>

<header id="mainheader" class="u-background-50">
<?php get_template_part('menu'); ?>
</header>

<main id="main_container">

<?php if (is_user_logged_in()):
$user = wp_get_current_user();
$spidRole_value = get_user_meta($user->ID, 'spidRole', true);
?>
<div class="site-content" style="border: 1px solid black; padding: 1em;">
<h2>Benvenuto <span style="color: blue;"><?php echo $user->first_name.' '.$user->last_name; ?></span></h2>
<p>Di seguito potrai trovare le tue informazioni principali:</p>
<ul>
<li><strong>Nome:</strong> <?php echo $user->first_name; ?></li>
<li><strong>Cognome:</strong> <?php echo $user->last_name; ?></li>
<li><strong>Codice fiscale:</strong> <?php echo $user->nickname; ?></li>
<li><strong>Email:</strong> <?php echo $user->user_email; ?></li>
<li><strong>Spid level:</strong> <?php echo $spidRole_value; ?></li>
</ul>
</div>
<?php endif; ?>

<?php if(!is_attachment()) italiawp2_create_breadcrumbs(); ?>
Loading