File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -2973,13 +2973,25 @@ describe('AWS.S3', function() {
2973
2973
} ) ;
2974
2974
2975
2975
it ( 'supports outposts ARN' , function ( done ) {
2976
+ s3 = new AWS . S3 ( { region : 'us-west-2' , signatureVersion : 'v4' } ) ;
2977
+ helpers . spyOn ( AWS . S3 . prototype , 'getSkewCorrectedDate' ) . andReturn ( new Date ( '2021-08-27T00:00:00' ) ) ;
2976
2978
s3 . getSignedUrl ( 'getObject' , {
2977
- Bucket : 'arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/myendpoint' ,
2978
- Key : 'key'
2979
- } , function ( err , data ) {
2980
- expect ( data ) . to . equal (
2981
- 'https://myendpoint-123456789012.op-01234567890123456.s3-outposts.us-west-2.amazonaws.com/key?AWSAccessKeyId=akid&Expires=900&Signature=R9HjMWdhk69e7%2BwlOpFH1TUkxRY%3D&x-amz-security-token=session'
2982
- ) ;
2979
+ Bucket : 'arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myendpoint' ,
2980
+ Key : 'obj'
2981
+ } , function ( _ , data ) {
2982
+ expect ( data ) . to . contain ( '20210827%2Fus-west-2%2Fs3-outposts%2Faws4_request' ) ;
2983
+ done ( ) ;
2984
+ } ) ;
2985
+ } ) ;
2986
+
2987
+ it ( 'supports outposts ARN from resolved region' , function ( done ) {
2988
+ s3 = new AWS . S3 ( { region : 'us-west-2' , signatureVersion : 'v4' } ) ;
2989
+ helpers . spyOn ( AWS . S3 . prototype , 'getSkewCorrectedDate' ) . andReturn ( new Date ( '2021-08-27T00:00:00' ) ) ;
2990
+ s3 . getSignedUrl ( 'getObject' , {
2991
+ Bucket : 'arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myendpoint' ,
2992
+ Key : 'obj'
2993
+ } , function ( _ , data ) {
2994
+ expect ( data ) . to . contain ( '20210827%2Fus-east-1%2Fs3-outposts%2Faws4_request' ) ;
2983
2995
done ( ) ;
2984
2996
} ) ;
2985
2997
} ) ;
You can’t perform that action at this time.
0 commit comments