Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Add support for S3 Metadata #104

Open
urgelacko opened this issue Oct 7, 2015 · 10 comments
Open

Add support for S3 Metadata #104

urgelacko opened this issue Oct 7, 2015 · 10 comments
Labels
component: s3 S3 integration related issue type: feature A new feature
Milestone

Comments

@urgelacko
Copy link

Amazon S3 provides a way to set several Metadata information such as Server Side Encryption, custom user metadata, etc...

SimpleStorageResource currently handles version numbers in url and object metadata is saved to a private field but since it is not exposed I cannot use it.
Besides this no any metadata can be set through Spring Cloud S3 library cause UploadPartResultCallable call method does not set any ObjectMetada on the request.
Some extension points for setting global metadata for all uploads (like SSE algorithm) would be nice while metadata support on resource level similar to versioning in url (^version) would be awesome.

@urgelacko urgelacko changed the title Add support for S3 Metadata handling or at least some point for extension Add support for S3 Metadata Oct 7, 2015
@aemruli aemruli modified the milestone: 1.1.0.m2 Nov 1, 2015
@dsyer dsyer removed this from the 1.1.0.M2 milestone Mar 7, 2016
@aemruli aemruli added the type: feature A new feature label Jul 15, 2016
@aemruli aemruli added this to the 1.2.0 milestone Jul 15, 2016
@jeffellin
Copy link

jeffellin commented Aug 29, 2016

@dsyer is someone working on this? If not it might be something I can take on. I just opened a related issue for not being able to access SimpleStorageResource, but I see that I still won't be able to access the metadata.

@spencergibb spencergibb modified the milestones: 1.2.0.M1, 1.2.0 Jan 26, 2017
@spencergibb spencergibb modified the milestones: 1.2.0, Backlog Apr 6, 2017
@ausov
Copy link

ausov commented Aug 1, 2017

Are you sure it's the right pattern to retrieve meta-data? From my understanding, the Resource is a a replacement for URL that is suitable for IO ops. Isn't it better to use a separate service for meta-data retrieval?

@urgelacko
Copy link
Author

urgelacko commented Aug 3, 2017

There should be some mechanism which allows you to manage metadata also since it is part of S3 and it is often needed. This can be implemented with a wrapper or with some service abstraction while the current resource mechanism still would supported.
But currently this is the Spring API for S3 integration and the metadata is part of S3 API. Without metadata support this spring lib is not usable for mature S3 integration.
For example encryption is a functionality which we are using to store sensitive data and it is working with metadata.

@ausov
Copy link

ausov commented Aug 9, 2017

Agree regarding metadata service. Although all needed already exists in AWS SDK there can be a simple service bean with convenient ops.

Not so sure about using a Resource class for that. Consider also that Resource should be cacheable so it supposed to be lightweight and not referring to beans, etc. I would suggest to leave it simple with intention to use it in resource resolving chain, IO ops, etc. Like replacement for an URL. Just seems a bit heavy to use it for something more.

@mdedgjonaj
Copy link

This is a very valid issue and I am surprised that not the right importance is given to it. In my understanding SimpleStorageResource is a WritableResource and we are supposed to use that to upload new documents as well not just for download. If I want to set Server Side Encryption for the files that I am uploading, I will not be able to do it. If somebody knows a work-around until this feature is added, I would love to hear about it.

@mdedgjonaj
Copy link

mdedgjonaj commented Dec 27, 2017

The solution I would suggest for this is by passing a default initial ObjectMetadata to SimpleStorageResourceLoader which will be passed to SimpleStorageResource when getResource is called.
That ObjectMetadata will be the initial one and all the needed changes will be done on top of that.
That ObjectMetadata should be used only when doing PUT. Nothing changes on getting resources from AWS.

@mdedgjonaj
Copy link

mdedgjonaj commented Dec 27, 2017

@aemruli, @spencergibb, @dsyer : Is anybody working on this? I would love to contribute to solve this issue. I am anyway fixing it for my use case.
I have explained above how I see this feature working.
Please let me know if anybody else has any different suggestion on how to solve it?

@hopeng
Copy link

hopeng commented Mar 19, 2018

I can't use spring cloud for S3 upload because it cannot set SSE. Would be great to see a solution to this problem.

@lukaszkrawiec
Copy link

huh, like others I'm surprised this is not a feature. Can't use spring-cloud-aws because of that

@maciejwalkowiak maciejwalkowiak added the component: s3 S3 integration related issue label May 29, 2020
@raviguptasmarsh
Copy link

Cannot use spring-cloud-aws because of SSE requirement. Is this in pipeline ?

maciejwalkowiak added a commit to awspring/spring-cloud-aws that referenced this issue Apr 1, 2022
Re-implement S3 integration with AWS SDK v2:

- auto-configuration for S3 
- cross-region S3 client
- `S3Resource` and integration with `ResourceLoader`
- writeable resource with disk buffering S3 OutputStream and option to provide custom output stream implementation
- object metadata support 
- sample

Fixes #183
Fixes #55
Fixes spring-attic/spring-cloud-aws#104
Fixes spring-attic/spring-cloud-aws#686
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: s3 S3 integration related issue type: feature A new feature
Development

No branches or pull requests