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

[Feat/documentation] Docs and refactoring for satosa package #205

Merged
merged 77 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
c49bdfb
Merge pull request #104 from italia/dev
Sep 9, 2023
c6a81ca
Merge pull request #134 from italia/dev
Oct 9, 2023
70f50fa
Merge branch 'main' of https://github.com/italia/eudi-wallet-it-satos…
PascalDR Oct 16, 2023
46ff77f
Merge branch 'dev' of https://github.com/italia/eudi-wallet-it-satosa…
PascalDR Nov 22, 2023
56feaa5
feat: added policy apply on metadata
PascalDR Nov 23, 2023
1ea7bac
test: added intial tests for TrustEvaluationHelper
PascalDR Nov 23, 2023
47fd884
fix: fixed validation issues
PascalDR Nov 23, 2023
bd36786
feat: implemented method add_trust_attestation_metadata
PascalDR Nov 23, 2023
aa0133f
test: added test for add_trust_attestation_metadata
PascalDR Nov 23, 2023
4e44ecf
Merge branch 'dev' of https://github.com/italia/eudi-wallet-it-satosa…
PascalDR Nov 23, 2023
f512f59
Merge branch 'dev' of https://github.com/italia/eudi-wallet-it-satosa…
PascalDR Nov 27, 2023
1d3fa1b
fix: added metadata association by metadata_type field
PascalDR Nov 27, 2023
d90974c
fix: minor fix to test for add_trust_attestation_metadata's data type
PascalDR Nov 27, 2023
850d432
chore: renamed test file
PascalDR Nov 27, 2023
c062b35
chore: Removed comment
PascalDR Nov 27, 2023
bf3843c
fix: fixed x509 verification exception handling
PascalDR Nov 27, 2023
5a74ea0
chore: fix typo
PascalDR Nov 27, 2023
daeb343
fix: merged federation and metadata policy implementation
PascalDR Nov 29, 2023
f94b063
test: adapted tests
PascalDR Nov 29, 2023
67a4d12
feat: added final_metadata property
PascalDR Nov 29, 2023
059e94b
feat: added chain discovery plus refactoring
PascalDR Nov 29, 2023
5782f15
Merge branch 'dev' of https://github.com/italia/eudi-wallet-it-satosa…
PascalDR Nov 29, 2023
b807998
docs: documented file class and functions
PascalDR Dec 4, 2023
62edae6
fix: fixed trust_anchor_entity_conf handling
PascalDR Dec 4, 2023
9243e61
docs: documented trust_chain_builder.py
PascalDR Dec 4, 2023
24a8782
fix: moved implementation of get_http_url in utils.py
PascalDR Dec 5, 2023
29a876e
fix: fixed response handling
PascalDR Dec 5, 2023
1de5916
docs: documented file class and function plus refactoring
PascalDR Dec 5, 2023
7d5a273
docs: documented file __init__.py
PascalDR Dec 6, 2023
baaede8
docs: added docs for http_client.py
PascalDR Dec 6, 2023
d5758bd
Merge branch 'dev' of https://github.com/italia/eudi-wallet-it-satosa…
PascalDR Dec 6, 2023
2d04f1c
docs: documented the content of __init__.py
PascalDR Dec 11, 2023
0f61235
docs: documented contento of __init__.py
PascalDR Dec 11, 2023
1fef461
fix: method name refactoring
PascalDR Dec 11, 2023
f3fae08
fix: added exception
PascalDR Dec 11, 2023
d9a8f3e
fix: refactored method find_jwk
PascalDR Dec 11, 2023
eb0dfda
docs: fixed documentation
PascalDR Dec 11, 2023
46ac8bb
fix: refactoring
PascalDR Dec 11, 2023
3559531
docs: documented content of utils.py
PascalDR Dec 11, 2023
f7a85cc
docs: documented __init__.py content
PascalDR Dec 11, 2023
3d40222
Merge branch 'dev' of https://github.com/italia/eudi-wallet-it-satosa…
PascalDR Dec 11, 2023
f221ac1
fix: Resolved todo (what if the credential is not a JWT?)
PascalDR Dec 13, 2023
052262a
feat: implemented is_jwe_format and is_jws_format
PascalDR Dec 13, 2023
2711ba8
test: amplied test
PascalDR Dec 13, 2023
8a99ab1
fix: refactored code
PascalDR Dec 13, 2023
9b54e93
feat: resolved todo (detect if it is encrypted otherwise)
PascalDR Dec 13, 2023
2c3dc7d
fix: code refactoring
PascalDR Dec 13, 2023
61707f1
docs: documented content of direct_post_response.py
PascalDR Dec 13, 2023
084d1f2
fix: amplied error messages
PascalDR Dec 13, 2023
2ab4002
feat: resolved todo (automatic detection of the credential)
PascalDR Dec 13, 2023
2c2c80e
docs: amplied the documentation
PascalDR Dec 13, 2023
ebbf8a4
fix: refactored code
PascalDR Dec 13, 2023
7543752
fix: added dependency
PascalDR Dec 13, 2023
b8a9b27
docs: documented content of vp_sd_jwt.py
PascalDR Dec 13, 2023
91c5952
fix: refactored code
PascalDR Dec 13, 2023
b89312a
docs: documented content of vp.py
PascalDR Dec 13, 2023
c2cced2
Merge branch 'dev' of https://github.com/italia/eudi-wallet-it-satosa…
PascalDR Dec 13, 2023
86ebd73
fix: refactoring for better redability
PascalDR Dec 14, 2023
289bb3f
fix: redability fix
PascalDR Dec 14, 2023
b5b65ef
feat: added methods for handling credential's JWKs
PascalDR Dec 14, 2023
94f28b9
fix: fixed signatures
PascalDR Dec 14, 2023
7592b97
test: fixed test
PascalDR Dec 14, 2023
2bc8494
docs: documented the content of backend.py
PascalDR Dec 15, 2023
fde3b68
docs: documented code of dpop.py
PascalDR Dec 15, 2023
0109d7d
feat: created class BaseHTTPErrorHandler
PascalDR Dec 15, 2023
edbf46d
feat: created class BaseLogger
PascalDR Dec 15, 2023
b64e3a1
chore: removed unused implementation
PascalDR Dec 15, 2023
c6e4695
fix: code refactoring
PascalDR Dec 15, 2023
a3b6bd0
docs: added doc for _serialize_error
PascalDR Dec 15, 2023
0b8a933
docs: documented HTTPError and EmptyHTTPError
PascalDR Dec 15, 2023
14487a2
docs: fixed doc
PascalDR Dec 15, 2023
d5d4a5b
docs: documented content of html_template.py
PascalDR Dec 15, 2023
5905212
docs: documented content of response.py
PascalDR Dec 15, 2023
380df4f
docs: documented content of trust.py
PascalDR Dec 15, 2023
900edc3
fix: fixed signature
PascalDR Dec 15, 2023
e34e4bd
Merge branch 'dev' of https://github.com/italia/eudi-wallet-it-satosa…
PascalDR Dec 15, 2023
b8e929a
fix: fixed message passing
PascalDR Dec 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pyeudiw/openid4vp/direct_post_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, jwt: str, jwks_by_kids: Dict[str, dict], nonce: str = ""):

self._payload: dict = {}
self._vps: list = []
self.credentials_by_issuer: dict = {}
self.credentials_by_issuer: Dict[str, list[dict]] = {}
self._claims_by_issuer: dict = {}

def _decode_payload(self) -> None:
Expand Down Expand Up @@ -109,9 +109,11 @@ def validate(self) -> bool:

return True

def get_presentation_vps(self) -> list[dict]:
def get_presentation_vps(self) -> list[Vp]:
"""
Returns the presentation's verifiable presentations
Returns the presentation's verifiable presentations.

:raises VPNotFound: if no VPs are found.

:returns: the list of vps.
:rtype: list[dict]
Expand All @@ -123,7 +125,7 @@ def get_presentation_vps(self) -> list[dict]:
vps = [_vps] if isinstance(_vps, str) else _vps

if not vps:
raise VPNotFound(f"Vps for response with nonce \"{self.nonce}\" are empty")
raise VPNotFound(f"Vps are empty for response with nonce \"{self.nonce}\"")

for vp in vps:
_vp = Vp(vp)
Expand Down
15 changes: 15 additions & 0 deletions pyeudiw/openid4vp/vp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def __init__(self, jwt: str) -> None:

self.parse_digital_credential()
self.disclosed_user_attributes: dict = {}
self._credential_jwks: list[dict] = []

def _detect_vp_type(self) -> str:
"""
Expand Down Expand Up @@ -54,6 +55,20 @@ def parse_digital_credential(self) -> None:
self.credential_headers = decode_jwt_header(self.payload['vp'])
self.credential_payload = decode_jwt_payload(self.payload['vp'])

def set_credential_jwks(self, credential_jwks: list[dict]) -> None:
"""
Set the credential JWKs for the current istance.

:param credential_jwks: a list containing the credential's JWKs.
:type credential_jwks: list[dict]
"""
self._credential_jwks = credential_jwks

@property
def credential_jwks(self) -> list[dict]:
"""Returns the credential JWKs"""
return self._credential_jwks

@property
def credential_issuer(self) -> str:
"""Returns the credential issuer"""
Expand Down
Loading
Loading