Before this commit, V2 listing parameters ('start-after',
'continuation-token' and 'fetch-owner') were just ignored, making some
S3 clients return errors, or handle paging badly.
V2 listing is selected by passing 'list-type=2' in query string.
'marker' is replaced by either 'start-after' or 'continuation-token'.
This commit wraps 'start-after' and 'continuation-token' in 'marker',
which is passed to swift. 'NextContinuationToken' is a base64 encoding
of the last returned object, so it is opaque to the client.
Change-Id: I23bf83cb8bbaf4c4935bf6b56791051c032c688c
Fix root tag of response body for Upload Part Copy requests.
Correct body is following.
<?xml version="1.0" encoding="UTF-8"?>
<CopyPartResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<LastModified>2015-01-16T07:42:41.000Z</LastModified>
<ETag>"dd0591c4f082a4b1b57ea779a1566a28"</ETag>
</CopyPartResult>
Change-Id: I69801c50670c576485a9f0f5c12e578c1c433374
This patch adds support for XML validation with RelaxNG. The original S3
schema is available at http://doc.s3.amazonaws.com/2006-03-01/AmazonS3.xsd, but
I write a schema for swift3 from scratch. It is because:
- The original schema does not support all of the latest S3 API. Even if we
use it, we have to update and maintain it in either way.
- The original schema is written with XML Schema, but the language is not
enough to describe some of the latest S3 API. For example, the Multi-Object
Delete operation sends an XML document, which can interleave a Quiet element
with Object elements. XML Schema cannot define such kinds of XML documents.
This patch includes both RelaxNG (rng) and RelaxNG compact syntax files (rnc)
for validation. What I wrote are only rnc files, and rng files are
automatically generated from rnc with trang, the most well-known schema
converter. If possible, I'd like to use only rnc schemas since rng files are
complicated and not so human-readable. However, lxml doesn't support RelaxNG
compact syntax currently, unfortunately. After lxml supports compact syntax,
let's remove all of the rng files.
This patch also fixes some XML errors detected by RelaxNG validator, and some
helper methods to convert strings between camel-case name and snake-case name.
Change-Id: I4513345a6b981efc5d5f5e8cf528aba84ac1bdad