What is signerUrl Evaporate AWS S3

Evaporate is a javascript library for uploading files from a browser to AWS S3, using parallel S3’s multipart uploads with MD5 checksum support and control over pausing / resuming the upload.
config minimally consists of bucket and aws_key and one of the following combinations of signing options:
{Read:- 5 Ways to Improve SEO on Your WordPress Site }
- A custom signerUrl that returns the signature or signing response required for the specified awsSignatureVersion.
- A custom authorization method defined with customAuthMethod
signerUrl
is not invoked if using a customAuthMethod
. signResponseHandler
can also be provided for additional processing of responses from signerUrl
. If the request to signerUrl responds with 401 Unauthorized or 403 Permission Denied, then the upload will stop. Any other status will attempt to retry the request.
signerUrl is a url on your application server which will sign the request according to your chosen AWS signature method (Version 2 or 4). When using AWS Signature Version 4, this URL must respond with the V4 signing key. If you don’t want to use a signerURL and want to sign the request yourself, then you sign the request using signResponseHandler.
Signed URLs provide secure a way to distribute private content without streaming them through the backend. You sign the access URL on your backend, and distribute that only to the subscribed users. By making the signature valid for only a short period of time, you can also prevent reusing the same URL.
{Read:- How to Build a WordPress Site in 1 Day }
Config Setting :
1 2 3 4 5 6 7 8 |
var config = { <strong>signerUrl: <SIGNER_URL>,</strong> aws_key: <AWS_KEY>, bucket: <AWS_BUCKET>, cloudfront: true, computeContentMd5: true, cryptoMd5Method: function (data) { return crypto.createHash('md5').update(data).digest('base64'); } }; |
Here is the way to crete signerUrl :
1 2 3 4 5 6 7 8 9 10 11 12 13 |
public function signatureUrlAwsAction() { $to_sign = $_REQUEST['to_sign']; $kSecret = "AWS4" . S3_SECRET_KEY; $kDate = hash_hmac("sha256", gmdate('Ymd'), $kSecret, true); $kRegion = hash_hmac("sha256", 'us-east-1', $kDate, true); $kService = hash_hmac("sha256", 's3', $kRegion, true); $kSigning = hash_hmac("sha256", "aws4_request", $kService, true); $signature = hash_hmac("sha256", $to_sign, $kSigning); header("HTTP/1.1 200 OK"); header('Content-Type', 'text/html'); echo $signature; die; } |