swift/test/functional
Tim Burke 84b85f03b4 s3api: Include '-' in multipart ETags
Multipart uploads in AWS (seem to) have ETags like:

   '"' + MD5_hex(MD5(part1) + ... + MD5(partN)) + '-' + N + '"'

On the other hand, Swift SLOs have Etags like:

   MD5_hex(MD5_hex(part1) + ... + MD5_hex(partN))

(In both examples, MD5 gets the raw 16-byte digest while MD5_hex
gets the 32-byte hex-encoded digest.)

Some clients (such as aws-sdk-java) use the presence of a dash
to decide whether to perform client-side validation of downloads.

Other clients (like s3cmd) use the presence of a dash *in bucket
listings* to decide whether or not to perform additional HEAD requests
to look for MD5 metadata that can be used to compare against the MD5s
of local files.

Now we include a dash as well, to prevent spurious errors like

> Unable to verify integrity of data download.  Client calculated
> content hash didn't match hash calculated by Amazon S3.  The data
> may be corrupt.

or unnecessary uploads/downloads because the client assumes data has
changed that hasn't.

For new multipart-uploads via the S3 API, the ETag that is stored will
be calculated in the same way that AWS uses. This ETag will be used in
GET/HEAD responses, bucket listings, and conditional requests via the S3
API. Accessing the same object via the Swift API will use the SLO Etag;
however, in JSON container listings the multipart upload etag will be
exposed in a new "s3_etag" key.

New SLOs and pre-existing multipart-uploads will continue to behave as
before; there is no data migration or mitigation as part of this patch.

Change-Id: Ibe68c44bef6c17605863e9084503e8f5dc577fab
Closes-Bug: 1522578
2018-09-13 19:28:59 +09:00
..
s3api s3api: Include '-' in multipart ETags 2018-09-13 19:28:59 +09:00
__init__.py Allow domain remap storage_domain to be configured for func tests 2018-06-07 11:59:08 +01:00
mock_swift_key_manager.py Retrieve encryption root secret from Barbican 2017-08-02 15:53:09 +03:00
swift_test_client.py Include SLO ETag in container updates 2018-07-10 15:41:29 -07:00
test_access_control.py No longer import nose 2017-11-07 15:39:25 +11:00
test_account.py fix SkipTest imports in functests so they can be run directly by nose 2017-12-18 09:33:40 -08:00
test_container.py functests: Clean up objects better 2018-06-04 17:54:58 -07:00
test_dlo.py dlo: Move conn2 business to the one test that uses it 2017-11-22 16:51:06 -08:00
test_domain_remap.py func tests: Rename storage_url to storage_path 2018-06-15 10:32:05 -07:00
test_object.py functests: Clean up objects better 2018-06-04 17:54:58 -07:00
test_slo.py Include SLO ETag in container updates 2018-07-10 15:41:29 -07:00
test_staticweb.py Tighten up staticweb redirect test 2018-06-15 10:32:05 -07:00
test_symlink.py Include SLO ETag in container updates 2018-07-10 15:41:29 -07:00
test_tempurl.py Remove some unnecessary SkipTests 2018-07-25 16:15:38 -07:00
test_versioned_writes.py Clarify that archive location headers should be URL-encoded 2018-05-24 13:03:35 -07:00
tests.py func tests: Rename storage_url to storage_path 2018-06-15 10:32:05 -07:00