Commit Graph

363 Commits

Author SHA1 Message Date
Dmytro Milinevskyy
6e61ee4caa s3: handle WebsiteRedirectLocation
spulec/moto#821
2017-04-14 13:32:52 +02:00
Waldemar Hummer
b8a41c5605 fix domain handling for local domain names in S3 API 2017-04-08 15:28:51 +10:00
Steve Pulec
446843e756 Fix py3 s3 prefix decoding. 2017-03-15 23:13:09 -04:00
Steve Pulec
3899eee648 Fix S3 filtering by unicode prefix. Closes #838 2017-03-15 22:53:27 -04:00
Steve Pulec
5f3fbff627 Standardize on one account id (123456789012). 2017-03-15 22:21:04 -04:00
Steve Pulec
6d422d1f37 Add BaseModel to all models. 2017-03-11 23:41:12 -05:00
Steve Pulec
3b4ef2cf15 Merge in master. 2017-03-05 09:58:39 -05:00
Matt Chamberlin
0393c384ad fix etag metadata field name in key response dict (etag --> ETag) (#855) 2017-03-04 23:17:18 -05:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00
Steve Pulec
81836b6981 Get standalone server mode working for all tests. 2017-02-23 19:43:48 -05:00
Steve Pulec
cad185c74d Cleanup headers and encoding. 2017-02-16 22:51:04 -05:00
Steve Pulec
fde721bed7 Testing new version of decorator. 2017-02-15 22:35:45 -05:00
Stefan Nordhausen
1a01bae74e Implement list_objects_v2() for S3 buckets (#814)
This adds/fixes the following things:
- Add missing KeyCount in result (fixes #734).
- Do not hard code MaxKeys to 1000.
- Truncate result if it has more than MaxKeys items. Set IsTruncated
    and NextContinuationToken accordingly.
- Support the StartAfter parameter.
- Return Owner information only when FetchOwner=True is given.
- "Prefix" in response is now "" instead of None when omitted in request.
- "Delimiter" is now omitted from response when not given in request.
2017-02-08 21:21:43 -05:00
Steve Pulec
2c6a967f45 Disable strict_slashes for Flask so that S3 works in server mode. 2016-12-03 18:59:28 -05:00
mfranke
5dc8e59fab Fix s3bucket_path (#784)
* check HTTP header for IPv4 or IPv6 addresses and default to path based S3

* improved IPv4 and IPv6 checking with optional ports

* typo

* subdomain bucket creation with trailing '/' did not work

* Use regex for Host field check to determine IPv4/IPv6

* add testcases for trailing slash, IPv4 and IPv6
2016-12-03 18:15:24 -05:00
Tom V
c54985a39f Fix for #748. Turn on autoescape for S3 templates. (#779) 2016-12-03 18:13:24 -05:00
Steve Pulec
136f6d67fb Add S3 ACL for aws-exec-read. Closes #740. 2016-11-23 19:42:36 -06:00
mfranke
040c2cd8cc Fix s3bucketpath handling for IP based requests (#765)
* check HTTP header for IPv4 or IPv6 addresses and default to path based S3

* improved IPv4 and IPv6 checking with optional ports

* typo
2016-11-23 19:05:34 -06:00
Taro Sato
bdb9d59e46 Update response headers with response_dict from key; add tests 2016-09-20 15:42:21 -07:00
imran
478e791c39 Fix unicode S3 key listing in Python 2 2016-09-04 04:31:03 +06:00
Declan Shanaghy
1441087e5c Add S3 parsing for CloudFormation 2016-08-15 10:57:40 -07:00
Jesse Szwedko
ef10df0636 Update format of S3 client errors
To match
http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses
which documents that it should be at the top level rather than nested
under `Errors`.
2016-07-08 19:32:34 +00:00
George Leslie-Waksman
48c57384c5 Return headers and response matching AWS specification for copy_from requests. 2016-06-13 13:24:09 -07:00
Steve Pulec
bd7327fca2 Fix issues around S3 deletion. Closes #606. 2016-05-08 17:14:35 -04:00
Steve Pulec
79addb8926 Add S3 functionality to copy range. Closes #526. 2016-05-05 22:52:12 -04:00
Steve Pulec
0a10b2f738 Fix issues with unicode and slashes for S3. Closes #521. 2016-05-01 22:03:52 -04:00
Steve Pulec
15dc619fb2 More liberal regrex for S3 region matching. Closes #580. 2016-05-01 21:17:06 -04:00
Steve Pulec
b932343fec Break out MissingKey as separate exception. Closes #571. 2016-05-01 17:04:09 -04:00
Dan Felix
1988c957e0 Pass query to _key_response_head for versioning support. 2016-04-28 13:16:25 -07:00
George Leslie-Waksman
0ed7d1bb71 Add support for src_version_id to bucket copy_key op. 2016-04-27 17:08:44 -07:00
Steve Pulec
31dbe61233 Fix s3 url regex. Closes #516. 2016-01-24 17:15:21 -05:00
Steve Pulec
a7938ed9ec Fix s3 url regex to ensure path-based bucket and key does not catch. 2016-01-24 16:33:50 -05:00
Daniel Miller
35a89da273 Fix delete keys with werkzeug request 2016-01-22 12:44:57 -05:00
Daniel Miller
89d5c72d86 Fix delete keys detection with werkzeug request 2016-01-22 12:44:12 -05:00
Steve Pulec
075d008509 Change s3 urls to ordereddict to fix python3 issues. 2016-01-17 17:19:53 -05:00
Steve Pulec
0df03ba409 cleanup code. 2015-11-27 14:43:03 -05:00
Steve Pulec
1df454a632 first working version of s3 refactor. 2015-11-27 14:14:59 -05:00
Steve Pulec
c38731ecbb Add ACL support for S3 buckets. 2015-11-11 20:26:29 -05:00
Steve Pulec
18d63a6cfe Add basics of S# website configuration. Closes #442. 2015-11-04 18:55:41 -05:00
Steve Pulec
d3e4c2c4b5 Add ability for specific backends to enable template escaping. Closes #441. 2015-11-03 09:25:47 -05:00
Mike Kaplinskiy
131d44f0ad Add S3 ACL supprt. 2015-10-07 00:14:37 -07:00
zeb
b59a77d5bb Tweak bucket.delete_keys for s3bucket_path. 2015-09-04 19:02:26 +02:00
Steve Pulec
323f720cb5 Fix S3 bucket policy delete. Closes #396. 2015-08-07 22:43:24 -04:00
Simon-Pierre Gingras
dc0557205d S3: Bucket policy 2015-07-23 17:33:52 -04:00
MurphyMarkW
b82d0264dc Fixes suffix range requests to truncate ranges. 2015-06-30 02:04:30 -05:00
MurphyMarkW
723b743381 Modifies check for last-byte-pos. 2015-06-30 00:26:42 -05:00
MurphyMarkW
2cdab4cab9 Fixes last-byte-pos interpretation. 2015-06-29 20:25:22 -05:00
Steve Pulec
5ee1525cd8 Fix S3 missing key error. Closes #364. 2015-06-27 17:56:37 -04:00
Daniel O'Connell
5cc8f9ed21 S3_BUCKET_VERSIONING and S3_BUCKET_GET_VERSIONING were generating invalid XML, as the '<?xml version="1.0" encoding="UTF-8"?>' bit must be on the first line. 2015-06-12 08:56:14 +02:00
Steve Pulec
91fffbb83b Add basics for S3 bucket lifecycles. 2015-06-02 23:11:23 -04:00
Steve Pulec
07dd6e554e [S3]Only add multipart part_id to partlist if it is not already in there. Closes #324. 2015-03-05 19:32:02 -05:00
John Lynn
0496d4669e Fix bucket versioning when running under moto_server 2015-02-22 22:22:41 +07:00
Steve Pulec
53a6d2466b Merge pull request #298 from kouk/ranged_get
support ranged get in S3
2015-02-14 08:35:23 -05:00
Konstantinos Koukopoulos
e1163e5223 fix some boundary conditions 2015-02-10 19:43:24 +02:00
Konstantinos Koukopoulos
261328d449 set content-range header so boto knows this is a ranged response 2015-02-10 19:15:10 +02:00
Konstantinos Koukopoulos
418a6a118e return proper status codes in range get, fix suffix range 2015-02-10 19:14:47 +02:00
Konstantinos Koukopoulos
9efd12c43c support more range specifiers in ranged gets 2015-02-10 17:55:44 +02:00
Konstantinos Koukopoulos
dbf1e64d44 support ranged get in S3 2015-02-10 17:28:18 +02:00
Konstantinos Koukopoulos
2dd174b577 use request body in complete upload, improve exception handling 2015-02-10 16:56:56 +02:00
Konstantinos Koukopoulos
7250186c26 support multipart uploads when parts are uploaded out of order 2015-02-10 16:45:31 +02:00
Konstantinos Koukopoulos
1460a5a3c7 refactor S3 exceptions to inherit from RESTError 2015-02-10 15:33:18 +02:00
Steve Pulec
06476ccb3a Merge pull request #291 from jbalogh/delimiter
Folder results should include the delimiter.
2015-01-29 22:49:09 -05:00
Jeff Balogh
c7bf6ffc91 Folder results should include the delimiter. 2015-01-29 09:20:40 -08:00
Josh Palmer
7e3516f997 Added support for listing multipart uploads with prefix. 2015-01-29 17:24:23 +01:00
dreadpirateshawn
aff5dd408c Performance: Leverage jinja2's Environment to cache compiled Templates. (fixed merge) 2014-12-12 13:05:46 -08:00
dreadpirateshawn
7ce83082ca Merge remote-tracking branch 'origin/master' into ImproveTemplatePerformance
Conflicts:
	moto/s3/responses.py
2014-12-12 12:51:29 -08:00
dreadpirateshawn
9affa7753d Performance: Leverage jinja2's Environment to cache compiled Templates. 2014-12-12 12:46:07 -08:00
Steve Pulec
4ab3b318eb Add S3 location response. Closes #279. 2014-12-10 20:44:00 -05:00
Steve Pulec
a2e56afef8 Add special S3 bucket create logic for us-east-1. Closes #273. 2014-12-10 20:20:51 -05:00
Steve Pulec
3a82f089a2 Cleanup metadata setting and add fix for multipart uploads. Closes #274. 2014-12-07 12:43:14 -05:00
Steve Pulec
1a015d0e39 Cleanup some incorrect date formats. 2014-11-29 23:34:40 -05:00
Steve Pulec
e88e3d5372 S3 Fixes for special metadata headers. 2014-11-27 10:43:10 -05:00
Steve Pulec
9024066957 Fixes for some S3 Unicode issues. Closes #158. 2014-11-22 10:19:56 -05:00
Steve Pulec
8d6868f9d3 For S3 Key Head requests, just return the real body for now so that key length works. Closes #131. 2014-11-19 21:06:23 -05:00
Steve Pulec
8bc8f09b47 Some flake8 cleanup. 2014-11-15 09:35:52 -05:00
Joseph Lawson
20a69255c3 tweak Fn::GetAtt to return resource_json if resource is not implemented. DRY
This is better than failing out with a misleading Boto 400 error which should only happen when get_cfn_attribute is called but fails.
2014-10-21 14:51:26 -04:00
Joseph Lawson
1d9ffafaa5 create CloudFormation outputs and enable 'Fn::GetAtt' to work. 2014-10-21 12:45:03 -04:00
Cory Lorenz
5320b39912 Make S3 Model Timestamps Consistent By Using UTC
UTC seems to be default timezone for AWS, and the time strings are reporting as GMT, yet the date time is the local time zone.
2014-09-12 15:37:22 -07:00
Konstantinos Koukopoulos
0502427ac1 treat request.headers as a more general list of dicts 2014-09-10 17:37:20 +03:00
David Baumgold
eedb4c4b73 Support Python 3 using six 2014-08-28 10:57:43 -04:00
David Baumgold
4201e6b430 from __future__ import unicode_literals 2014-08-27 11:33:55 -04:00
Steve Pulec
64ed605c14 Ignore S3 ACL for now since we do not implement it. 2014-08-13 22:13:23 -04:00
Steve Pulec
5e35348c0d Cleanup S3 model methods to better deal with missing buckets. 2014-07-08 21:20:29 -04:00
Steve Pulec
be25a2ba99 Fix S3 to work with other regions. 2014-07-08 20:35:48 -04:00
Richard Eames
4cc45c3ac5 Implementation of bucket.list_versions 2014-06-27 16:21:32 -06:00
Richard Eames
e972000bb4 Keep track of previous versions of keys 2014-06-27 15:37:51 -06:00
Richard Eames
5409d99ca2 Added basic implementation of key/bucket versioning 2014-06-27 11:34:00 -06:00
Gabe Rives-Corbett
9f912e7a1f Implemeted bucket.delete_keys closes #124 2014-05-06 17:21:33 -04:00
Konstantinos Koukopoulos
d4602b9cae support listing all multipart uploads 2014-04-02 19:09:48 +03:00
Konstantinos Koukopoulos
9954612035 add format field numbers for python 2.6 support 2014-04-02 16:34:29 +03:00
Konstantinos Koukopoulos
84ec801a52 refactor etag calculation to support a correct multipart key etag 2014-04-02 14:40:04 +03:00
Steve Pulec
1767d17018 Cleanup S3 a bit and add more coverage 2014-03-30 11:50:36 -04:00
Steve Pulec
069c48b43a Merge pull request #115 from kouk/s3restore
RRD and restore support
2014-03-27 08:40:18 -04:00
Konstantinos Koukopoulos
11938dae7a fix restore header formatting 2014-03-27 10:00:50 +02:00
Konstantinos Koukopoulos
8ada1d7829 support restore operation on s3 keys 2014-03-26 19:15:08 +02:00
Konstantinos Koukopoulos
c9d5dffa24 support reduced redundancy storage 2014-03-26 17:52:31 +02:00
Konstantinos Koukopoulos
1f49148a64 when copying keys create new objects using deepcopy 2014-03-26 17:41:07 +02:00
Konstantinos Koukopoulos
2ba64e1322 support replacing key metadata when copying 2014-03-26 16:02:14 +02:00
Joe Rickerby
73602958ed Fix bug with POST uploads returning 400 client error 2014-03-26 13:53:14 +00:00
Konstantinos Koukopoulos
c68a1d3e9d support x-amz-copy-source in multipart uploads 2014-03-21 17:33:51 +02:00
Steve Pulec
60cd79c6e2 S3 Mock should return an HTTP 409 if trying to create a bucket that
already exists. Closes #94.
2014-03-16 21:25:54 -04:00
Gilles Dartiguelongue
49ecfad6b1 Implement HEAD method due to changes in boto 2.25, closes: #91 2014-02-10 12:18:12 +01:00
Steve Pulec
403250e919 Fix S3 URL Regex to allow slashes in key names. 2014-02-06 20:47:56 -05:00
Konstantinos Koukopoulos
3846c46990 replace literal ints with constants 2013-11-15 11:53:39 +02:00
Konstantinos Koukopoulos
bdf5a9e26b convert to bytes for python 2.6 2013-11-14 17:47:03 +02:00
Konstantinos Koukopoulos
3628e40f3c Merge remote-tracking branch 'spulec/master'
Conflicts:
	moto/s3/responses.py
2013-11-14 17:17:35 +02:00
Jeff Gregory
df3155c869 when getting a key (HEAD request) return key.value instead of empty string. This is will mirror boto's method. 2013-11-08 15:36:39 -05:00
Brock Pytlik
5a475881d2 support bucket names in url paths in s3bucket_path 2013-11-08 15:36:38 -05:00
Mike Attili
d9862aaa65 Correct size check on multipart uploads. All parts except last must be > 5MB 2013-11-07 17:09:53 -05:00
Jeff Gregory
c75a233f6c when getting a key (HEAD request) return key.value instead of empty string. This is will mirror boto's method. 2013-10-25 14:36:49 -07:00
Steve Pulec
d8ca75deaa Merge pull request #48 from spulec/py26
Now supporting Python 2.6 as long as we're using the very latest HTTPretty
2013-10-03 17:43:37 -07:00
Steve Pulec
3bddbb4af3 Test out py26 with new HTTPretty 2013-10-03 20:34:13 -04:00
Konstantinos Koukopoulos
b1d59c7e17 support cancelling of multipart upload 2013-09-30 18:36:25 +03:00
Konstantinos Koukopoulos
e49006c723 remove pdb 2013-09-30 16:36:51 +03:00
Konstantinos Koukopoulos
8f47355493 remove plus from id (for real this time) 2013-09-30 14:50:23 +03:00
Konstantinos Koukopoulos
4539012db6 throw proper error if multipart upload is too small 2013-09-30 14:35:24 +03:00
Konstantinos Koukopoulos
aead9bb0d5 Complete MultiPart Operation does specify a body 2013-09-30 14:34:56 +03:00
Konstantinos Koukopoulos
3630b3c21a remove plus sign from id because it doesn't get parsed correctly in query string 2013-09-30 12:10:35 +03:00
Konstantinos Koukopoulos
04789a59fa don't forget to send the etag in the headers when uploading a part 2013-09-30 12:10:05 +03:00
Konstantinos Koukopoulos
9746e72e1d implement list parts 2013-09-30 12:09:35 +03:00
Konstantinos Koukopoulos
24ff30f9fc multipart_id doesn't exist, it's upload_id 2013-09-30 11:51:18 +03:00
Konstantinos Koukopoulos
0b45622dcb render part upload response correctly 2013-09-30 11:50:41 +03:00
Konstantinos Koukopoulos
f25caa872d Merge branch 'master' of github.com:spulec/moto
Conflicts:
	moto/s3/models.py
	moto/s3/responses.py
2013-09-30 11:02:25 +03:00
Ryan Permeh
e951a7f2d7 push fixed value 2013-09-27 11:00:40 -07:00
Ryan Permeh
a5ecf26f5a updated to fix split issue with paths with slashes 2013-09-27 10:47:32 -07:00
Sylvain Fraïssé
0fd4a5a6f8 Updates a test to show the ltrip use problem 2013-09-24 00:00:52 +02:00
Sylvain Fraïssé
596b435e57 Fix the 'www.' strip changing the lstrip method by the replace 2013-09-23 23:34:33 +02:00
Steve Pulec
b8957e0c6e Stop using deprecated md5, switch to hashlib. Closes #36 2013-07-08 12:46:36 -04:00
Steve Pulec
212d9c7abe core sts endpoints completed 2013-05-24 17:22:34 -04:00
Steve Pulec
3bc975188f more s3 tests for posting 2013-05-17 19:41:39 -04:00
Dan Berglund
7de4399b93 Added tests and made current tests pass 2013-05-17 11:43:09 +02:00
Dan Berglund
d8e9301c54 Added metadata to HEAD-response, boto uses this when only metadata is fetched 2013-05-17 09:59:05 +02:00
Dan Berglund
3880be5ea9 Added support for metadata on files, and support for POST:ing files to S3 2013-05-17 09:59:04 +02:00
Steve Pulec
4c8244b755 Clean up code for listing s3 keys. Fix #14. 2013-05-07 00:03:05 -04:00
Steve Pulec
caf73557cd Fix issue with large S3 values. Closes #11. 2013-05-06 23:33:59 -04:00
Steve Pulec
4345077173 coverage back at 100% 2013-05-03 20:14:33 -04:00
Steve Pulec
47bd4c49a3 attempting to move to upstream httpretty 2013-05-03 19:33:13 -04:00
Steve Pulec
be26daaff4 Fix S3 bucket list objects order and delimiters. Closes #14. 2013-04-13 19:23:32 -04:00
Steve Pulec
98d7a50790 Unquote s3 key names. Closes #13. 2013-04-13 19:00:37 -04:00
Steve Pulec
d96769a91c Fix for buckets with periods in them. Closes #15. 2013-04-13 17:28:00 -04:00
Steve Pulec
b7c46ae7bf fix S3 last_modified. Closes #8 2013-03-29 17:45:33 -04:00
Lucian Branescu Mihaila
5854219a4c Upload part and complete upload. Somehow, boto doesn't like output I send it, even though it's copy-pasted from its own logs. 2013-03-26 15:50:18 +00:00
Lucian Branescu Mihaila
f557487e06 Beginning of multipart upload support. 2013-03-26 14:52:33 +00:00
Steve Pulec
e64c73efed Allow writing empty body to s3 key if content-length is zero. Better fix for #6. 2013-03-26 10:11:16 -04:00
Steve Pulec
756955b61e Temporary fix to allow for writing empty strings to s3 keys. Closes #6. 2013-03-26 09:02:04 -04:00
Steve Pulec
e55f26a07a S3 should allow dashes in bucket names. Closes #5. 2013-03-23 09:57:20 -04:00
Steve Pulec
cd518d060e move to httpretty fork instead of bundling it. 2013-03-17 18:13:21 -04:00
Steve Pulec
2d98a9caef some more tests to bump coverage 2013-03-11 00:12:22 -04:00
Steve Pulec
a728b2581a Adding server mode 2013-03-05 08:14:43 -05:00
Steve Pulec
b0d89bb7b7 fix s3 key list and missing key response 2013-02-27 01:12:11 -05:00
Steve Pulec
91b61c7be5 another s3 http fix 2013-02-26 15:15:20 -05:00
Steve Pulec
3542f4ec30 make s3 handle http 2013-02-26 15:12:38 -05:00
Steve Pulec
d32059f301 pep8 2013-02-26 00:31:01 -05:00
Steve Pulec
757c45c659 replace pdbs with NotImplemented 2013-02-25 23:21:49 -05:00
Steve Pulec
89364ed864 Adding sqs queue creation 2013-02-23 22:26:46 -05:00
Steve Pulec
4fa9cac7d6 add s3 copy_key 2013-02-19 23:29:46 -05:00
Steve Pulec
3a9c757e46 add instance stop/start 2013-02-18 21:56:22 -05:00
Steve Pulec
4283cca63c clean up urls. start to clean up responses 2013-02-18 21:22:03 -05:00
Steve Pulec
ba360daa0f add get_all_buckets 2013-02-18 17:31:15 -05:00
Steve Pulec
28a46a5a3a add more s3 functions 2013-02-18 17:17:19 -05:00
Steve Pulec
f8633cbab7 rename backends 2013-02-18 16:31:42 -05:00
Steve Pulec
d1bb638ec7 remove .pyc 2013-02-18 16:28:08 -05:00
Steve Pulec
77d6df6531 basic ec2 and s3 working 2013-02-18 16:09:40 -05:00