lib/services/s3.js
function getSignedUrl(operation, params, callback) {
    params = AWS.util.copy(params || {});
    var expires = params.Expires || 900;
    delete params.Expires; // we can't validate this
    var request = this.makeRequest(operation, params);

    if (callback) {
      AWS.util.defer(function() {
        request.presign(expires, callback);
      });
    } else {
      return request.presign(expires, callback);
    }
  }
function getSignedUrl(operation, params, callback) {
    params = AWS.util.copy(params || {});
    var expires = params.Expires || 900;
    delete params.Expires; // we can't validate this
    var request = this.makeRequest(operation, params);

    if (callback) {
      AWS.util.defer(function() {
        request.presign(expires, callback);
      });
    } else {
      return request.presign(expires, callback);
    }
  }
function getSignedUrl ( operation , params , callback ) { params = AWS . util . copy ( params || { } ) ; var expires = params . Expires || 900 ; delete params . Expires ; // we can't validate this var request = this . makeRequest ( operation , params ) ; if ( callback ) { AWS . util . defer ( function ( ) { request . presign ( expires , callback ) ; } ) ; } else { return request . presign ( expires , callback ) ; } }
Get a pre-signed URL for a given operation name.

@note You must ensure that you have static or previously resolved
credentials if you call this method synchronously (with no callback),
otherwise it may not properly sign the request. If you cannot guarantee
this (you are using an asynchronous credential provider, i.e., EC2
IAM roles), you should always call this method with an asynchronous
callback.
@note Not all operation parameters are supported when using pre-signed
URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`,
`ContentLength`, or `Tagging` must be provided as headers when sending a
request. If you are using pre-signed URLs to upload from a browser and
need to use these fields, see {createPresignedPost}.
@note The default signer allows altering the request by adding corresponding
headers to set some parameters (e.g. Range) and these added parameters
won't be signed. You must use signatureVersion v4 to to include these
parameters in the signed portion of the URL and enforce exact matching
between headers and signed params in the URL.
@note This operation cannot be used with a promise. See note above regarding
asynchronous credentials and use with a callback.
@param operation [String] the name of the operation to call
@param params [map] parameters to pass to the operation. See the given
operation for the expected operation parameters. In addition, you can
also pass the "Expires" parameter to inform S3 how long the URL should
work for.
@option params Expires [Integer] (900) the number of seconds to expire
the pre-signed URL operation in. Defaults to 15 minutes.
@param callback [Function] if a callback is provided, this function will
pass the URL as the second parameter (after the error parameter) to
the callback function.
@return [String] if called synchronously (with no callback), returns the
signed URL.
@return [null] nothing is returned if a callback is provided.
@example Pre-signing a getObject operation (synchronously)
var params = {Bucket: 'bucket', Key: 'key'};
var url = s3.getSignedUrl('getObject', params);
console.log('The URL is', url);
@example Pre-signing a putObject (asynchronously)
var params = {Bucket: 'bucket', Key: 'key'};
s3.getSignedUrl('putObject', params, function (err, url) {
console.log('The URL is', url);
});
@example Pre-signing a putObject operation with a specific payload
var params = {Bucket: 'bucket', Key: 'key', Body: 'body'};
var url = s3.getSignedUrl('putObject', params);
console.log('The URL is', url);
@example Passing in a 1-minute expiry time for a pre-signed URL
var params = {Bucket: 'bucket', Key: 'key', Expires: 60};
var url = s3.getSignedUrl('getObject', params);
console.log('The URL is', url); // expires in 60 seconds
Get a pre - signed URL for a given operation name .