Repository navigation
Conversation
…nd book what they authorise A minimal signing basket for the mapped connector. Responses and validation: transactionStatus is upper case, _links.scaStatus is a href object, the PUT answer links to the basket's authorisation, an empty or duplicated id list is a format error, and authorisation bodies the server does not implement are refused by name instead of discarded. Codes outside the standard's list (wrong OTP, unknown basket or authorisation, status conflicts) are mapped to ones inside it. Ownership: a basket records the consumer that created it and every operation is limited to that consumer; an unknown basket, another TPP's basket and a basket created before ownership was recorded answer 403 RESOURCE_UNKNOWN. State: delete and the move to AUTHORISING are conditional updates, so an answer and a delete racing each other have one winner. Answering the authorisation checks everything first (instance setting, ownership, basket and challenge state, every payment still waiting for SCA), then the answer, and only a challenge recorded as finalised authorises anything. The payments are then booked one after another, each awaited, and the basket is ACTC only if every one was. Authorisation is off by default (signing_basket_authorisation_enabled). Payments are admitted only if the caller lodged them and they await SCA. Consents in a basket are refused until their authorisation exists.
|
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.



fix: signing baskets follow NextGenPSD2 1.3.16, belong to their TPP and book what they authorise (minimal)
Base:
origin/develop(78406d7f7). 1 commit, about 400 changed lines of main code.A deliberately small version of the Berlin Group signing basket for the mapped connector, enough to run the main flow (create a basket, start its authorisation, answer with the OTP, book the payments one by one, ACTC) without the defects found in the current implementation. A fuller version (execution ledger, resumption scheduler, consents, PSU binding, results endpoint) is in #2934; this PR is the subset worth reviewing first.
What changes
Response shape and validation
transactionStatusis upper case (RCVD, notrcvd)._links.scaStatusis a{ "href": ... }object, and the PUT answer links to/signing-baskets/{basketId}/authorisations/{id}instead of a payment URL.FORMAT_ERROR.updatePsuAuthentication,selectPsuAuthenticationMethod,authorisationConfirmation) are refused with 400SERVICE_INVALIDinstead of being discarded.PSU_CREDENTIALS_INVALID; an authorisation id the basket does not have is 404; unknown basket or one the caller may not address is 403RESOURCE_UNKNOWN; status conflicts are 409STATUS_INVALID.Ownership. A basket records the consumer that created it (nullable
consumeridcolumn onsigningbasket, added by Schemifier). Every operation is limited to that consumer. An unknown basket, another TPP's basket and a basket created before ownership was recorded all answer the same way. A payment may only be put in a basket by the TPP that lodged it, and only while it awaits SCA.State. Delete (
RCVD -> CANC) and the claim of an answered authorisation (RCVD -> AUTHORISING) are conditional updates, so an answer and a delete racing each other have one winner. A basket that is no longerRCVDcannot be deleted or given a new authorisation.Answering the authorisation (
PUT .../authorisations/{id}), in this order: instance setting, ownership, the authorisation belongs to the basket, body variant, basket and challenge state, every payment still waiting for SCA; then the answer; then the claim; then the payments are booked one after another, each awaited, so the money has moved when the response is sent. Only a challenge the connector records asfinalisedauthorises anything. The basket becomesACTConly if every payment was booked. Before this change a successful PUT stored the payments asCOMPLETEDand the basket asACTCwhile no account moved.Switched off by default.
signing_basket_authorisation_enabled(defaultfalse): the PUT answers 403SERVICE_BLOCKEDuntil it is set. Creating, reading, starting an authorisation on and deleting baskets are not affected.Consents are refused (400
SERVICE_INVALID) until their authorisation exists. Before this change a consent named in a basket was recorded and never authorised.Behaviour changes visible to TPPs
transactionStatus: "rcvd""RCVD"OBP-50200, or success for any holder of the idRESOURCE_UNKNOWNCANCSTATUS_INVALIDSTATUS_INVALID[], duplicates, invented or already booked idsSERVICE_INVALIDSERVICE_INVALIDtrue; then books the payments before answeringKnown limits (it is a proof of concept)
AUTHORISING(reportedRCVD) and the response says not every payment was booked; each payment's own status shows which. Nothing resumes it.LocationandASPSP-SCA-Approachheaders, per-member results, consents, PSU binding.Verification
SigningBasketServiceSBSApiTest(45 scenarios, including payments booked and balances moved, ownership across two TPPs and a legacy basket, answer replay against another basket, a wrong answer, the instance setting, PUT racing DELETE, and a stand-in connector that returns a failed or unfinished challenge) andMappedSigningBasketProviderTest(4) pass.scripts/check_lift_http4s_resource_doc_parity.pyand the test-isolation lint are clean; no ResourceDoc was changed.