Skip to content

Instantly share code, notes, and snippets.

@DDRBoxman
Created April 29, 2016 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DDRBoxman/2dbc4d38d4ae747a7a21c12e057e3e0d to your computer and use it in GitHub Desktop.
Save DDRBoxman/2dbc4d38d4ae747a7a21c12e057e3e0d to your computer and use it in GitHub Desktop.
public class SigningClient implements Client {
final Client wrapped;
public SigningClient(Client client) {
wrapped = client;
}
@Override public Response execute(Request request) {
Request newRequest = sign(request);
return wrapped.execute(newRequest);
}
private void sign(Request request) {
//make signpost sign the request here
// aka add the oauth 2 authentication header
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment