Signing a request without sending
Hi, I am quite impressed with this library. For a project i need to send a signed request to another server that will use this request to execute the signed request. Is there a possibility to sign a request (new_request) only, without sending?
I saw there is a Signer, but it is not exported.
Thank you in advance
Thanks! I would like to work on this but unfortunately don't have the time right now, sorry to say, but hopefully one of the items below may help.
A couple questions:
-
Do you have an example of how to do this with another SDK, e.g. the Python AWS SDK?
-
First idea: Could you send all the arguments to the other server and then have the other server call the function, e.g. store the function arguments in
argsand then on the other server, calldo.call(my_aws_function, args)? Or does the other server not have the right credentials? -
Second idea: monkey patch
send_requestto return the signed request to you. See the example below. The internal implementation is unlikely to change any time soon so this is likely to work for the forseeable future. You'll have to monkey patch it again on the sending server to take the signed request and send it.
# Monkey patch paws to get the signed request.
# See https://dlukes.github.io/monkey-patching-in-r.html
paws.common <- getNamespace("paws.common")
unlockBinding("send_request", paws.common)
send_request <- with(paws.common, {
function(request) {
request <- sign(request)
return(request)
}
})
paws.common$send_request <- send_request
lockBinding("send_request", paws.common)
# Get the signed request.
s3 <- paws::s3()
signed_request <- s3$list_buckets()
Ok, that will do for me. Thank you very much