feat: [IEL-185] Fci flow with generated nonce#581
Open
Conversation
Ladirico
requested changes
Mar 17, 2026
| if (nonceValidationResult === "valid") { | ||
| return res.status(200).json(mockSignatureDetailView); | ||
| } | ||
| return res.sendStatus(500); |
Contributor
There was a problem hiding this comment.
In addition to the error code, it would be helpful to have the error message. What do you think about using the error that also occurs in the app?
| response: { | ||
| getFciResponseCode: 200 | ||
| getFciResponseCode: 200, | ||
| nonceDuration: 300 // 5 minutes as production environment |
Contributor
There was a problem hiding this comment.
In my opinion, it's a bit complicated to calculate the duration using this method (even though there's a comment). Why didn't you just set the duration in seconds?
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
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.
Short description
This PR introduces nonce lifecycle handling for the FCI sign flow, allowing to test the IO app behaviour with expired nonce running it with local configuration.
List of changes proposed in this pull request
/api/v1/sign/qtsp/clausesto generate and return a fresh nonce, storing its expiration./api/v1/sign/signaturesto validateqtsp_clauses.nonceand return an error (500) when nonce is not valid.How to test
Run the IO app with .env.local, then start the FCI signing flow (the dev-server config must include at least one fci.waitForSignatureCount). Stop at any step before final signing. After the nonce validity window (fci.response.nonceDuration) has expired, try to complete the signature: POST /api/v1/sign/signatures should return 500, and the app should show an error message with a button to restart the signing flow.