Incorrect search filter: invalid characters - *.p[ml]
AWS-S3

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


Changelog for perl module AWS::S3

1.00 2025-02-11
  - Start using v4 signatures (resolves GH #18, GH #17, GH #16, GH #14, GH #13, GH #7)
  - Adds new session_token and region attributes to the constructor (see perldoc)

0.19 2024-01-08
  - Fix "bad hostname" test may fail in presence of wildcard DNS records (GH #19)

0.18 2019-03-01
  - Fix leading slashes defaults to off, see honor_leading_slashes arg

0.17 2019-03-01
  - Fix leading slashes in key names (GH #12)
  - Fix lack of location shouldn't set it to undef (GH #11)

0.16 2019-01-03
  - Remove dependency on Iterator::Paged

0.15 2018-04-20
  - More fixes for ->add_bucket. Fix an error when no location is provided or
    us-east-1 is explicitly asked for. Patch by Dave Rolsky. (GH #9)

0.14 2018-04-13
  - Fix sending of undefined location param in ->add_bucket (GH #9)

0.13 2017-02-06
  - Add documentation for parameter 'prefix' for AWS::S3::FileIterator
  - Add test coverage (GH #8, thanks to simbabque for these changes)
  - Fix over encoding of characters in path (GH #6)

0.12 2016-03-07
  - Fix DNS bucket name checking for non-valid DNS bucket nams (GH #4)
  - Fix URI escaping for filenames to avoid infinite loop on spaces (GH #5)

0.11 2015-08-31
  - Fix signed_url to URI escape the Signature param value (GH #3)

0.10 2015-06-23
  - dist changes related to kwalitee (no functional changes)

0.051 2015-05-23
  - default size to 0 when not set in content-length (GH #1)

0.050 2014-10-23
  New maintainer leejo
  - Add lib/AWS/S3/Request/GetPreSignedUrl.pm to MANIFEST
  - Various changes in dist related to issue tracking, testing, etc

0.040 2014-10-23
  Work done by leejo
  - Add signed_url method to AWS::S3::File and tests
  - Fix load / hash order bugs in AWS::S3::Signer
  - Resolve https://rt.cpan.org/Ticket/Display.html?id=92423

0.03_01 2012-06-14
  Work done by Evan Carroll (http://www.evancarroll.com)
  - Migrated to Moose & removed dependencies on VSO
  - Fixed bug introduced by previous commit, reverted to contenttype & all tests pass

0.028 2012-03-01
  - Fixed: AWS/S3.pm required a higher version of VSO than the Makefile.PL and META.yml.
  - Strange: Local testing shows $bucket->delete_multi works, but it gives me
    some problems in production.

0.027 2012-02-24
  - Fixed sporadic error:
    "Invalid value for AWS::S3::File.size: isn't a Int: [Str] 'contenttype': Must contain only numbers 0-9"

0.026 2012-01-30
  - $bucket->file( $missing_file ) was failing silently, causing strange behavior
    further upstream.  Now it will confess with the http response from S3.

Changes  view on Meta::CPAN

0.009 2011-11-23
  - Added missing prereq Iterator::Paged

0.008 2011-11-23
  - Fixed some POD to clearly show that a scalar reference is always needed
    to set the contents of a file.
  - Removed bad reference to a *::Lite module that doesn't exist on CPAN.

0.007 2011-11-22
  - Fixed AWS::S3::FileIterator to work properly.
  - New tests confirm it.
  - Now require LWP::UserAgent::Determined instead of just LWP::UserAgent.
  - More POD updates.

0.006 2011-11-22
  - Updated some of the POD.

0.005 2011-11-21
  - Setting file contents via a coderef now works properly.

0.004 2011-11-21

Makefile.PL  view on Meta::CPAN

        'Data::Section::Simple' => 0,
    },
    META_MERGE => {
        resources => {
            license    => 'http://dev.perl.org/licenses/',
            homepage   => 'https://metacpan.org/module/AWS-S3',
            bugtracker => 'https://github.com/leejo/AWS-S3/issues',
            repository => 'https://github.com/leejo/AWS-S3',
        },
    },
    test => {
        RECURSIVE_TEST_FILES => 1,
    },
);

# vim: ts=4:sw=4:et

README.markdown  view on Meta::CPAN

and, as per the AWS docs, will default to "us-east-1".

On success, returns the new [AWS::S3::Bucket](https://metacpan.org/pod/AWS%3A%3AS3%3A%3ABucket)

On failure, dies with the error message.

See [AWS::S3::Bucket](https://metacpan.org/pod/AWS%3A%3AS3%3A%3ABucket) for details on how to use buckets (and access their files).

# SEE ALSO

[The Amazon S3 API Documentation](http://docs.amazonwebservices.com/AmazonS3/latest/API/)

[AWS::S3::Bucket](https://metacpan.org/pod/AWS%3A%3AS3%3A%3ABucket)

[AWS::S3::File](https://metacpan.org/pod/AWS%3A%3AS3%3A%3AFile)

[AWS::S3::FileIterator](https://metacpan.org/pod/AWS%3A%3AS3%3A%3AFileIterator)

[AWS::S3::Owner](https://metacpan.org/pod/AWS%3A%3AS3%3A%3AOwner)

# AUTHOR

lib/AWS/S3.pm  view on Meta::CPAN

and, as per the AWS docs, will default to "us-east-1".

On success, returns the new L<AWS::S3::Bucket>

On failure, dies with the error message.

See L<AWS::S3::Bucket> for details on how to use buckets (and access their files).

=head1 SEE ALSO

L<The Amazon S3 API Documentation|http://docs.amazonwebservices.com/AmazonS3/latest/API/>

L<AWS::S3::Bucket>

L<AWS::S3::File>

L<AWS::S3::FileIterator>

L<AWS::S3::Owner>

=head1 AUTHOR

lib/AWS/S3/Bucket.pm  view on Meta::CPAN

        #warn $response->response->as_string;
        if ( my $msg = $response->friendly_error() ) {
            die $msg;
        }    # end if()

        $self->_clear_policy;

    }
);

# XXX: Not tested.
sub enable_cloudfront_distribution {
    my ( $s, $cloudfront_dist ) = @_;

    $cloudfront_dist->isa( 'AWS::CloudFront::Distribution' )
      or die "Usage: enable_cloudfront_distribution( <AWS::CloudFront::Distribution object> )";

    my $ident = $cloudfront_dist->cf->create_origin_access_identity( Comment => "Access to s3://" . $s->name, );
    $s->policy( <<"JSON");
{
	"Version":"2008-10-17",

lib/AWS/S3/Bucket.pm  view on Meta::CPAN

String.  Returned from the S3 service itself.

Read-only.

=head2 acl

String.  Returns XML string.

Read-only.

See also L<PUT Bucket ACL|http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?RESTBucketPUTacl.html>

=head2 location_constraint

String.  Read-only.

=over 4

=item * EU

=item * us-west-1

lib/AWS/S3/Bucket.pm  view on Meta::CPAN

=item * us-west-2

=item * ap-southeast-1

=item * ap-northeast-1

=back

The default value is undef which means 'US'.

See also L<PUT Bucket|http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?RESTBucketPUT.html>

=head2 policy

Read-only.  String of JSON.

Looks something like this:

  {
    "Version":"2008-10-17",
    "Id":"aaaa-bbbb-cccc-dddd",

lib/AWS/S3/Bucket.pm  view on Meta::CPAN

        "Sid":"1", 
        "Principal" : {
          "AWS":["1-22-333-4444","3-55-678-9100"]
        },
        "Action":["s3:*"],
        "Resource":"arn:aws:s3:::bucket/*",
      }
    ]
  }

See also L<GET Bucket Policy|http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?RESTBucketGETpolicy.html>

=head1 PUBLIC METHODS

=head2 files( page_size => $size, page_number => $number, [[marker => $marker,] pattern => qr/$pattern/ ] )

Returns a L<AWS::S3::FileIterator> object with the supplied arguments.

Use the L<AWS::S3::FileIterator> to page through your results.

=head2 file( $key )

lib/AWS/S3/Bucket.pm  view on Meta::CPAN

    # Reset to page 1:
    $iter->page_number( 1 );
    warn "Deleted $deleted files so far\n";
  }# end while()
  
  # NOW you can delete your bucket (if you want) because it's empty:
  $bucket->delete;

=head1 SEE ALSO

L<The Amazon S3 API Documentation|http://docs.amazonwebservices.com/AmazonS3/latest/API/>

L<AWS::S3::Bucket>

L<AWS::S3::File>

L<AWS::S3::FileIterator>

L<AWS::S3::Owner>

=cut

lib/AWS/S3/File.pm  view on Meta::CPAN

=head2 signed_url( $expiry_time )

Will return a signed URL for public access to the file. $expiry_time should be a
Unix seconds since epoch, and will default to now + 1 hour is not passed.

Note that the Signature parameter value will be URI encoded to prevent reserved
characters (+, =, etc) causing a bad request.

=head1 SEE ALSO

L<The Amazon S3 API Documentation|http://docs.amazonwebservices.com/AmazonS3/latest/API/>

L<AWS::S3>

L<AWS::S3::Bucket>

L<AWS::S3::FileIterator>

L<AWS::S3::Owner>

=cut

lib/AWS/S3/FileIterator.pm  view on Meta::CPAN

=head1 PUBLIC METHODS

=head2 next_page()

Returns the next page of results as an array in list context or arrayref in scalar context.

Increments C<page_number> by one.

=head1 SEE ALSO

L<The Amazon S3 API Documentation|http://docs.amazonwebservices.com/AmazonS3/latest/API/>

L<AWS::S3>

L<AWS::S3::Bucket>

L<AWS::S3::File>

L<AWS::S3::Owner>

L<Iterator::Paged> - on which this class is built.

lib/AWS/S3/Roles/Bucket.pm  view on Meta::CPAN

    if ( $path =~ m{^([^/?]+)(.*)} && $s->is_dns_bucket( $1 ) ) {
        $uri = "$protocol://$1.$endpoint$2";
    }    # end if()

    return $uri;
}

sub is_dns_bucket {
    my ( $s,$bucket ) = @_;

    # https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html
    return 0 if ( length( $bucket ) < 3 or length( $bucket ) > 63 );
    return 0 if $bucket =~ /^(?:\d{1,3}\.){3}\d{1,3}$/;

    # DNS bucket names can contain lowercase letters, numbers, and hyphens
    # so anything outside this range we say isn't a valid DNS bucket
    return $bucket =~ /[^a-z0-9-\.]/ ? 0 : 1;
}

1;

lib/AWS/S3/Signer/V4.pm  view on Meta::CPAN

 my $uri     = URI->new('https://iam.amazonaws.com');
 $uri->query_form(Action=>'ListUsers',
		  Version=>'2010-05-08');

 my $url = $signer->signed_url($uri); # This gives a signed URL that can be fetched by a browser
 my $response = $ua->get($url);

=head1 DESCRIPTION

This module implement's Amazon Web Service's Signature version 4
(http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).

=head1 METHODS

=over 4

=item $signer = AWS::S3::Signer::V4->new(-access_key => $account_id,-secret_key => $private_key);

Create a signing object using your AWS account ID and secret key. You
may also use the temporary security tokens received from Amazon's STS
service, either by passing the access and secret keys derived from the

lib/AWS/S3/Signer/V4.pm  view on Meta::CPAN

    $uri->query_param( 'X-Amz-SignedHeaders' => 'host' );

# If there was a security token passed, we need to supply it as part of the authorization
# because AWS requires it to validate IAM Role temporary credentials.

    if ( defined( $self->{security_token} ) ) {
        $uri->query_param( 'X-Amz-Security-Token' => $self->{security_token} );
    }

# Since we're providing auth via query parameters, we need to include UNSIGNED-PAYLOAD
# http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
# it seems to only be needed for S3.

    if ( $scope =~ /\/s3\/aws4_request$/ ) {
        $self->_sign( $request, undef, 'UNSIGNED-PAYLOAD' );
    }
    else {
        $self->_sign($request);
    }

    my ( $algorithm, $credential, $signedheaders, $signature ) =

lib/AWS/S3/Signer/V4.pm  view on Meta::CPAN

}

sub parse_host {
    my $self = shift;
    my $host = shift;
    my $region = shift;

    # this entire thing should probably refactored into its own
    # distribution, a la https://github.com/zirkelc/amazon-s3-url

    # https://docs.aws.amazon.com/prescriptive-guidance/latest/defining-bucket-names-data-lakes/faq.html
    # Only lowercase letters, numbers, dashes, and dots are allowed in S3 bucket names.
    # Bucket names must be three to 63 characters in length,
    # must begin and end with a number or letter,
    # and cannot be in an IP address format.
    my $bucket_re = '[a-z0-9][a-z0-9\-\.]{1,61}[a-z0-9]';
    my $domain_re = 'amazonaws\.com';
    my $region_re = '(?:af|ap|ca|eu|il|me|mx|sa|us)-[a-z]+-\d';

    my ( $service, $url_style );

t/001_compiles_pod.t  view on Meta::CPAN

my @files;

find(
  {
    wanted => sub { /\.pm$/ and push @files, $File::Find::name },
    no_chdir => 1
  },
  -e 'blib' ? 'blib' : 'lib',
);

plan tests => @files * 3;

for my $file (@files) {
  my $module = $file; $module =~ s,\.pm$,,; $module =~ s,.*/?lib/,,; $module =~ s,/,::,g;
  ok eval "use $module; 1", "use $module" or diag $@;
  Test::Pod::pod_file_ok($file);
  TODO: {
	# not enough POD coverage yet,
	local $TODO = 'POD coverage';
	Test::Pod::Coverage::pod_coverage_ok($module);
  }

t/002_changes.t  view on Meta::CPAN

#!perl

use strict;
use warnings;

use Test::More;

eval 'use Test::CPAN::Changes';

plan skip_all => 'Test::CPAN::Changes required for this test' if $@;

changes_ok();

t/010_basic.t  view on Meta::CPAN

use strict;
use warnings 'all';
use Test::More;
use Data::Dumper;
use FindBin qw/ $Bin /;
use lib "$Bin/../lib";

use Carp 'confess';
$SIG{__DIE__} = \&confess;

plan skip_all => '$ENV{AWS_ACCESS_KEY_ID} && $ENV{AWS_SECRET_ACCESS_KEY} must both be defined to run this test'
	unless( $ENV{AWS_ACCESS_KEY_ID} && $ENV{AWS_SECRET_ACCESS_KEY} );

use_ok('AWS::S3');

my $s3 = AWS::S3->new(
  access_key_id     => $ENV{AWS_ACCESS_KEY_ID},
  secret_access_key => $ENV{AWS_SECRET_ACCESS_KEY},
  session_token     => $ENV{AWS_SESSION_TOKEN},
  region            => $ENV{AWS_REGION},
);

isa_ok $s3->ua, 'LWP::UserAgent';

cleanup();

ok my $owner = $s3->owner(), "s3.owner returns a value";
isa_ok $owner, 'AWS::S3::Owner';
ok $owner->id, 'owner.id';
ok $owner->display_name, 'owner.display_name';

my $bucket_name = $ENV{AWS_TEST_BUCKET} || "aws-s3-test-" . int(rand() * 1_000_000) . '-' . time() . "-foo";
ok my $bucket = $s3->add_bucket( name => $bucket_name, location => 'us-east-1' ), "created bucket '$bucket_name'";

#exit;
if( $bucket )
{

if(0) {
  # Try cloudfront integration if we've got it:
  eval { require AWS::CloudFront; require AWS::CloudFront::S3Origin; };
  die $@ if $@;

t/010_basic.t  view on Meta::CPAN

#  my $acl = $bucket->acl;
#  ok $bucket->acl( 'private' ), 'set bucket.acl to private';
#  is $acl, $bucket->acl, 'get bucket.acl returns private';

#  ok $bucket->location_constraint( 'us-east-1' ), 'set bucket.location_constraint to us-east-1';
#  is $bucket->location_constraint, 'us-east-1', 'get bucket.location returns us-east-1';
#  is $s3->bucket($bucket->name)->location_constraint, 'us-east-1', 'get bucket.location returns us-east-1 second time';

#  is $bucket->policy, '', 'get bucket.policy returns empty string';

  my $test_str = "This is the original value right here!"x20;
  my $filename = 'foo/bar.txt';
  ADD_FILE: {
    my $file = $bucket->add_file(
      key       => $filename,
      contents  => \$test_str
    );
    ok( $file, 'bucket.add_file() works' );
    unlike $file->etag, qr("), 'file.etag does not contain any double-quotes (")';
  };
  
  GET_FILE: {
    ok my $file = $bucket->file($filename), 'bucket.file(filename) works';
    is ${ $file->contents }, $test_str, 'file.contents is correct';
  };
  
  ADD_FILE_WITH_CODE: {
    my $text = "This is the content"x4;
    ok $bucket->add_file(
      key => 'code/test.txt',
      contents  => sub { return \$text }
    ), 'add file with code contents worked';
    ok my $file = $bucket->file('code/test.txt'), "got file back from bucket";
    is ${$file->contents}, $text, "file.contents on code is correct";
    $file->contents( sub { return \uc($text) } );
    is ${$file->contents}, uc($text), "file.contents on code is correct after update";
    
    $file->delete;
  };
  
  # Set contents:
  SET_CONTENTS: {
    my $new_contents = "This is the updated value"x10;

t/010_basic.t  view on Meta::CPAN

      # remove file
      $ct_file->delete();
    }
  };
  
  # Cleanup:
  ok $bucket->delete, 'bucket.delete succeeds when bucket IS empty.';
}# end if()

cleanup();
done_testing();

sub cleanup
{
  warn "\nCleaning Up...\n";
  foreach my $bucket ( grep { $_->name =~ m{^(aws-s3-test\-\d+).+?foo$} } $s3->buckets )
  {
    warn "Bucket: ", $bucket->name, "\n";
    my $iter = $bucket->files( page_size => 100, page_number => 1 );
    while( my @files = $iter->next_page )
    {
$bucket->delete_multi( map { $_->key } @files );
#      foreach my $file ( @files )
#      {
#        warn "\tdelete: ", $file->key, "\n";
#        eval { $file->delete };

t/aws/s3.t  view on Meta::CPAN

$SIG{__DIE__} = \&confess;

use_ok('AWS::S3');

my $s3 = AWS::S3->new(
  access_key_id     => $ENV{AWS_ACCESS_KEY_ID}     // 'foo',
  secret_access_key => $ENV{AWS_SECRET_ACCESS_KEY} // 'bar',
  endpoint          => 'bad.hostname.',
);

my $bucket_name = "aws-s3-test-" . int(rand() * 1_000_000) . '-' . time() . "-foo";

eval {
    my $bucket = $s3->add_bucket( name => $bucket_name, location => 'us-west-1' );
};

like(
    $@,
    qr/Can't connect to aws-s3-test-.*?bad\.hostname/,
    'endpoint was used'
);

isa_ok(
	$s3->request( 'CreateBucket',bucket => 'foo' ),
	'AWS::S3::Request::CreateBucket'
);

subtest 'create bucket strange temporary redirect' => sub {
    plan tests => 8;    # make sure all tests in here get run

    my $i = 1;
    local *LWP::UserAgent::Determined::request = sub {
        my ( undef, $req ) = @_;

        if ( $i == 1 ) {

            # first PUT request, send a forward
            is( $req->method, 'PUT', 'bucket creation with PUT request' );
            is( $req->uri->as_string, 'http://bar.bad.hostname./', '... and with correct URI' );

t/aws/s3/bucket.t  view on Meta::CPAN


$mocked_response->{_msg} = '';
ok( $bucket->delete,'->delete' );
ok( $bucket->delete_multi( qw/foo bar baz/ ),'->delete_multi' );

throws_ok
	{ $bucket->enable_cloudfront_distribution( $mocked_response ) }
	qr/AWS::CloudFront::Distribution/
;

done_testing();

t/aws/s3/file.t  view on Meta::CPAN

use_ok('AWS::S3::Request::SetFileContents');

monkey_patch_module();

my $path = '/path/to/';
my $key  = $ENV{AWS_TEST_KEY} // "my+image.jpg";

isa_ok(
    my $file = AWS::S3::File->new(
        key          => $path . $key,
        contents     => sub { 'test file contents' },
        is_encrypted => 0,
        bucket       => AWS::S3::Bucket->new(
            s3   => $s3,
            name => $ENV{AWS_TEST_BUCKET} // 'maibucket',
        ),
    ),
    'AWS::S3::File'
);

can_ok(

t/aws/s3/file.t  view on Meta::CPAN


no warnings qw/ once redefine /;
my $mocked_response = Mocked::HTTP::Response->new( 200,'bar' );
*LWP::UserAgent::Determined::request = sub { $mocked_response };
$mocked_response->{_msg} = '';

ok( $file->delete,'->delete' );
ok( $file->_get_contents,'_get_contents' );
}

done_testing();

sub monkey_patch_module {
    # monkey patching for true(r) unit tests
    no warnings 'redefine';
    no warnings 'once';

    sub response { return shift; }
    sub header { return shift; }
    sub friendly_error { return; }

    *AWS::S3::Request::SetFileContents::request = sub {
        return bless( {},'main' );
    };

t/aws/s3/file_iterator.t  view on Meta::CPAN

    cmp_deeply( \@pages,[ obj_isa('AWS::S3::File') ],'next_page returns one ::File' );
    is( $pages[0]->key,'img/my image.jpg','... and it is the one expected' );
    is( $iterator->next_page->[0]->key,'img/my-third-image.jpg','next_page second item' );
    is( $iterator->next_page->[0]->key,'img/my image.jpg','next_page new request, first item' );

    $mocked_response = Mocked::HTTP::Response->new( 200,get_data_section('EmptyResult') );
    ok( $iterator->next_page,'next_page second item' );
    ok( ! $iterator->next_page,'no more items' );
}

subtest 'advance to page X before processing' => sub {
	my $iterator = AWS::S3::FileIterator->new(
		page_number => 5,
		page_size   => 1,
		bucket      => $bucket,
        pattern     => qr/\d+/,
	);

    my $number_of_request;
    my $xml = get_data_section('LongResult');
    my $mocked_response = Mocked::HTTP::Response->new( 200,$xml );

t/aws/s3/file_iterator.t  view on Meta::CPAN


    is( $iterator->next_page->[0]->key,5,'start at file 5' );
    is( $iterator->next_page->[0]->key,6,'... file 6' );
    is( $iterator->next_page->[0]->key,7,'... file 7' );
    is( $iterator->next_page->[0]->key,8,'... file 8' );
    is( $iterator->next_page->[0]->key,9,'... file 9' );
    is( $iterator->next_page->[0]->key,0,'do a new request and get file 0' );
    is( $number_of_request,2,'did two requests' );
};

done_testing();

__DATA__
@@ ListBucketResult.xml
<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Name>bucket</Name>
    <Prefix>img</Prefix>
    <Marker/>
    <MaxKeys>1000</MaxKeys>
    <IsTruncated>false</IsTruncated>

t/aws/s3/http_request.t  view on Meta::CPAN

    ),
    'AWS::S3::HTTPRequest'
);

isa_ok( my $http_request_with_content = $request_with_content->http_request, 'HTTP::Request' );
my $header = $http_request_with_content->headers;
is( $header->header( 'content-type' ), 'text/plain', '... and content-type got set' );
is( $header->header( 'content-length' ), 12, '... and content-length got set' );
is( $header->header( 'host' ), 's3.baz.com', '... and host got set' );

done_testing();

t/aws/s3/signer.t  view on Meta::CPAN

is( $signer->canonicalized_resource,'/maibucket/boz','canonicalized_resource' );
is( $signer->content_type,'text/plain','content_type' );
is( $signer->content_md5,'XrY7u+Ae7tCTyyK7j1rNww==','content_md5' );
is( ${ $signer->content },'hello world','content' );
is( $signer->content_length,11,'content_length' );
like( $signer->signature,qr/^.{28}$/,'signature' );

note( "methods" );
like( $signer->auth_header,qr/AWS foo:.{28}/,'auth_header' );

done_testing();

t/aws/s3/signer/v4.t  view on Meta::CPAN

#-*-Perl-*-

# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.t'

use strict;
use warnings;

use ExtUtils::MakeMaker;
use FindBin '$Bin';
use constant TEST_COUNT => 13;

use Test::More tests => TEST_COUNT;

use_ok('AWS::S3::Signer::V4');
use_ok('HTTP::Request::Common');

my $signer = AWS::S3::Signer::V4->new(
    -access_key => 'AKIDEXAMPLE',
    -secret_key => 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY'
);
ok( $signer, 'AWS::S3::Signer::V4->new' );
my $request = POST(

t/aws/s3/signer/v4_parse_host.t  view on Meta::CPAN

#-*-Perl-*-

# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.t'

use strict;
use warnings;

use ExtUtils::MakeMaker;
use FindBin '$Bin';
use constant TEST_COUNT => 1169;

use Test::More tests => TEST_COUNT;
use Test::Deep;

use_ok('AWS::S3::Signer::V4');

my $signer = AWS::S3::Signer::V4->new(
    -access_key => 'AKIDEXAMPLE',
    -secret_key => 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY'
);
isa_ok( $signer, 'AWS::S3::Signer::V4' );



( run in 0.440 second using v1.01-cache-2.11-cpan-87723dcf8b7 )