Generates AWS Signature Version 2

signature_v2_auth(
  datetime = format(Sys.time(), "%Y-%m-%dT%H:%M:%S", tz = "UTC"),
  verb,
  service,
  path,
  query_args = list(),
  key = NULL,
  secret = NULL,
  region = NULL,
  force_credentials = FALSE,
  verbose = getOption("verbose", FALSE)
)

Arguments

datetime

A character string containing a date in the form of “YYYY-MM-DDTH:M:S”. If missing, it is generated automatically using Sys.time.

verb

A character string specify an HTTP verb/method (e.g., “GET”).

service

A character string containing the full hostname of an AWS service (e.g., “iam.amazonaws.com”, etc.)

path

A character string specify the path to the API endpoint.

query_args

A list containing named query arguments.

key

An AWS Access Key ID. If NULL, it is retrieved using locate_credentials.

secret

An AWS Secret Access Key. If NULL, it is retrieved using locate_credentials.

region

A character string containing the AWS region for the request. If missing, “us-east-1” is assumed.

force_credentials

A logical indicating whether to force use of user-supplied credentials. If FALSE (the default), locate_credentials is used to find credentials. If TRUE, user-supplied values are used regardless of their validity.

verbose

A logical indicating whether to be verbose.

Value

A list.

Details

This function generates an AWS Signature Version 2 for authorizing API requests. The function returns both an updated set of query string parameters, containing the required signature-related entries, as well as a Signature field containing the Signature string itself. Version 2 is mostly deprecated and in most cases users should rely on signature_v4_auth for Version 4 signatures instead.

Author

Thomas J. Leeper <thosjleeper@gmail.com>

Examples