-
Notifications
You must be signed in to change notification settings - Fork 75
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
Handle Declined proof (abandoned state callback) #406
Conversation
Signed-off-by: Lucas ONeil <[email protected]>
@@ -273,93 +289,27 @@ <h1>Scan with a Digital Wallet</h1> | |||
socket.connect(); | |||
|
|||
const toggleState = (state) => { | |||
const intro = document.querySelector(".intro"); |
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.
I refactored all this away to the setUiElements function below to generalize.
qrcode.classList.remove("pending"); | ||
setUiElements(".expired", true, false, false); | ||
break; | ||
case "abandoned": |
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.
New state
Draft ACA-Py changes can be seen at openwallet-foundation/acapy#2723 |
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.
Looks Great!
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 👍🏻
@loneil just confirming we can merge and the current code will not break - nothing will actually change until the related fix in ACA-Py is pulled in by a new image. |
@esune Yes it can go in, the only change depends on a state that won't show up yet so it won't have any affect on anything yet (I did refactor a bit on the UI page but tested out the other cases and there weren't any logic changes) |
Will try this out with the 0.12.0 RC0 acapy image soon on this PR. |
This was merged so put the 12.0 (tested and working locally) here #407 |
Sorry, I got merge happy today 🙂 |
Probably best to keep it separate since it's an RC anyways |
Sorry I got lost in messages, what is the ACA-Py version that could interoperate with this PR? I mean Once ACA-Py add the new "state", Are we be able to use an external wallet like eSatus/Lissi ? |
The new ACA-Py version is just to handle the abandoned state (i.e.: when the user declines to share their credentials). eSatus/Lissi should work regardless of what ACA-Py version is used. |
NOTE: For this to function a subsequent upcoming change to ACA-Py will need to be released. ACA-Py currently does not send a problem report for abandoned presentations on connectionless presentation requests. The change to remove this restriction will need to be accepted and released.
However, on the VCAuthn side, this is just adding a new state handler, so this could conceivably be merged in without any adverse affects, the state just won't be triggered unless the ACA-Py change is in place.
Add a state handler in the controller acapy handler for a
present_proof
topic that contains a stateabandoned
(which is triggered when the user declines a presentation request).The topic handler in the existing code already checks the incoming webhook
presentation_exchange_id
to get the appropriate auth session. So add a new check for abandoned state and emit that to the handler to display the HTML page with the new state.The state is just "abandoned", the error message says
abandoned: Declined
so possibly could parse out more if there were multipleabandoned
cases to handle... but that would be relying on a text error message display rather than state.See object contents from debug session below:
Alter the frontend page to handle this state. It looks like below and the user can hit try again or refresh to do a proof again if they accidentally decline. Can adjust wording/icon/color if needed.
Additionally refactor the JS in the HTML file to generalize the UI element setup and reduce duplication.