Skip to content
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

Support ParamsDigest in QueryParam #62

Open
sutra opened this issue Jan 3, 2015 · 4 comments
Open

Support ParamsDigest in QueryParam #62

sutra opened this issue Jan 3, 2015 · 4 comments

Comments

@sutra
Copy link
Contributor

sutra commented Jan 3, 2015

@QueryParam("signature") ParamsDigest signature

@mmazi
Copy link
Owner

mmazi commented Jan 5, 2015

Sounds useful and doable.

@sutra
Copy link
Contributor Author

sutra commented Jan 5, 2015

This is my workaround in org.oxerr.peatio.rest.service.PeatioDigest.digestParams(RestInvocation) sutra/peatio-client@eba9e4d, using Java reflection to change the private field RestInvocation#invocationUrl:

// Seems rescu does not support ParamsDigest in QueryParam.
// hack to replace the signature in the invocation URL.
String invocationUrl = restInvocation.getInvocationUrl();
log.debug("old invocationUrl: {}", invocationUrl);
String newInvocationUrl = UriBuilder.fromUri(invocationUrl).replaceQueryParam("signature", signature).build().toString();
try {
    invocationUrlField.set(restInvocation, newInvocationUrl);
} catch (IllegalArgumentException | IllegalAccessException e) {
    throw new RuntimeException(e);
}
log.debug("new invocationUrl: {}", restInvocation.getInvocationUrl());

@andre77
Copy link

andre77 commented Oct 18, 2017

+1

1 similar comment
@gsiddharth
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants