Commit Graph

269 Commits

Author SHA1 Message Date
Codeglitches
9f9716ee01
Check S3_IGNORE_SUBDOMAIN_BUCKETNAME environment variable (#3796)
* Check S3_IGNORE_SUBDOMAIN_BUCKETNAME environment variable

* move S3_IGNORE_SUBDOMAIN_BUCKETNAME environment variable to settings
2021-03-26 16:51:19 +00:00
Tibor Djurica Potpara
b06e77b604
Make put-object-acl return 404 if the key does not exist (#3777)
Co-authored-by: Tibor Djurica Potpara <tibor.djurica@reddit.com>
2021-03-16 22:24:41 +00:00
Bert Blommers
d7b8419791
Fix Mock 4.0.3 compatibility - Unpatch only once during teardown (#3541)
* #3535 - Unpatch only once during teardown

* EnvVar patching - Fix Python2 bug

* Allow latest version of mock-library
2021-02-15 08:42:16 +00:00
wynnw
891118a7c7
#3667: Update the s3 post functionality to better support success_action_redirect (#3668)
* Update the s3 post functionality to better support success_action_redirect

- Add the bucket/key values to the redirect url like s3 does, which
supports code that relies on the key value being there on the
redirect.
- Add support for replacing ${filename} in the key value with the actual
filename from the form upload.

See Issue #3667

* Update s3 tests for changed success_action_redirect behavior

- Adds a new test called test_s3_server_post_to_bucket_redirect that
tests both the ${filename} replacement and the key/value addition to the
redirect query args
- Updated the test_creating_presigned_post checks to handle the
key/value additions to the redirect url.

* Fix test updates to work with python2.7

- remove f-string usage
- fix urllib.parse imports to use six

Co-authored-by: Wynn Wilkes <wynn@leading2lean.com>
2021-02-10 09:06:03 +00:00
Rahul Ranjan
7d066cea2f
Add versionid header in complete multipart if enabled (#3643)
* Add versionid header in complete multipart if enabled
- addresses https://github.com/localstack/localstack/issues/3514

* remove unnecessary code

* fix lint

* fix lint test

* add test case for boto3
2021-02-02 09:51:17 +00:00
Brian Pandola
cd044ef00b
Remove redundant test code (#3640)
These tests, when run, do not execute any `moto` code. They fail the
parameter validation check in `botocore`, which raises an exception
before ever sending a request.  These tests do not cover or verify
any `moto` behavior and have been removed.
2021-01-31 12:21:24 +00:00
Macwan Nevil
02ac5ca111
added sse support for s3 (#3592)
* added sse support for s3

* lint fixed for py37
2021-01-18 18:17:13 +00:00
Rahul Ranjan
628c026a07
Sort s3 object versions by last_modified_on in descending order (#3588)
* Sort s3 object versions by last_modified_on in descending order

- addresses https://github.com/localstack/localstack/issues/3433

* fix for python 2

* fix lint
2021-01-15 18:28:28 +00:00
Bert Blommers
d1696a37e5
#2710 - S3 - Raise specific error when GetObject is called with unknown VersionId (#3532) 2021-01-13 16:06:09 +00:00
Bert Blommers
df8bd43a45
#2965 - S3 - GetObject - Treat empty Range-argument as a regular GET (#3531) 2021-01-13 10:00:18 +00:00
irahulranjan
dffc0e449c
Fix: ListObjectsV2 behaving differently than AWS API (#3545)
* fix : localstack issue https://github.com/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+language%3Ago

* add assertion for error message as well
2020-12-13 13:38:25 +00:00
Bert Blommers
273ca63d59 Linting 2020-11-11 15:55:37 +00:00
Bert Blommers
cb6731f340 Convert fixtures/exceptions to Pytest 2020-11-11 15:54:01 +00:00
Matěj Cepl
5697ff87a8 Back to Black 2020-11-10 14:12:38 +01:00
Matěj Cepl
ea489bce6c Finish porting from nose to pytest. 2020-11-10 08:25:05 +01:00
Matěj Cepl
77dc60ea97 Port test suite from nose to pytest.
This just eliminates all errors on the tests collection. Elimination of
failures is left to the next commit.
2020-11-10 08:23:44 +01:00
Bert Blommers
cc27f1ef0c S3 - Add more detail to error responses 2020-10-28 14:22:18 +00:00
Neal Granger
a5fc14b5bc
Add missing Fn::GetAtt attributes to S3 bucket mock (#3396)
* Add missing `Fn::GetAtt` attributes to S3 bucket mock

Addresses an issue reported here https://github.com/localstack/aws-cdk-local/issues/1

* Reformat touched files with `black`

* Reformat touched files with `black` on Python 3.7
2020-10-27 16:04:32 +00:00
Brian Pandola
6505c893b8
Fix: S3 Bucket does not support attribute type Arn in Fn::GetAtt (#3388)
Fixes #3387
2020-10-16 11:29:26 +01:00
usmangani1
0b9903a3df
Fix:s3 List Object response:delimiter (#3254)
* Fix:s3 List Object delimiter in response

* fixed tests

* fixed failed tests

Co-authored-by: usmankb <usman@krazybee.com>
2020-09-21 16:21:18 +01:00
ruthbovell
1022aa0968
Issue 3224 s3 copy glacier object (#3318)
* 3224 Enhancement - S3 Copy restored glacier objects

- adds setter for expiry date
- copy sets expiry date to none when source is glacier object
- throws error for copying glacier object only if not restored/still restoring

* 3224 Enhancement - S3 Copy restored glacier objects

- throws error for copying deep archive object only if not restored/still restoring
2020-09-21 07:37:50 +01:00
Leo Sutic
cc0bd5213f
Enable CORS from everywhere using flask-cors. (#3316)
Co-authored-by: Leo Sutic <leo.sutic@matterport.com>
2020-09-19 10:07:17 +01:00
Leo Sutic
94543f6e48
Include response headers when deleting objects. (#3313)
* Return delete meta.

* Add tests.

* Lint fixes.

Co-authored-by: Leo Sutic <leo.sutic@matterport.com>
2020-09-15 13:29:09 +01:00
jweite
9f0f230d13
Change to test_s3 method test_presigned_url_restrict_parameters to tolerate change in exception messages, spurred by boto3 1.14.59 release. (#3308)
Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
2020-09-11 11:17:36 +01:00
Arcadiy Ivanov
c2d1ce2c14
Add If-Match, If-None-Match and If-Unmodified-Since to S3 GET/HEAD (#3021)
fixes #2705
2020-09-11 10:17:39 +01:00
usmangani1
d2e16ecc2e
Fix:s3 Presign Post with object acl (#3246)
* Fix:s3 Presign Post with object acl

* Added import in tests

Co-authored-by: usmankb <usman@krazybee.com>
2020-09-02 18:35:53 +01:00
usmangani1
00a5641cb9
Fix:s3 Presign Put Request with File upload (#3235)
* Fix:s3 Presign Put Request with File upload

* Added imports in test

Co-authored-by: usmankb <usman@krazybee.com>
2020-09-02 07:10:56 +01:00
jweite
49d92861c0
Iam cloudformation update, singificant cloudformation refactoring (#3218)
* IAM User Cloudformation Enhancements: update, delete, getatt.

* AWS::IAM::Policy Support

* Added unit tests for AWS:IAM:Policy for roles and groups.  Fixed bug related to groups.

* AWS:IAM:AccessKey CloudFormation support.

* Refactor of CloudFormation parsing.py methods to simplify and standardize how they call to the models.  Adjusted some models accordingly.

* Further model CloudFormation support changes to align with revised CloudFormation logic.  Mostly avoidance of getting resoure name from properties.

* Support for Kinesis Stream RetentionPeriodHours param.

* Kinesis Stream Cloudformation Tag Support.

* Added omitted 'region' param to boto3.client() calls in new tests.

Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
2020-08-27 10:11:47 +01:00
jweite
3342d49a43
S3 cloudformation update (#3199)
* First cut of S3 Cloudformation Update support: encryption property.

* Update type support for S3.  Abstract base class for CloudFormation-aware models, as designed by @bblommers, introduced to decentralize CloudFormation resource and name property values to model objects.

* Blackened...

* Un-renamed param in s3.models.update_from_cloudformation_json() and its call to stay compatible with other modules.

Co-authored-by: Bert Blommers <bblommers@users.noreply.github.com>
Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
Co-authored-by: Bert Blommers <info@bertblommers.nl>
2020-08-01 22:43:03 +01:00
Bert Blommers
8b63421321 S3 - Only add metadata once; use binary file content 2020-07-12 18:29:10 +01:00
Bert Blommers
b33c5dff06 #2104 - S3 - Persist metadata for Presigned URL 2020-07-12 13:33:46 +01:00
Bert Blommers
9ed7ba58df S3 - Implement delete_object_tagging 2020-06-20 12:15:29 +01:00
Dawn James
8ce12027dd
Return correct error when creating a bucket with empty CreateBucketConfiguration (#3079)
* Several updates to the contributor documentation with extra information.

* Fix failing test by providing a region.

* Create test for issue 2210.

* Check if CreateBucketConfiguration is supplied and empty; raise MalformedXML error if so.
2020-06-19 11:44:43 +01:00
Steve Pulec
46f6f7822f
Merge pull request #3053 from bblommers/impl_coverage_improv
Improve implementation coverage
2020-06-11 20:49:58 -05:00
Gordon Cassie
b88f166099
Fix: Support streaming upload from requests. (#3062)
* Fix: Support streaming upload from requests.

* [FIX] style.

Co-authored-by: Gordon Cassie <gordon.cassie@closingfolders.com>
2020-06-11 06:50:50 +01:00
Bert Blommers
20784a2d67 Improve implementation coverage 2020-06-06 13:15:50 +01:00
jweite
4d3e3c8c5e
implemented s3 default encryption methods (#3022)
* implemented s3 default encryption methods

* PR adjustments: moved logic for retrieving bucket's encrypted status to the backend.

Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
2020-05-27 17:21:03 +01:00
usmangani1
774a764b69
Fix s3 Added Error handling in case of invalid uploadID (#2979)
* Added Error handling in case of invalid uploadID

* Linting

* added assertions

* Linting

Co-authored-by: usmankb <usman@krazybee.com>
Co-authored-by: Bert Blommers <info@bertblommers.nl>
2020-05-12 14:59:07 +01:00
Bert Blommers
49b00942c3 S3 DeleteObjects - Allow multiple querystring formats 2020-05-01 13:50:11 +01:00
Bert Blommers
b5a894dd89
Merge pull request #2919 from antoinewdg-mt/fix-s3-delete-objects-with-versioning
Handle VersionId in S3:delete_objects
2020-04-27 15:38:06 +01:00
Steve Pulec
efbb9c54a5
Merge pull request #2909 from oliparcol/bug/2759
S3 - Allow keys to start with leading slashes
2020-04-25 18:46:25 -05:00
Steve Pulec
b24b7cb858
Merge branch 'master' into feature/extend_generic_tagger_to_s3 2020-04-25 18:40:50 -05:00
Olivier Parent Colombel
d852f7dd06 Fixing lint errors. 2020-04-25 17:49:50 +02:00
Olivier Parent Colombel
637e0188a2 Allow S3 keys to start with leading slashes. 2020-04-25 17:49:50 +02:00
Antoine Wendlinger
9ed6e52d0a Handle VersionId in S3:delete_objects
VersionId is not read in delete_objects requests, and the behavior
differs from its singular counterpart delete_object.

This fixes the issue.
2020-04-23 19:01:58 +02:00
Daniel Wallace
80b27a6b93
blacken 2020-04-21 21:43:32 -05:00
Daniel Wallace
49b056563a
process multipart form 2020-04-21 19:52:10 -05:00
Daniel Wallace
b3f6e5ab2f
add test 2020-04-21 18:07:50 -05:00
Bert Blommers
8dbfd43c5c Use TaggingService for S3 - Cleanup 2020-04-01 15:35:25 +01:00
Bert Blommers
f7ad4cbc09 Use TaggingService for S3 Objects 2020-03-31 12:04:04 +01:00