-
Notifications
You must be signed in to change notification settings - Fork 0
feat: [SIW-2159] Handle presentation errors #223
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ChrisMattew
approved these changes
May 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
mastro993
approved these changes
May 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
github-merge-queue bot
pushed a commit
to pagopa/io-app
that referenced
this pull request
May 15, 2025
…#6917) > [!WARNING] > Depends on [this PR](pagopa/io-react-native-wallet#223) ## Short description This PR adds handling for certain potential errors in the remote presentation flow. ## List of changes proposed in this pull request - Implemented an error screen that allows users to retry the remote presentation if a communication error occurs during the auth/response step. - Implemented an error screen to inform the user when the RP fails to verify the Authorization Response. This screen will provide some useful details about the encountered error. - Implemented an error screen shown when the RP returns a non-compliant Request Object. ## Demo <details><summary>Auth Response Errors</summary> <p> | Communication Error | Verification Error| |--------|--------| |<video src="https://github.com/user-attachments/assets/ad045d7c-3cde-47ac-9654-1497ce21aded"></video>| <video src="https://github.com/user-attachments/assets/c6fa7a53-da0a-446b-830b-9b305888eb47"></video>| </p> </details> <details><summary>Non-Compliant Request Object</summary> <p> | Invalid Req Obj | Invalid Dcql Query | |--------|--------| |<video src="https://github.com/user-attachments/assets/d33fffb4-438d-4c2f-95ef-8163c1d5b7b9"></video>| <video src="https://github.com/user-attachments/assets/c6295b97-2af8-49c5-afb1-124b75e7ff1f"></video>| </p> </details> ## How to test ### Auth Response Error Using a proxy tool (I used Proxyman), intercept the POST request to `auth/response` to simulate a communication error (such as a 500 status code) or a validation error returned by the RP (status code 400 or 403), in order to display the two error screens shown in the demo. ### Non-Compliant Request Object - **Invalid Request Object:** - From the `node_modules/@pagopa/io-react-native-wallet/src/credential/presentation/05-verify-request-object.ts` file, make the `verifyRequestObject` function throw an `InvalidRequestObjectError`. - **Invalid Dcql Query:** - In the `ts/features/itwallet/presentation/remote/machine/actors.ts` file, modify the `requestObject.dcql_query` value before calling `evaluateDcqlQuery`. > [!NOTE] > The tests shown in the demo were performed using the test RP --------- Co-authored-by: Gianluca Spada <[email protected]> Co-authored-by: RiccardoMolinari95 <[email protected]>
github-merge-queue bot
pushed a commit
to pagopa/io-app
that referenced
this pull request
May 15, 2025
…#6917) > [!WARNING] > Depends on [this PR](pagopa/io-react-native-wallet#223) ## Short description This PR adds handling for certain potential errors in the remote presentation flow. ## List of changes proposed in this pull request - Implemented an error screen that allows users to retry the remote presentation if a communication error occurs during the auth/response step. - Implemented an error screen to inform the user when the RP fails to verify the Authorization Response. This screen will provide some useful details about the encountered error. - Implemented an error screen shown when the RP returns a non-compliant Request Object. ## Demo <details><summary>Auth Response Errors</summary> <p> | Communication Error | Verification Error| |--------|--------| |<video src="https://github.com/user-attachments/assets/ad045d7c-3cde-47ac-9654-1497ce21aded"></video>| <video src="https://github.com/user-attachments/assets/c6fa7a53-da0a-446b-830b-9b305888eb47"></video>| </p> </details> <details><summary>Non-Compliant Request Object</summary> <p> | Invalid Req Obj | Invalid Dcql Query | |--------|--------| |<video src="https://github.com/user-attachments/assets/d33fffb4-438d-4c2f-95ef-8163c1d5b7b9"></video>| <video src="https://github.com/user-attachments/assets/c6295b97-2af8-49c5-afb1-124b75e7ff1f"></video>| </p> </details> ## How to test ### Auth Response Error Using a proxy tool (I used Proxyman), intercept the POST request to `auth/response` to simulate a communication error (such as a 500 status code) or a validation error returned by the RP (status code 400 or 403), in order to display the two error screens shown in the demo. ### Non-Compliant Request Object - **Invalid Request Object:** - From the `node_modules/@pagopa/io-react-native-wallet/src/credential/presentation/05-verify-request-object.ts` file, make the `verifyRequestObject` function throw an `InvalidRequestObjectError`. - **Invalid Dcql Query:** - In the `ts/features/itwallet/presentation/remote/machine/actors.ts` file, modify the `requestObject.dcql_query` value before calling `evaluateDcqlQuery`. > [!NOTE] > The tests shown in the demo were performed using the test RP --------- Co-authored-by: Gianluca Spada <[email protected]> Co-authored-by: RiccardoMolinari95 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
List of Changes
sendAuthorizationErrorResponse
function to notify the RPRelyingPartyResponseError
class with RP-specific error codesInvalidRequestObjectError
inverifyRequestObject
for validation-related errorsDcqlError
inevaluateDcqlQuery
to unify DCQL-related errorsMotivation and Context
This PR improves the error handling in the presentation flow, by providing a specific
RelyingPartyResponseError
and a function to notify the Relying Party of any errors occurred when processing the Authorization Request.How Has This Been Tested?
Tested against the test Relying Party instance, using the example app and a proxy to simulate 400, 403 and 500 HTTP status codes, with the following body:
Screenshots (if appropriate):
Checklist: