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

S3Mock overwrites file data with ACL XML on 'putObject' #213

Closed
lgoldstein opened this issue Feb 10, 2020 · 3 comments · Fixed by #819
Closed

S3Mock overwrites file data with ACL XML on 'putObject' #213

lgoldstein opened this issue Feb 10, 2020 · 3 comments · Fixed by #819
Assignees
Labels

Comments

@lgoldstein
Copy link

First of all - great code - helps a lot with debugging S3 code locally.

While trying to use S3Browser with the mock as a server I encountered a problem with uploading files (which translates to calling the FileStoreController#putObject endpoint). After some debugging I found out the following:

The application invokes putObject twice - once with file contents and once again with an XML that contains ACL data. The code does not distinguish between the 2 calls and thus overwrites the original file data with the ACL XML content.

A quick analysis of the requests shows that there are some differences between the requests in the headers - which do not seem definitive enough to provide a distinction, However, there is one significant difference that seems to be most indicative that the call with the ACL contains an acl parameter (i.e., PUT /some/path/to/bucket?acl).

For the time being I "patched" my code locally by checking if there is an acl parameter, and if so ignore the payload and return the S3Object that was generated when the file data was uploaded. I do believe though that it should be handled somehow (perhaps the ACL is required somewhere else - I just did not encounter such a need).

As a side-note - I looked for some documentation on this REST call but could not find any (I did not look very deep though due to lack of time...)

@agudian
Copy link
Member

agudian commented Feb 10, 2020

Thanks for the thorough report!

I think adding a method that has a query parameter „acl“ defined should do the trick to route that call to that other method.

Would you like to try adding that in a PR?

@agudian agudian added the bug label Feb 10, 2020
@lgoldstein
Copy link
Author

Would you like to try adding that in a PR?

I would love to, but I am swamped - I barely had enough time to diagnose this problem. Furthermore, I am not sure how the new method that handles it should behave:

  • Should it store the data ?
  • If so - where ? how ? when will it be read ? (I did not check if S3Browser asks for it...)

@afranken afranken self-assigned this Sep 7, 2022
afranken added a commit that referenced this issue Sep 20, 2022
Implement GetObjectACL / PutObjectACL
Return / accept String instead of a POJO. We need to use JAX-B
annotations instead of Jackson annotations because AWS decided to use
xsi:type annotations in the XML representation, which are not supported
by Jackson. It doesn't seem to be possible to use bot JAX-B and Jackson
for (de-)serialization in parallel.

fixes #213 / #290
afranken added a commit that referenced this issue Sep 25, 2022
Implement GetObjectACL / PutObjectACL
Return / accept String instead of a POJO. We need to use JAX-B
annotations instead of Jackson annotations because AWS decided to use
xsi:type annotations in the XML representation, which are not supported
by Jackson. It doesn't seem to be possible to use bot JAX-B and Jackson
for (de-)serialization in parallel.

fixes #213 / #290
@afranken afranken mentioned this issue Sep 25, 2022
2 tasks
afranken added a commit that referenced this issue Sep 25, 2022
Implement GetObjectACL / PutObjectACL
Return / accept String instead of a POJO. We need to use JAX-B
annotations instead of Jackson annotations because AWS decided to use
xsi:type annotations in the XML representation, which are not supported
by Jackson. It doesn't seem to be possible to use bot JAX-B and Jackson
for (de-)serialization in parallel.

fixes #213 / #290
afranken added a commit that referenced this issue Sep 25, 2022
Implement GetObjectACL / PutObjectACL
Return / accept String instead of a POJO. We need to use JAX-B
annotations instead of Jackson annotations because AWS decided to use
xsi:type annotations in the XML representation, which are not supported
by Jackson. It doesn't seem to be possible to use bot JAX-B and Jackson
for (de-)serialization in parallel.

fixes #213 / #290
afranken added a commit that referenced this issue Sep 26, 2022
Implement GetObjectACL / PutObjectACL
Return / accept String instead of a POJO. We need to use JAX-B
annotations instead of Jackson annotations because AWS decided to use
xsi:type annotations in the XML representation, which are not supported
by Jackson. It doesn't seem to be possible to use bot JAX-B and Jackson
for (de-)serialization in parallel.

fixes #213 / #290
@afranken
Copy link
Member

Just released 2.7.0 which adds ObjectAcl support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants