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

Custom metadata keys can't be used #19

Closed
Deraen opened this issue Apr 23, 2018 · 7 comments
Closed

Custom metadata keys can't be used #19

Deraen opened this issue Apr 23, 2018 · 7 comments

Comments

@Deraen
Copy link

Deraen commented Apr 23, 2018

If I understand Amazonica correctly, :metadata can only contain some of the possible headers: https://github.com/mcohen01/amazonica/blob/master/src/amazonica/aws/s3.clj#L172

:metadata {:x-amz-website-redirect-location "/foo/"} doesn't work as Amazonica doesn't read this.

:metadata {:user-metadata {:x-amz-website-redirect-location "/foo/"}} might work for Amazonica but a Schema here prevents using that currently.

@martinklepsch
Copy link
Member

@Deraen does the following schema seem reasonable to you?

{:metadata {s/Keyword s/Any}}

should we be more specific or prefer being general here?

@Deraen
Copy link
Author

Deraen commented Apr 26, 2018

@martinklepsch That seems good choice for this case.

Bigger change would be to throw out Amazonica and directly use AWS SDK. That would allow automatically calling setUserMetadata for any :x-amz-* keys while calling the other methods for other keys.

https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/ObjectMetadata.html

@martinklepsch
Copy link
Member

Yeah, I guess this library being relatively damn it should be considered. I’ll try to make a release with the updated Schema some time next week.

@martinklepsch
Copy link
Member

Released 0.1.3 with relaxed schema 🎉

Thanks for raising this Juho!

@Deraen
Copy link
Author

Deraen commented May 3, 2018

@martinklepsch Thanks. Unfortunately I didn't get this working even with the change. Either Boot overrides the s3-deploy version for confetti pod (but I don't think that should happen). Or x-amz-website-redirect-location should be set using ObjectMetadata setHeader instead of userMetadata, and Amazonica doesn't have support for this property.

@martinklepsch
Copy link
Member

martinklepsch commented May 6, 2018

Ah! Good point, I'll need to update the dependency used by confetti. The pod isn't merging dependencies into the main env but associng them:

https://github.com/confetti-clj/confetti/blob/f59868fd2c54e14e2dcc8938753ce0b97e185a34/src/confetti/boot_confetti.clj#L18-L19

Will cut a release over there soon. Generally it would be nice to have some code that uses the version specified in current :dependencies if it is specified there. Or maybe I should just add those dependencies to (get-env).

@Deraen
Copy link
Author

Deraen commented May 7, 2018

Adding s3-deploy to project dependencies is problematic because it will then add the whole aws-sdk to project directly and that can easily cause conflicts with other project dependencies (which don't happen if it is loaded on pod).

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

No branches or pull requests

2 participants