pyeudiw.satosa.backends.openid4vp package
Subpackages
- pyeudiw.satosa.backends.openid4vp.endpoints package
- Submodules
- pyeudiw.satosa.backends.openid4vp.endpoints.get_response_endpoint module
- pyeudiw.satosa.backends.openid4vp.endpoints.pre_request_endpoint module
- pyeudiw.satosa.backends.openid4vp.endpoints.request_endpoint module
- pyeudiw.satosa.backends.openid4vp.endpoints.response_endpoint module
- pyeudiw.satosa.backends.openid4vp.endpoints.status_endpoint module
- pyeudiw.satosa.backends.openid4vp.endpoints.vp_base_endpoint module
- Module contents
- pyeudiw.satosa.backends.openid4vp.presentation_submission package
- Submodules
- pyeudiw.satosa.backends.openid4vp.presentation_submission.base_vp_parser module
- pyeudiw.satosa.backends.openid4vp.presentation_submission.exceptions module
- pyeudiw.satosa.backends.openid4vp.presentation_submission.schemas module
- Module contents
- pyeudiw.satosa.backends.openid4vp.schemas package
- Submodules
- pyeudiw.satosa.backends.openid4vp.schemas.cnf_schema module
- pyeudiw.satosa.backends.openid4vp.schemas.flow module
- pyeudiw.satosa.backends.openid4vp.schemas.response module
- pyeudiw.satosa.backends.openid4vp.schemas.vp_formats module
- pyeudiw.satosa.backends.openid4vp.schemas.vp_token module
- pyeudiw.satosa.backends.openid4vp.schemas.wallet_instance_attestation module
VPFormatSchemaWalletInstanceAttestationHeaderWalletInstanceAttestationPayloadWalletInstanceAttestationPayload.aalWalletInstanceAttestationPayload.authorization_endpointWalletInstanceAttestationPayload.cnfWalletInstanceAttestationPayload.expWalletInstanceAttestationPayload.iatWalletInstanceAttestationPayload.issWalletInstanceAttestationPayload.logo_uriWalletInstanceAttestationPayload.model_configWalletInstanceAttestationPayload.policy_uriWalletInstanceAttestationPayload.presentation_definition_uri_supportedWalletInstanceAttestationPayload.request_object_signing_alg_values_supportedWalletInstanceAttestationPayload.response_types_supportedWalletInstanceAttestationPayload.subWalletInstanceAttestationPayload.tos_uriWalletInstanceAttestationPayload.typeWalletInstanceAttestationPayload.vp_formats_supported
- pyeudiw.satosa.backends.openid4vp.schemas.wallet_instance_attestation_request module
WalletInstanceAttestationRequestHeaderWalletInstanceAttestationRequestPayloadWalletInstanceAttestationRequestPayload.audWalletInstanceAttestationRequestPayload.cnfWalletInstanceAttestationRequestPayload.expWalletInstanceAttestationRequestPayload.iatWalletInstanceAttestationRequestPayload.issWalletInstanceAttestationRequestPayload.jtiWalletInstanceAttestationRequestPayload.model_configWalletInstanceAttestationRequestPayload.nonceWalletInstanceAttestationRequestPayload.type
- pyeudiw.satosa.backends.openid4vp.schemas.wallet_metadata module
WalletMetadataWalletMetadata.alg_values_supportedWalletMetadata.authorization_endpointWalletMetadata.client_id_schemes_supportedWalletMetadata.model_configWalletMetadata.request_object_signing_alg_values_supportedWalletMetadata.response_modes_supportedWalletMetadata.response_types_supportedWalletMetadata.validate_alg_values_supported()WalletMetadata.validate_authorization_endpoint()WalletMetadata.validate_client_id_schemes_supported()WalletMetadata.validate_request_object_signing_alg_values_supported_supported()WalletMetadata.validate_response_modes_supported()WalletMetadata.validate_response_types_supported()WalletMetadata.validate_vp_formats_supported()WalletMetadata.vp_formats_supported
WalletPostRequest
- Module contents
Submodules
pyeudiw.satosa.backends.openid4vp.exceptions module
- exception pyeudiw.satosa.backends.openid4vp.exceptions.AuthRespParsingException[source]
Bases:
ExceptionRaised when the http request corresponding to an authorization response is malformed.
- exception pyeudiw.satosa.backends.openid4vp.exceptions.AuthRespValidationException[source]
Bases:
ExceptionRaised when the http request corresponding to an authorization response is well formed, but not valid (for example, it might be wrapped in an expired token).
- exception pyeudiw.satosa.backends.openid4vp.exceptions.InvalidVPToken[source]
Bases:
ExceptionRaised when a given VP is invalid
- exception pyeudiw.satosa.backends.openid4vp.exceptions.MdocCborValidationError[source]
Bases:
ExceptionRaised when a given VP not contain the issuer
- exception pyeudiw.satosa.backends.openid4vp.exceptions.MissingIssuer[source]
Bases:
ExceptionRaised when a given VP not contain the issuer
- exception pyeudiw.satosa.backends.openid4vp.exceptions.NotKBJWT[source]
Bases:
ExceptionRaised when a given VP format is not Key Binding JWT format
- exception pyeudiw.satosa.backends.openid4vp.exceptions.VPExpired[source]
Bases:
ExceptionRaised when a given VP is expired
pyeudiw.satosa.backends.openid4vp.interface module
- class pyeudiw.satosa.backends.openid4vp.interface.AuthorizationResponseParser[source]
Bases:
objectAuthorizationResponseParser is an interface intended to parse direct POST http responses.
An authorization parser is meant to just parse and eventually validate the “lower” applicaiton layer of the transmission, that is, it is used to extract an authorization response from the HTTP layer. It SHOULD NOT be used to validate the actual content of the response, that is, it SHOULD NOT try to validate vp_tokens, presentation_submissions, etc. This is a delicate task that that is best suited for a different, dedicated object, method or interface.
- parse_and_validate(context: Context) AuthorizeResponsePayload[source]
Parse (and optionally validate) a satosa http request, wrapped in its own context, in order to extract an auhtorization response. The validation step might include verification tasks; for example if the data is reepresented as a jwt, the validation should perform a check on the jwt validity.
The concrete implementation SHOULD NOT be used to validate the actual content of the response, that is, it SHOULD NOT try to validate vp_tokens, presentation_submissions, etc. This is a delicate task that that is best suited for a different, dedicated object, method or interface.
- Parameters:
context (satosa.context.Context) – an http request wrapped in its own satosa context
- Raises:
pyeudiw.satosa.backends.openid4vp.exceptions.AuthRespParsingException – raised when the http response is malformed.
pyeudiw.satosa.backends.openid4vp.exceptions.AuthRespValidationException – raised when the http response is syntactically correct, but not valid (for example, it might be an expired token).
- Returns:
the plain openid4vp authorization response; DCQL is not supported yet
- Return type:
- class pyeudiw.satosa.backends.openid4vp.interface.VpTokenParser[source]
Bases:
objectVpTokenParser is an interface that specify that an object is able to extract verifiable credentials from a VP token.
- get_issuer_name() str[source]
Get the issuer name from the token payload.
- Raises:
MissingIssuer – if the issuer name is missing in the token payload
- Returns:
the issuer name
- Return type:
str
- class pyeudiw.satosa.backends.openid4vp.interface.VpTokenVerifier[source]
Bases:
objectVpTokenVerifier is an interface that specify that an object is able to verify a vp token. The interface supposes that the verification process requires a public key (os the token issuer)
- verify_challenge() None[source]
Verifies the challenge of the jwt.
- Raises:
UnsupportedSdAlg – if verification fails due to an unkown _sd_alg
InvalidKeyBinding – if the verification fails for a known reason
ValueError – if the iat claim is missing or invalid
JWSVerificationError – if the verification of a JWS fails
- verify_signature(public_key: ECKey | RSAKey | dict) None[source]
Verifies the signature of the jwt.
- Parameters:
public_key (ECKey | RSAKey | dict) – the public key to verify the signature
- Raises:
JWSVerificationError – if the signature is invalid
pyeudiw.satosa.backends.openid4vp.openid4vp module
- class pyeudiw.satosa.backends.openid4vp.openid4vp.OpenID4VPBackend(auth_req_callback_func: Callable[[Context, InternalData], Response], internal_attributes: dict[str, dict[str, str | list[str]]], config: dict[str, Any], base_url: str, name: str)[source]
Bases:
BackendModule- get_trust_backend_by_class_name(class_name: str) TrustHandlerInterface | None[source]
- register_endpoints(**kwargs)[source]
See super class satosa.backends.base.BackendModule
- Return type:
list[(str, ((satosa.context.Context, Any) -> satosa.response.Response, Any))]
- Raises:
ValueError – if more than one backend is configured
- start_auth(context: Context, internal_request) Response[source]
This is the start up function of the backend authorization.
- Parameters:
context (satosa.context.Context) – the request context
internal_request (satosa.internal.InternalData) – Information about the authorization request
- Return type:
satosa.response.Response
- Returns:
response
pyeudiw.satosa.backends.openid4vp.utils module
- pyeudiw.satosa.backends.openid4vp.utils.detect_flow_typ(context: Context, force_same_device_flow_referer_criteria: List[str] | None = None) RemoteFlowType[source]
Identify or guess the remote flow type based on the authentication context. The logic is as follows: If the User-Agent clearly indicates a smartphone -> SAME_DEVICE If the request has sec-fetch-site == “cross-site” AND the Referer matches at least one of the regex patterns in referer_criteria -> SAME_DEVICE Otherwise -> CROSS_DEVICE
Parameters context: the context of the user authentication force_same_device_flow_referer_criteria: optional list of regex patterns (as strings) that, if matched against the HTTP_REFERER header, indicate a wallet-originated request.
Returns the detected remote flow type (RemoteFlowType).