Repository navigation
Changed
-
BREAKING:
InterledgerApiClient.finalizeGrant(OutgoingPayment, String)now requires three
additional parameters:finalizeGrant(OutgoingPayment outgoingPayment, String interactRef, String hash, String clientNonce, URI grantEndpoint).
Before theinteract_refreturned from the user's wallet is used to finalize the grant, the
implementation now verifies thehashquery parameter returned alongside it on the interaction
callback, per the GNAP interaction hash check
(draft-ietf-gnap-core-protocol §4.2.3).
This prevents a forged callback from being used to hijack a payment grant.Migration: callers must now also pass the
hashquery parameter from the callback URL, the
clientNonceoriginally passed tocontinueGrant(...), and the sender'sauthServerURI
(grantEndpoint) used for the original grant request:- client.finalizeGrant(outgoingPayment, interactRef); + client.finalizeGrant(outgoingPayment, interactRef, hash, clientNonce, sender.authServer);
If the computed hash doesn't match,
finalizeGrantnow throwsInterledgerClientException
instead of proceeding with an unverifiedinteract_ref.
Added
GrantAccessRequest.verifyInteractionHash(String clientNonce, String asNonce, String interactRef, String hash, URI grantEndpoint)-
static helper implementing the GNAP interaction hash check, usable independently offinalizeGrant.
Full changelog: 1.0.3...1.1.0