Commit Graph

450 Commits

Author SHA1 Message Date
Bert Blommers
14a69c7524
Techdebt: Enable pylint rules (#4432) 2021-10-18 19:44:29 +00:00
Bert Blommers
135edda994
S3 - get/put/delete replication config (#4421) 2021-10-16 17:26:09 +00:00
Shreesha Addala
c62bd5ca41
Enforce tagging restrictions for S3 object (#4417) 2021-10-15 19:10:28 +00:00
Bert Blommers
d916fd636f
S3:list_object_versions() - Implement Delimiter + KeyMarker (#4413) 2021-10-14 18:13:40 +00:00
Bert Blommers
df1732c737
S3 - list_objects(MaxKeys=0) (#4411) 2021-10-14 09:49:50 +00:00
Bert Blommers
52df393b5a
S3 - Move ACL tests to dedicated file (#4397) 2021-10-12 17:50:36 +00:00
Bert Blommers
773e9a9f79
S3 - Allow for keyname that is just an empty space (#4244) 2021-10-09 10:12:26 +00:00
Bert Blommers
c3503081bc
S3: HeadBucket requests should be authenticated (#4346) 2021-09-25 17:25:27 +00:00
Bert Blommers
6dfb539a97
Rewrite deprecated S3 tests (#3889) 2021-09-21 20:06:42 +00:00
Bert Blommers
c53183db70
S3 - Correct error when creating a bucket that already exists (#4257) 2021-09-01 16:30:01 +01:00
Bert Blommers
dc49232734
S3 - HeadObject should authenticate requests (#4240) 2021-08-29 14:49:05 +01:00
Bert Blommers
532386327d
S3 - Add RequestId to responses (#3836) 2021-08-28 08:32:14 +01:00
Bert Blommers
0317c502f0
S3 ListParts API: use MaxParts parameter (#3658) 2021-08-28 07:38:16 +01:00
Bert Blommers
684cafa2b8
S3 - Allow uploads using a PUT request without content-type (#3699) 2021-08-28 06:10:16 +01:00
Bert Blommers
8d4596a366
Prep Release 2.2.4 (#4205)
* S3 - Refactor logic to models.py, out of Response-class

* Changelog for release 2.2.4
2021-08-21 15:05:40 +01:00
Łukasz
73368863eb
Added handling for V4 signatures in PutObject body (#4201)
Co-authored-by: Łukasz Nowak <lukasz.nowak@idemia.com>
2021-08-19 15:06:43 +01:00
Hasanul Islam
492484be20
Add missing default regiono in s3 client (#4194) 2021-08-18 20:25:33 +01:00
Cristopher Pinzón
1d90946072
Feature S3 Object Lock (#4174) 2021-08-17 06:16:59 +01:00
Bert Blommers
79f0cc9e9e
Tech debt - remove dead DynamoDB code and add RDS tests (#4136) 2021-08-04 17:24:26 +01:00
Bert Blommers
11883a1fda
Remove unnecessary dependencies EC2/SQS (#4094)
* Add missing dependencies for EFS
2021-07-29 06:38:16 +01:00
Waldemar Hummer
f4f8527955
Merge LocalStack changes into upstream moto (#4082)
* fix OPTIONS requests on non-existing API GW integrations

* add cloudformation models for API Gateway deployments

* bump version

* add backdoor to return CloudWatch metrics

* Updating implementation coverage

* Updating implementation coverage

* add cloudformation models for API Gateway deployments

* Updating implementation coverage

* Updating implementation coverage

* Implemented get-caller-identity returning real data depending on the access key used.

* bump version

* minor fixes

* fix Number data_type for SQS message attribute

* fix handling of encoding errors

* bump version

* make CF stack queryable before starting to initialize its resources

* bump version

* fix integration_method for API GW method integrations

* fix undefined status in CF FakeStack

* Fix apigateway issues with terraform v0.12.21
* resource_methods -> add handle for "DELETE" method
* integrations -> fix issue that "httpMethod" wasn't included in body request (this value was set as the value from refer method resource)

* bump version

* Fix setting http method for API gateway integrations (#6)

* bump version

* remove duplicate methods

* add storage class to S3 Key when completing multipart upload (#7)

* fix SQS performance issues; bump version

* add pagination to SecretsManager list-secrets (#9)

* fix default parameter groups in RDS

* fix adding S3 metadata headers with names containing dots (#13)

* Updating implementation coverage

* Updating implementation coverage

* add cloudformation models for API Gateway deployments

* Updating implementation coverage

* Updating implementation coverage

* Implemented get-caller-identity returning real data depending on the access key used.

* make CF stack queryable before starting to initialize its resources

* bump version

* remove duplicate methods

* fix adding S3 metadata headers with names containing dots (#13)

* Update amis.json to support EKS AMI mocks (#15)

* fix PascalCase for boolean value in ListMultipartUploads response (#17); fix _get_multi_param to parse nested list/dict query params

* determine non-zero container exit code in Batch API

* support filtering by dimensions in CW get_metric_statistics

* fix storing attributes for ELBv2 Route entities; API GW refactorings for TF tests

* add missing fields for API GW resources

* fix error messages for Route53 (TF-compat)

* various fixes for IAM resources (tf-compat)

* minor fixes for API GW models (tf-compat)

* minor fixes for API GW responses (tf-compat)

* add s3 exception for bucket notification filter rule validation

* change the way RESTErrors generate the response body and content-type header

* fix lint errors and disable "black" syntax enforcement

* remove return type hint in RESTError.get_body

* add RESTError XML template for IAM exceptions

* add support for API GW minimumCompressionSize

* fix casing getting PrivateDnsEnabled API GW attribute

* minor fixes for error responses

* fix escaping special chars for IAM role descriptions (tf-compat)

* minor fixes and tagging support for API GW and ELB v2 (tf-compat)

* Merge branch 'master' into localstack

* add "AlarmRule" attribute to enable support for composite CloudWatch metrics

* fix recursive parsing of complex/nested query params

* bump version

* add API to delete S3 website configurations (#18)

* use dict copy to allow parallelism and avoid concurrent modification exceptions in S3

* fix precondition check for etags in S3 (#19)

* minor fix for user filtering in Cognito

* fix API Gateway error response; avoid returning empty response templates (tf-compat)

* support tags and tracingEnabled attribute for API GW stages

* fix boolean value in S3 encryption response (#20)

* fix connection arn structure

* fix api destination arn structure

* black format

* release 2.0.3.37

* fix s3 exception tests

see botocore/parsers.py:1002 where RequestId is removed from parsed

* remove python 2 from build action

* add test failure annotations in build action

* fix events test arn comparisons

* fix s3 encryption response test

* return default value "0" if EC2 availableIpAddressCount is empty

* fix extracting SecurityGroupIds for EC2 VPC endpoints

* support deleting/updating API Gateway DomainNames

* fix(events): Return empty string instead of null when no pattern is specified in EventPattern (tf-compat) (#22)

* fix logic and revert CF changes to get tests running again (#21)

* add support for EC2 customer gateway API (#25)

* add support for EC2 Transit Gateway APIs (#24)

* feat(logs): add `kmsKeyId` into `LogGroup` entity (#23)

* minor change in ELBv2 logic to fix tests

* feat(events): add APIs to describe and delete CloudWatch Events connections (#26)

* add support for EC2 transit gateway route tables (#27)

* pass transit gateway route table ID in Describe API, minor refactoring (#29)

* add support for EC2 Transit Gateway Routes (#28)

* fix region on ACM certificate import (#31)

* add support for EC2 transit gateway attachments (#30)

* add support for EC2 Transit Gateway VPN attachments (#32)

* fix account ID for logs API

* add support for DeleteOrganization API

* feat(events): store raw filter representation for CloudWatch events patterns (tf-compat) (#36)

* feat(events): add support to describe/update/delete CloudWatch API destinations (#35)

* add Cognito UpdateIdentityPool, CW Logs PutResourcePolicy

* feat(events): add support for tags in EventBus API (#38)

* fix parameter validation for Batch compute environments (tf-compat)

* revert merge conflicts in IMPLEMENTATION_COVERAGE.md

* format code using black

* restore original README; re-enable and fix CloudFormation tests

* restore tests and old logic for CF stack parameters from SSM

* parameterize RequestId/RequestID in response messages and revert related test changes

* undo LocalStack-specific adaptations

* minor fix

* Update CodeCov config to reflect removal of Py2

* undo change related to CW metric filtering; add additional test for CW metric statistics with dimensions

* Terraform - Extend whitelist of running tests

Co-authored-by: acsbendi <acsbendi28@gmail.com>
Co-authored-by: Phan Duong <duongpv@outlook.com>
Co-authored-by: Thomas Rausch <thomas@thrau.at>
Co-authored-by: Macwan Nevil <macnev2013@gmail.com>
Co-authored-by: Dominik Schubert <dominik.schubert91@gmail.com>
Co-authored-by: Gonzalo Saad <saad.gonzalo.ale@gmail.com>
Co-authored-by: Mohit Alonja <monty16597@users.noreply.github.com>
Co-authored-by: Miguel Gagliardo <migag9@gmail.com>
Co-authored-by: Bert Blommers <info@bertblommers.nl>
2021-07-26 15:21:17 +01:00
Bert Blommers
7693d77333
Remove Py2 support (#3915) 2021-07-26 07:40:39 +01:00
benediktbrandt
eb6515cf50
Reduce default value for DEFAULT_KEY_BUFFER_SIZE (#4003)
* - introduce environment variable for DEFAULT_KEY_BUFFER_SIZE

* - prefix env variable with MOTO_S3 to avoid env variable conflicts

* - reduce the DEFAULT_KEY_BUFFER_SIZE to be less than the S3_UPLOAD_PART_MIN_SIZE to prevent in memory caching of multi part uploads

* - black formatting

* - fix formatting

* - fix missing import
2021-07-07 16:38:50 +01:00
Bert Blommers
a230e2a7e3
#3113 - S3#list_object_versions - verify prefix argument (#4041) 2021-06-28 16:22:08 +01:00
Bert Blommers
059c36b694
#3593 - S3 - Return appropriate error when provided with invalid multipart ID (#4040) 2021-06-28 15:57:07 +01:00
Bert Blommers
0f4ab4da1c
S3 - Dont error when deleting unknown keys (#4036)
* #1581 - S3 - Dont error when deleting unknown keys

* Update test_s3bucket_path.py
2021-06-25 10:26:03 +01:00
Bert Blommers
4778377e8e
#4018 - Raise NoSuchUpload when listing a non-existing multipart upload (#4031) 2021-06-24 08:14:28 +01:00
benediktbrandt
479ce861a7
Env variable for default key buffer size (#4001)
* - introduce environment variable for DEFAULT_KEY_BUFFER_SIZE

* - prefix env variable with MOTO_S3 to avoid env variable conflicts

* - black formatting

* - fix formatting
2021-06-10 10:48:28 +01:00
Mike Grima
ba7a0fe3a2 Fixed AWS Config S3 ACL issues
- AWS Config appears to have changed how ACLs are returned
- This PR makes moto's behavior consistent with AWS Config's S3 representation

Fixes #3986
2021-06-04 09:23:56 -07:00
Florian Dambrine
6adb570c48
Add dot as a valid s3 metadata key (#3958) 2021-05-26 14:27:25 +01:00
amar jandu
58381cce8f
S3 - Fix exception for missing versionID (#3887) 2021-04-30 12:36:08 +01:00
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
Mike Grima
0c191ac33b Raise errors on tagging buckets with aws:*
Cannot tag S3 buckets with reserved tag key space `aws:`
2020-03-30 17:27:06 -07:00
Bert Blommers
e9930b0cb2 S3 - test fix - Use plain text as content, instead of file 2020-03-10 13:30:38 +00:00
Bert Blommers
f17d5f8e4d #657 - S3 - Verify content type is set/returned as appropriate 2020-03-10 12:56:33 +00:00
Bert Blommers
47349b30df #2567 - When mocking URLs, always return the first match 2020-02-27 08:54:57 +00:00
Steve Pulec
11e64109eb Fix s3 test for location constraint. 2020-02-17 20:32:28 -06:00
Steve Pulec
6b6a059350
Merge pull request #2132 from Projectplace/tagging-directive
Support x-amz-tagging-directive in s3 copy_object
2020-02-17 20:00:30 -06:00
Mike Grima
11b7be0e85 Implemented S3 Account-level public access block.
- Also added AWS Config listing and fetching support
- Also fixed Lambda test breakage
2020-02-17 15:41:27 -08:00
Bert Blommers
ceb16b00a7 S3 LocationConstraint test can only be run in non-ServerMode 2020-02-02 12:45:57 +00:00
Bert Blommers
a86cba79de Add S3 LocationConstraint to Lambda tests 2020-02-02 11:48:32 +00:00
Bert Blommers
f74f08581a S3 - Add IllegalLocationConstraint validation when creating buckets 2020-02-02 10:36:51 +00:00
Asher Foa
d9d055c75d Fix more typos. 2020-01-23 10:15:02 -08:00
Waldemar Hummer
4ad111830b fix tests 2019-12-21 13:27:49 +01:00
Mike Grima
84ccdbd1cd Implemented S3 Public Access Block 2019-12-12 17:45:31 -08:00
Niklas Janlert
b51d5ad65f Support x-amz-tagging-directive in s3 copy_object 2019-11-23 00:38:26 +01:00
Asher Foa
96e5b1993d Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
Mike Grima
503bc333ca Small fix for S3-AWS Config compatibility
- Small bug in tags with AWS Config
- Aggregated results lack "tags" in the result set
- Buckets also add a supplementary configuration of
"BucketTaggingConfiguration"
2019-10-29 14:35:13 -07:00
Mike Grima
e9dc0c9a3a Fixed bugs in AWS Config Querying
- Fixed some log bugs in the Config querying APIs
- Fixed an issue with S3 ACLs when described from Config (it's actually
a double-wrapped JSON)
2019-10-23 22:32:45 -07:00
Mike Grima
57dc6522f2
Merge pull request #2505 from mikegrima/configFix
Fixed a bug with S3 bucket policies for AWS Config
2019-10-22 15:53:18 -07:00
Mike Grima
9273db7e61 Fixed a bug with S3 bucket policies for AWS Config 2019-10-22 15:01:39 -07:00
Mike Grima
1cde5d37eb
Merge pull request #2483 from thincal/fix/list-objects-with-truncation
s3 list_object: return the NextMarker info if it's truncated
2019-10-22 09:57:15 -07:00
LS
b3ea4c2707 add unit test for s3 list_object with truncation 2019-10-21 15:10:26 +08:00
Harrison Termotto
f788fd5c8c Remove erroneous comment 2019-10-17 00:17:45 -04:00
Harrison Termotto
df2de373b2 Add tagging to versioned s3 objects. 2019-10-17 00:16:16 -04:00
koshigoe
98f33740e1
fix(s3): check whether key is None or not to avoid exception.
```
AttributeError: 'NoneType' object has no attribute 'multipart'
```
2019-10-16 18:13:59 +09:00
Mike Grima
2a2c3e80f0 Adding support for querying the AWS Config resource for S3.
- Need to add support still for batch requests and batch aggregation requests in a future PR
2019-10-13 10:14:15 -07:00
Mike Grima
ab0853cddc Made fixes to the S3 Lifecycle mocks to be more consistent with the API. 2019-10-05 12:29:09 -07:00
Mike Grima
d925335f05
Merge pull request #2443 from mikegrima/configquery
Adding support for querying AWS Config
2019-10-03 13:38:43 -07:00
Mike Grima
c4b310d7a5 Adding support for querying AWS Config for supported configurations.
At this time, only adding support for S3.
2019-10-03 11:43:56 -07:00
Chih-Hsuan Yen
6c0a2dc374
Fix copying S3 objects with question marks in keys
PR #2062 fixes copy for unicode keys. However, the change breaks keys
with question marks. Here is an alternative fix that works for both
emojis and question marks.

I notice this when running the test suite of aiobotocore. One of the
tests [1] is broken with moto >= 1.3.8.

[1] https://github.com/aio-libs/aiobotocore/blob/0.10.3/tests/test_basic_s3.py#L314-L329
2019-09-29 23:55:52 +08:00
Jesse Vogt
3b4cd1c27b switch from calling clean in loop to undoing clean in delete_keys 2019-09-24 17:07:58 -05:00
Jesse Vogt
2df0309db5 unquote key name multiple times until stable value 2019-09-24 16:10:08 -05:00
Gapex
d8e69a9a36 list with prifix 2019-09-17 12:44:48 +08:00
Gapex
a466ef2d1b check key & common prefix in unit test' 2019-09-17 12:42:33 +08:00
Gapex
1c36e1e2c5 update unit test and fix StartAfter 2019-09-17 10:42:10 +08:00
Gapex
c04c72d435 update MaxKeys unite test 2019-09-16 18:09:42 +08:00
Gapex
84715e9a2a add truncate unite test 2019-09-16 16:46:19 +08:00
Łukasz Sznuk
e0304bc500 Allows leading // for mocked s3 paths (#1637). 2019-08-28 16:17:45 +02:00
Berislav Kovacki
b7884ef903 Add S3 support for INTELLIGENT_TIERING, GLACIER and DEEP_ARCHIVE storage
* Add INTELLIGENT_TIERING, GLACIER and DEEP_ARCHIVE as valid storage
classes for objects
* Add ObjectNotInActiveTierError error on PUT object copy for GLACIER
and DEEP_ARCHIVE storage class objects
2019-08-05 17:34:39 +02:00
Steve Pulec
5abe56fd2b
Merge pull request #2250 from szczeles/s3_delete_objects_boto3
Raising MalformedXML exception when using boto3 client and s3.delete_objects()
2019-07-23 22:41:45 -05:00
Mariusz Strzelecki
51d96ae8f3 Test split into boto and boto3 part 2019-07-23 20:53:45 +02:00
Ruslan Kuprieiev
615d427c6d tests: multipart: use REDUCED_PART_SIZE and variable part size
There is no reason to use 5M chunks, especially with the reduced_part_size
decorator. Also made part_size to be variable to add extra layer of
testing to make sure that moto is handling that scenario correctly.

Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
2019-07-20 16:26:24 +03:00
Ruslan Kuprieiev
2c2dff22bc moto: s3: support partNumber for head_object
To support it, we need to keep multipart info in the key itself when
completing multipart upload.

Fixes #2154

Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
2019-07-15 20:47:29 +03:00
Mariusz Strzelecki
f32db6e64a Raising MalformedXML exception when using boto3 client and s3.delete_objects() 2019-07-11 09:53:23 +02:00
Aden Khan
b2adbf1f48 Adding the functionality and test so that the If-Modified-Since header is honored in GET Object
Signed-off-by: Aden Khan <aakhan@sep.com>
2019-07-03 14:25:08 -04:00
Alexander Mohr
7271fb9391 Fix S3 backend operations with VersionId (#2055)
* fix s3 issues

* fix merge conflict

* fix and add test cases
2019-05-25 20:19:33 +01:00
Gregory Bataille
d952410965 1987 support transfer acceleration (#2018)
* chore(): remove executable flag on moto/s3/response.py

* chore(): ignore .eggs temp file

* feat(#1987): get bucket acceleration support

* feat(#1987): put bucket acceleration support

* feat(#1987): suspend undefined bucket is a no-op

* feat(#1987): validate accelerate_configuration status

* feat(#1987): bucket containing dots do not support acceleration

* doc(#1987): update implementation coverage
2019-05-25 11:19:00 +01:00
Yaroslav Admin
b85d21b8fe Fixed copy-object from unversioned bucket to versioned bucket
The response of the copy-object operation was missing VersionId property
when source bucket is not versioned.
2019-04-02 15:30:01 +02:00
Mike Grima
921b5a3227 Fixing broken tests #2126
- KMS
- S3
- CloudFormation (Thanks kgutwin!)
2019-03-28 10:09:03 -07:00
Gilbert Gilb's
dedb53371e [S3] Support null version ids for buckets with versioning disabled 2019-03-09 10:21:49 +01:00
Domenico Testa
6897a118ed Fixing S3 copy_key error when using unicode. 2019-02-16 16:42:00 +01:00
Steve Pulec
c2a1f4eb14 Fix S3 bucket location test. 2018-12-29 07:07:29 -05:00
Steve Pulec
97d9d46770
Merge pull request #1999 from dargueta/s3-spooling
Don't store S3 entirely in memory
2018-12-28 21:29:19 -05:00
Steve Pulec
dec665be43
Merge pull request #1986 from okomestudio/ts/fix-s3-common-prefix-pagination
Activate proper pagination for S3 common prefixes
2018-12-28 21:22:07 -05:00
Steve Pulec
e681f55ba1
Merge branch 'master' into bucket-name-length-limit 2018-12-28 21:04:10 -05:00
Steve Pulec
65364a8e71
Merge pull request #1961 from gbataille/fix_1959_location_constraint_us_east_1
Fix 1959 location constraint us east 1
2018-12-28 21:00:29 -05:00
Diego Argueta
1998d59cfc Add more tests to please Coveralls 2018-12-20 11:40:13 -08:00
Diego Argueta
191ad6d778 Make keys pickleable 2018-12-20 11:15:15 -08:00
Diego Argueta
2cc8784e5c Restore files modified in non-working fix. 2018-12-18 14:53:52 -08:00
Diego Argueta
b0a280bde2 Move S3 storage to SpooledTemporaryFile 2018-12-18 14:20:48 -08:00
Taro Sato
2038fa92be Activate proper pagination for S3 common prefixes 2018-12-05 16:17:28 -08:00
Jon Michaelchuck
009b02bcd5 Raise a client error if PutBucketTags request contains duplicate keys
A PutBucketTags request with duplicate keys will raise a ClientError
with code InvalidTag and message 'Cannot provide multiple Tags with the
same key'.
2018-11-26 15:56:46 -08:00
Jon Michaelchuck
fb7e52becc Check bucket name length at CreateBucket
Check that s3 bucket names follow the documented length restriction:

'Bucket names must be at least 3 and no more than 63 characters long.'

See https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html
2018-11-22 06:08:03 -06:00
Grégory Bataille
b0eb7b263e test(#1959): us-east-1 located bucket should return a None LocationConstraint 2018-11-20 19:42:51 +01:00
Grégory Bataille
9291ff533a test(#1959): LocationConstraint us-east-1 should be refused 2018-11-20 18:56:56 +01:00
Jon Beilke
12e0a38b56 add TODO for testing exceptions with aimu and nve 2018-10-05 11:04:55 -05:00
Jon Beilke
9b5f983cb5 add action validation to set_lifecycle() 2018-10-03 01:11:11 -05:00
Jon Beilke
ea4fcaa82a add support for NoncurrentVersionTransition, NoncurrentVersionExpiration, and AbortIncompleteMultipartUpload actions to s3 lifecycle rules 2018-10-03 00:40:28 -05:00
Jordan Upiter
756b5d6671 Add support for multiple delete markers on an s3 object 2018-09-11 10:41:01 -04:00
TheDooner64
e67a8c6f1b Revert minor changes to s3 tests 2018-08-05 19:18:11 -04:00
TheDooner64
77f0a61c9f Add scaffolding for Glue service, including create_database and get_database for the Glue Data Catalog 2018-08-05 19:18:11 -04:00
Steve Pulec
0309d1ec39
Merge pull request #1707 from Whamied/etag-no-quote-patch
Added support for multipart upload completion with unquoted etags
2018-07-19 10:05:07 -04:00
Waleed Hamied
f8fdd439ad Added support for multipart upload confirmation with unquoted etags 2018-07-03 15:36:41 -04:00
Sanjeev Suresh
2ebd5f7359 tests for prefixes that return empty result sets 2018-06-22 11:59:01 -07:00
Alec Rajeev
6c10dc0403 Fix Storage Class error handling (#1653)
Added check for valid storage classes in set_key and copy_key
added unit test for standard storage and infrequent access
2018-06-07 08:09:36 +01:00
Alexander Mohr
07540a35fe add unittest 2018-05-03 02:30:29 -07:00
Mike Grima
4184acc0d2 Added Filtering support for S3 lifecycle (#1535)
* Added Filtering support for S3 lifecycle

Also added `ExpiredObjectDeleteMarker`.

closes #1533
closes #1479

* Result set no longer contains "Prefix" if "Filter" is set.
2018-04-02 14:19:14 -07:00
Colin Jones
1a8a4a084d S3 Ignore Subdomain for Bucketname Flag (#1419)
* Some circumstances need subdomains to be ignored rather that interpreted as bucketname, this patch allows such behaviour to be configured

* Adding helper case whereby localstack features as path based exception

* Remove whitespace :(
2018-03-21 09:33:09 -07:00
Mike Grima
cc14114afe Implemented S3 get/put_notification_configuration (#1516)
closes #973
2018-03-21 09:11:24 -07:00
Steve Pulec
0414cc51c1
Merge pull request #1499 from srikiraju/fix/s3-list-deleted
S3: Do not attempt to return deleted files in bucket listing
2018-03-07 07:08:07 -05:00
Srikanth Raju
4f05aa725c S3: Do not attempt to return deleted files in bucket listing 2018-03-06 01:55:14 -08:00
Taro Sato
5e70d0ce4c Support both virtual-hosted-style and path-style URLs for region name parsing 2018-01-30 16:10:43 -08:00
Mike Grima
770281aef2 Added put_bucket_logging support (#1401)
- Also added put acl for XML
- Put logging will also verify that the destination bucket exists in the same region with the proper ACLs attached.
2018-01-02 20:47:57 -08:00
Terry Cain
d447929d29 utf 8 in key deletions V2 (#1321)
* supporting utf-8 in key deletions

* Fixed decoding of version body when regexing

* Fixed some more random errors

* Possible fix

* Fixed unused import

* Added UTF comment Py2
2017-11-06 13:39:08 -08:00
Brian Pandola
68a1e41286 Fix #1318 2017-11-02 23:03:54 -07:00
Terry Cain
b40c5e557e Fixed S3 versioning bug + minor cleanup (#1272)
* Fixed S3 versioning bug + minor cleanup

Fixes 1271

* flake8
2017-10-18 16:22:35 -07:00
Mike Grima
7167e09ca5 Fixed bug in S3 put_bucket_tagging. Closes #1181. 2017-09-22 13:35:00 -07:00
Jack Danger
eeda0cd28e re-enabling tests 2017-09-22 10:57:06 -07:00
Jack Danger
ea66a71765 supporting signed urls for private keys 2017-09-22 10:44:37 -07:00
Jack Danger
ca7661bc1e S3 keys inherit bucket ACL 2017-09-20 19:04:23 -07:00
Jack Danger
c8f6fb7738 Creating server-safe anonymous clients for testing 2017-09-16 15:48:20 -07:00
Jack Danger
e33702fbac using deprecated mock just to patch requests library 2017-09-16 12:49:07 -07:00
Jack Danger
802279d7c4 Authenticating to S3 in tests 2017-09-16 12:49:07 -07:00
Jack Danger
2055bb62f5 enforce s3 acls 2017-09-16 12:49:07 -07:00
Mike Grima
5d8cd22b01 Fixed S3 lifecycle error message. (#1110)
Fixes #1109
Also added PutBucketTagging support
Also added Bucket CORS support
2017-09-07 11:30:05 -07:00
Alexander Mohr
2447725e98 fix list-object-versions with prefix (#1045)
fix list-object-versions with prefix
2017-08-10 17:14:31 -07:00
Waldemar Hummer
24d1562d2f allow non-ascii characters in request URLs 2017-08-05 21:03:50 +10:00
Jack Danger
3eef3c23b1 Updating examples in README to latest API 2017-07-26 22:57:55 -07:00
Taro Sato
38fa6809c0 Make HEAD bucket throw ClientError instead of NoSuchBucket on boto3 2017-07-20 15:39:45 -07:00
eric-weaver
abf3078c28 implement s3 object tagging 2017-07-15 22:36:12 -04:00
Steve Pulec
a956c3a85c Fix tests for py3. 2017-06-03 19:35:23 -04:00
Steve Pulec
113bfcb4ea Fix duplicate bucket creation with LocationConstraint. Closes #970. 2017-06-03 19:29:59 -04:00
Steve Pulec
49c947ece7 Stop autodecoding content so we can mimic requests. Closes #963. 2017-06-03 19:06:55 -04:00
Jack Danger
6163363c15 Merge pull request #960 from spg/feat-s3-if-modified-since
feat(s3) HeadObject: honor If-Modified-Since header
2017-06-01 09:10:20 -07:00
Simon-Pierre Gingras
a2a6514936 attempt at fixing tests 2017-05-23 11:29:01 -07:00
Kate Heddleston
a21413f4ea NoSuchKey error in S3 is actually '404'
Fixes #571 and #953
2017-05-22 19:08:12 -07:00
Simon-Pierre Gingras
517416c4d9 feat(s3) HeadObject: honor If-Modified-Since header 2017-05-19 15:59:25 -07:00
georgepsarakis
ac8b8c9a36 Add tests for DeleteMarker support 2017-05-14 20:00:26 +03:00
Steve Pulec
152d71e4f3 Merge pull request #922 from georgepsarakis/bug/s3_list_versions_valueerror
ValueError when calling boto3 list_object_versions
2017-05-10 22:06:26 -04:00
Steve Pulec
ff4649eebd Merge pull request #924 from JackDanger/require-content-length-header
Require content-length header
2017-05-10 22:02:21 -04:00
Jack Danger Canty
a2fd72d2f8 Require content-length header
fixes #908
2017-05-01 12:13:12 -07:00
georgepsarakis
2714fb76f1 Python 2/3 compatibility fixes 2017-04-30 08:03:46 +03:00
georgepsarakis
819a308e2b Add failing test for S3 list_object_versions 2017-04-29 21:56:48 +03:00
Hugo Picado
0945765537
Fixing metadata key on s3 operation response
ETag metadata key is being returned as "Etag" instead of "ETag". This leads to issues in some AWS SDKs using MotoServer. This change fixes the issue by updating the key to the correct format.

This closes #920
2017-04-27 13:57:18 +01:00
Dmytro Milinevskyy
6e61ee4caa s3: handle WebsiteRedirectLocation
spulec/moto#821
2017-04-14 13:32:52 +02:00
Steve Pulec
3c0c4c2996 Fix tests for py3. 2017-02-23 22:28:09 -05:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00
Steve Pulec
1433f28846 Update s3 test. 2017-02-23 19:50:34 -05:00
Steve Pulec
81836b6981 Get standalone server mode working for all tests. 2017-02-23 19:43:48 -05:00
Steve Pulec
fde721bed7 Testing new version of decorator. 2017-02-15 22:35:45 -05:00