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: [SIW-1591] Add 409 handling with custom exception for wallet provider #147

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

LazyAfternoons
Copy link
Contributor

@LazyAfternoons LazyAfternoons commented Oct 3, 2024

List of Changes

  • Update the wallet-provider.yaml specs due to changes in how the errors are mapped for certain endpoints like /token and /wallet-instance;
  • Create custom exceptions which are thrown when an error related to the integrity checks for /token and /wallet-instances fails, returning a 409 HTTP code;
  • Map these errors in their relative flows step for registering a wallet instance and obtaining an attestation.

Motivation and Context

This changes allows the consumer app to receive a custom error when an integrity check fails, thus allowing a specific text copy to be shown to the user.

How Has This Been Tested?

  • Open the example app and login;
  • Start a proxy like Proxyman;
  • Try to register a wallet instance and obtain an attestation, everything should work just as before;
  • Manually map the result of /token and /wallet-instances to 409 Conflict;
  • Try again to register a wallet instance and obtain an attestation. An error should occur. Check in the debug menu that the error is the one supposed to be thrown in this specific case.

Screenshots (if appropriate):

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@github-actions github-actions bot added the feat label Oct 3, 2024
@LazyAfternoons LazyAfternoons marked this pull request as ready for review October 3, 2024 15:18
@LazyAfternoons LazyAfternoons requested a review from a team as a code owner October 3, 2024 15:18
Copy link
Contributor

@grausof grausof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect

@grausof
Copy link
Contributor

grausof commented Oct 3, 2024

Remember to increase the package version.

@LazyAfternoons
Copy link
Contributor Author

Remember to increase the package version.

Usually I bump the versioni in a different commit, I prefer to do so

@LazyAfternoons LazyAfternoons added this pull request to the merge queue Oct 3, 2024
Merged via the queue into master with commit 5af1f23 Oct 3, 2024
7 checks passed
@LazyAfternoons LazyAfternoons deleted the SIW-1591-expose-integrity-error branch October 3, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants