Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choose proper XML label for structured payload #196

Closed
wants to merge 1 commit into from
Closed

Choose proper XML label for structured payload #196

wants to merge 1 commit into from

Conversation

takumn
Copy link
Contributor

@takumn takumn commented Dec 24, 2013

Some XML payloads built for requesting REST API are not compatible with syntax.

Sample request from aws-cli:

aws s3api put-object-acl --bucket some-bucket-name --key some-key --access-control-policy '
{
    "Grants": [
        {
            "Grantee": {
                "ID": "3423e6294e24539a765a1430979cc6c619499eeb75ff49a134c851a87998ec28d569965bfbc868db0720ee92ce0cb01b",
                "Type": "CanonicalUser"
            }, 
            "Permission": "READ"
        }
    ],
    "Owner": {
        "ID": "1a4fa782449409d942e59e1082d3140d67df45d5eb4fffe68e7734519c30c202"
    }
}'

The following XML payload is expected for this request:
http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTacl.html#RESTObjectPUTacl-requests

<AccessControlPolicy>
  <AccessControlList>
    <Grant>
      <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
        <ID>3423e6294e24539a765a1430979cc6c619499eeb75ff49a134c851a87998ec28d569965bfbc868db0720ee92ce0cb01b</ID>
      </Grantee>
      <Permission>READ</Permission>
    </Grant>
  </AccessControlList>
  <Owner>
    <ID>1a4fa782449409d942e59e1082d3140d67df45d5eb4fffe68e7734519c30c202</ID>
  </Owner>
</AccessControlPolicy>

but given:

<AccessControlPolicy>
  <Grants>
    <AccessControlList>
      <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
        <ID>3423e6294e24539a765a1430979cc6c619499eeb75ff49a134c851a87998ec28d569965bfbc868db0720ee92ce0cb01b</ID>
      </Grantee>
      <Permission>READ</Permission>
    </AccessControlList>
  </Grants>
  <Owner>
    <ID>1a4fa782449409d942e59e1082d3140d67df45d5eb4fffe68e7734519c30c202</ID>
  </Owner>
</AccessControlPolicy>

jamesls added a commit that referenced this pull request Aug 6, 2014
jamesls added a commit that referenced this pull request Aug 6, 2014
* takumn-fix-structured-xml-label:
  Add unittest for #196
  Choose proper XML label for structured payload
@jamesls
Copy link
Member

jamesls commented Aug 6, 2014

Sorry for the delay. I've added a unit test for this and merged it via b1a2d62. Thanks!

@jamesls jamesls closed this Aug 6, 2014
kyleknap added a commit that referenced this pull request Aug 7, 2014
* release-0.60.0:
  Bumping version to 0.60.0
  Updated models to the latest version.
  Add unittest for #196
  Choose proper XML label for structured payload
@takumn takumn deleted the fix-structured-xml-label branch August 29, 2014 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants