You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears as though only PendingRequest is available to the Authenticator interface.
Unfortunately, the AWS sdk requires the psr http-message RequestInterface to sign a request. As such it seems that the best (and perhaps only) method available to do sign requests for aws is to add the handlePsrRequest method to the connector or request class.
I'm just wondering if there's a cleaner way to do this with the authenticator interface, which seems like it'd be the better place to add the signatures, though it's not clear how I'd accomplish it.
Within the handlePsrRequest method though, it looks like I can simply do this:
use Aws\Credentials\Credentials;
use Aws\Signature\SignatureV4;
public function handlePsrRequest(RequestInterface $request, PendingRequest $pendingRequest): RequestInterface
{
$signature = new SignatureV4('execute-api', 'us-east-1');
$credentials = new Credentials('MY_IAM', 'MY_SECRET_KEY');
return $signature->signRequest($request, $credentials);
}
If this can be handled through an authenticator that'd be ideal, but either way - it'd be good to get some documentation in place, I can't imagine I'm the only person to want to use Saloon with an AWS ApiGateway api.
The text was updated successfully, but these errors were encountered:
It appears as though only
PendingRequest
is available to theAuthenticator
interface.Unfortunately, the AWS sdk requires the psr http-message
RequestInterface
to sign a request. As such it seems that the best (and perhaps only) method available to do sign requests for aws is to add thehandlePsrRequest
method to the connector or request class.I'm just wondering if there's a cleaner way to do this with the authenticator interface, which seems like it'd be the better place to add the signatures, though it's not clear how I'd accomplish it.
Within the
handlePsrRequest
method though, it looks like I can simply do this:If this can be handled through an authenticator that'd be ideal, but either way - it'd be good to get some documentation in place, I can't imagine I'm the only person to want to use Saloon with an AWS ApiGateway api.
The text was updated successfully, but these errors were encountered: