Navigation

s3Service.signPolicy()

Definition

s3Service.signPolicy(args)

Generates a document containing the fields policy, signature, and the credential, which you can use to issue a POST request directly to S3.

Important

To perform an S3 service action, you must have rules set up for the action.

The s3Service.signPolicy() function takes the following parameter:

Parameter Type Description
args document
{
    "bucket": <string>,
    "key": <string>,
    "contentType": <string>,
    "acl": <string>
}

The fields of args are as follows:

Argument Type Description
bucket string The S3 bucket name.
key string The unique identifier for the uploaded object.
acl string

Access control list. Valid values are:

  • private
  • public-read
  • public-read-write
  • aws-exec-read
  • authenticated-read
  • bucket-owner-read
  • bucket-owner-full-control

See Amazon’s documentation for more information.

contentType string Data format, e.g. text/plain
Returns:A promise that resolve to a document of the following form:
{
    "policy": <string>,
    "signature": <string>,
    "credential": <string>,
    "algorithm": <string>,
    "date": <date>
}