-
Notifications
You must be signed in to change notification settings - Fork 60
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
Requests that require the invocationUrl to sign the request no longer work #136
Comments
Could you provide a stack trace? A test that demonstrates this would be even better. If you can't provide one, I'll try to produce one myself. |
The problem seems to be that there are two real-life situations that are somewhat in conflict:
The conflict is in the order in which parts of the request are constructed: 1. implies the URL must be constructed before headers or body, whereas 2. implies headers and body must be constructed before the URL. I think the correct order may be determined in rescu (depending on where |
I wrote tests that demonstrate the above: Now for the fix.. |
Actually, the "conflict" from above is nonexistent: query params can always be digested first, then URL constructed, then other params digested. Will push a fix shortly. |
@supex0fan can you confirm that the issue is fixed? I'll release rescu 2.1.0 when this is confirmed. |
I just checked and it is working. Thanks for fixing this so quickly. |
I believe this is related to the recent QueryParam digest changes.
Here is an example from the XChange library.
From: https://docs.pro.coinbase.com/#signing-a-message
From the XChange library (just using this method as an example, the error occurs on all methods that need to be signed)
https://github.com/knowm/XChange/blob/b8dd1a650191e3bfb706c9799864b423a57f573a/xchange-coinbasepro/src/main/java/org/knowm/xchange/coinbasepro/CoinbasePro.java#L102-L110
https://github.com/knowm/XChange/blob/b8dd1a650191e3bfb706c9799864b423a57f573a/xchange-coinbasepro/src/main/java/org/knowm/xchange/coinbasepro/service/CoinbaseProDigest.java#L25-L46
When
digestParams()
is called it throws aNullPointerException
on line 28/29 as it can't callreplace()
on a null pointer. From my brief look, it looks like thedigestAll()
method is now called in theRestInvocation
constructor beforeinvocationUrl
and queryString are set.rescu/src/main/java/si/mazi/rescu/RestInvocation.java
Lines 65 to 82 in 674810b
The text was updated successfully, but these errors were encountered: