OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
zzaws-ses
/
vendor
/
aws
/
aws-sdk-php
/
tests
/
S3
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/14/2024 08:01:07 AM
rwxr-xr-x
📄
AmbiguousSuccessParserTest.php
3.68 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
ApplyChecksumMiddlewareTest.php
7.42 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
BatchDeleteTest.php
6.73 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
BucketEndpointArnMiddlewareTest.php
21.78 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
BucketEndpointMiddlewareTest.php
6.02 KB
08/14/2024 07:59:11 AM
rw-r--r--
📁
Crypto
-
08/14/2024 08:01:07 AM
rwxr-xr-x
📁
Exception
-
08/14/2024 08:01:07 AM
rwxr-xr-x
📄
GetBucketLocationParserTest.php
1.34 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
MultipartCopyTest.php
4.94 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
MultipartUploaderTest.php
12.52 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
ObjectCopierTest.php
15.15 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
ObjectUploaderTest.php
11.32 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
PermanentRedirectMiddlewareTest.php
982 bytes
08/14/2024 07:59:11 AM
rw-r--r--
📄
PostObjectTest.php
3.52 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
PostObjectV4Test.php
11.12 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
PutObjectUrlMiddlewareTest.php
2 KB
08/14/2024 07:59:11 AM
rw-r--r--
📁
RegionalEndpoint
-
08/14/2024 08:01:08 AM
rwxr-xr-x
📄
RetryableMalformedResponseParserTest.php
934 bytes
08/14/2024 07:59:11 AM
rw-r--r--
📄
S3ClientTest.php
92.05 KB
08/14/2024 07:59:12 AM
rw-r--r--
📄
S3EndpointMiddlewareTest.php
30.05 KB
08/14/2024 07:59:11 AM
rw-r--r--
📄
S3MultiRegionClientTest.php
24.99 KB
08/14/2024 07:59:12 AM
rw-r--r--
📄
S3UriParserTest.php
7.45 KB
08/14/2024 07:59:12 AM
rw-r--r--
📄
SSECMiddlewareTest.php
2.91 KB
08/14/2024 07:59:12 AM
rw-r--r--
📄
StreamWrapperPathStyleTest.php
30.16 KB
08/14/2024 07:59:12 AM
rw-r--r--
📄
StreamWrapperTest.php
36.33 KB
08/14/2024 07:59:12 AM
rw-r--r--
📄
StreamWrapperV2ExistenceTest.php
32.63 KB
08/14/2024 07:59:12 AM
rw-r--r--
📄
TransferTest.php
14.24 KB
08/14/2024 07:59:12 AM
rw-r--r--
📁
UseArnRegion
-
08/14/2024 08:01:08 AM
rwxr-xr-x
📄
ValidateResponseChecksumParserTest.php
5.45 KB
08/14/2024 07:59:12 AM
rw-r--r--
📁
fixtures
-
08/14/2024 08:08:07 AM
rwxr-xr-x
📄
sig_hack.php
226 bytes
08/14/2024 07:59:12 AM
rw-r--r--
📁
test_cases
-
08/14/2024 08:01:08 AM
rwxr-xr-x
Editing: BucketEndpointMiddlewareTest.php
Close
<?php namespace Aws\Test\S3; use Aws\Middleware; use Aws\Test\UsesServiceTrait; use PHPUnit\Framework\TestCase; /** * @covers Aws\S3\BucketEndpointMiddleware */ class BucketEndpointMiddlewareTest extends TestCase { use UsesServiceTrait; public function testUsesHostStyleByDefault() { $s3 = $this->getTestClient('s3'); $this->addMockResults($s3, [[]]); $command = $s3->getCommand('GetObject', ['Bucket' => 'foo', 'Key' => 'Bar/Baz']); $command->getHandlerList()->appendSign( Middleware::tap(function ($cmd, $req) { $this->assertSame('foo.s3.amazonaws.com', $req->getUri()->getHost()); $this->assertSame('/Bar/Baz', $req->getRequestTarget()); }) ); $s3->execute($command); } public function testUsesPathStyle() { $s3 = $this->getTestClient('s3', [ 'use_path_style_endpoint' => true ]); $this->addMockResults($s3, [[]]); $command = $s3->getCommand('GetObject', ['Bucket' => 'foo', 'Key' => 'Bar/Baz']); $command->getHandlerList()->appendSign( Middleware::tap(function ($cmd, $req) { $this->assertSame('s3.amazonaws.com', $req->getUri()->getHost()); $this->assertSame('/foo/Bar/Baz', $req->getRequestTarget()); }) ); $s3->execute($command); } public function testIgnoresExcludedCommands() { $s3 = $this->getTestClient('s3'); $this->addMockResults($s3, [['bucket_endpoint' => true]]); $command = $s3->getCommand('GetBucketLocation', ['Bucket' => 'foo']); $command->getHandlerList()->appendSign( Middleware::tap(function ($cmd, $req) { $this->assertSame('foo.s3.amazonaws.com', $req->getUri()->getHost()); $this->assertSame('/?location', $req->getRequestTarget()); }) ); $s3->execute($command); } public function testPathStyleIgnoresExcludedCommands() { $s3 = $this->getTestClient('s3', [ 'use_path_style_endpoint' => true ]); $this->addMockResults($s3, [['bucket_endpoint' => true]]); $command = $s3->getCommand('GetBucketLocation', ['Bucket' => 'foo']); $command->getHandlerList()->appendSign( Middleware::tap(function ($cmd, $req) { $this->assertSame('s3.amazonaws.com', $req->getUri()->getHost()); $this->assertSame('/foo?location', $req->getRequestTarget()); }) ); $s3->execute($command); } public function testRemovesBucketWhenBucketEndpoint() { $s3 = $this->getTestClient('s3', [ 'endpoint' => 'http://test.domain.com', 'bucket_endpoint' => true ]); $this->addMockResults($s3, [[]]); $command = $s3->getCommand('GetObject', [ 'Bucket' => 'test', 'Key' => 'key' ]); $command->getHandlerList()->appendSign( Middleware::tap(function ($cmd, $req) { $this->assertSame('test.domain.com', $req->getUri()->getHost()); $this->assertSame('/key', $req->getRequestTarget()); }) ); $s3->execute($command); } public function testHandlesTrailingForwardSlash() { $s3 = $this->getTestClient('s3', [ 'endpoint' => 'http://test.domain.com/test/', 'bucket_endpoint' => true ]); $this->addMockResults($s3, [[]]); $command = $s3->getCommand('ListObjects', [ 'Bucket' => 'test', 'Prefix' => '/' ]); $command->getHandlerList()->appendSign( Middleware::tap(function ($cmd, $req) { $this->assertSame('test.domain.com', $req->getUri()->getHost()); $this->assertSame('/test/?prefix=%2F&encoding-type=url', $req->getRequestTarget()); }) ); $s3->execute($command); } public function testHandlesDuplicatePath() { $s3 = $this->getTestClient('s3', [ 'endpoint' => 'http://domain.com/test', 'bucket_endpoint' => true, 'use_path_style_endpoint' => true ]); $this->addMockResults($s3, [[]]); $command = $s3->getCommand('headBucket', [ 'Bucket' => 'test', ]); $command->getHandlerList()->appendSign( Middleware::tap(function ($cmd, $req) { $this->assertSame('domain.com', $req->getUri()->getHost()); $this->assertSame('/test/', $req->getUri()->getPath()); }) ); $s3->execute($command); } public function keyContainsBucketNameProvider() { return [ ['bucketname'], ['/bucketname'], ['foo/bucketname/'], ['/foo/bucketname'], ['///bucketname'], ['bucketname/bucketname/bucketname/bucketname'], ['/bucketname/bucketname/bucketname/bucketname'] ]; } /** * @dataProvider keyContainsBucketNameProvider * * @param $key */ public function testsHandlesDuplicatePathWithKeyContainsBucketName($key) { $s3 = $this->getTestClient('s3', [ 'endpoint' => 'http://domain.com/bucketname', 'bucket_endpoint' => true, 'use_path_style_endpoint' => true ]); $this->addMockResults($s3, [[]]); $command = $s3->getCommand('headObject', [ 'Bucket' => 'bucketname', 'Key' => $key ]); $command->getHandlerList()->appendSign( Middleware::tap(function ($cmd, $req) use ($key) { $this->assertSame('domain.com', $req->getUri()->getHost()); $this->assertSame('/bucketname/' . $key, $req->getUri()->getPath()); }) ); $s3->execute($command); } }