AWS-S3

 view release on metacpan or  search on metacpan

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

fixed value, include the "Date" header in the request.

The request content, or "payload" is retrieved from the HTTP::Request
object by calling its content() method.. Under some circumstances the
payload is not included directly in the request, but is in an external
file that will be uploaded as the request is executed. In this case,
you must pass a second argument containing the results of running
sha256_hex() (from the Digest::SHA module) on the content.

The method returns a true value if successful. On errors, it will
throw an exception.

=item $url = $signer->signed_url($request)

This method will generate a signed GET URL for the request. The URL
will include everything needed to perform the request.

=cut

sub sign {
    my $self = shift;

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

    is( $s3->bucket( 'foo' )->name, 'foo', '->bucket' );
}

{
    my $xml = get_data_section('error.xml');

    local *LWP::UserAgent::Determined::request = sub {
        return Mocked::HTTP::Response->new( 400,$xml );
    };

    throws_ok { $s3->add_bucket( name => 'too many buckets', location => 'us-west-1' ) }
    qr/TooManyBuckets/, 'add_bucket throws an error';
}
__DATA__
@@ ListAllMyBucketsResult.xml
<?xml version="1.0" encoding="UTF-8"?>
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Owner>
    <ID>bcaf1ffd86f41161ca5fb16fd081034f</ID>
    <DisplayName>webfile</DisplayName>
  </Owner>
  <Buckets>

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

		size => 1,
		contents => \"bar",
	),
	'AWS::S3::File'
);

$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_iterator.t  view on Meta::CPAN

    ),
    'AWS::S3::Bucket'
);

foreach my $args (
    [qw( page_size page_number )],
    [qw( bucket page_number )],
    [qw( bucket page_size )],
)
{
    throws_ok {
        AWS::S3::FileIterator->new( map { $_ => 1 } @$args );
    }
    qr/Required argument/, 'dies when arg is missing';
}

{
    isa_ok(
        my $iterator = AWS::S3::FileIterator->new(
            page_number => 2,
            page_size   => 1,



( run in 0.520 second using v1.01-cache-2.11-cpan-496ff517765 )