The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Amazon::DynamoDB::SignatureV4

VERSION

version 0.25

SYNOPSIS

 my $req = 'GET / HTTP/1.1 ...';
 my $amz = Amazon::DynamoDB::SignatureV4->new(
  scope      => '20110909/us-east-1/host/aws4_request',
  access_key => 'AKIDEXAMPLE',
  secret_key => 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY',
  host_port  => 'dynamodb.us-west-2.amazonaws.com',
 );
 $amz->parse_request($req)
 my $signed_req = $amz->signed_request($req);

DESCRIPTION

NAME

Amazon::DynamoDB::SignatureV4 - support for v4 of the Amazon signing method

METHODS - Constructor

new

Instantiate a signing object. Expects the following named parameters:

  • scope - the scope used for requests, typically something like 20130112/us-west-2/dynamodb/aws4_request

  • secret_key - your secret key

  • access_key - your access key

  • host_port - the host and optional port info, will be something like dynamodb.us-west-2.amazonaws.com

METHODS - Accessors

algorithm

Read-only accessor for the algorithm (default is AWS4-HMAC-SHA256)

host_port

Read-only accessor for the host and optional port information, as a colon-separated string (e.g. localhost:8000).

date

Read-only accessor for the date field.

scope

Read-only accessor for scope information - typically something like 20110909/us-east-1/host/aws4_request.

access_key

Readonly accessor for the access key used when signing requests.

secret_key

Readonly accessor for the secret key used when signing requests.

signed_headers

Read-only accessor for the headers used for signing purposes (a string consisting of the lowercase headers separated by ; in lexical order)

METHODS

parse_request

Parses a given request. Takes a single parameter - the HTTP request as a string.

from_http_request

Parses information from an HTTP::Request instance.

canonical_request

Returns the string form of the canonical request, used as an intermediate point in generating the signature.

string_to_sign

Returns the \n-separated string as the last step before generating the signature itself.

calculate_signature

Calculates the signature for the current request and returns it as a string suitable for the Authorization header.

signed_request

Returns a signed version of the request.

AUTHORS

  • Rusty Conover <rusty@luckydinosaur.com>

  • Tom Molesworth <cpan@entitymodel.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Tom Molesworth, copyright (c) 2014 Lucky Dinosaur LLC. http://www.luckydinosaur.com.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.