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
Class Metadata capitalizes names #50
Comments
The reason for this feature is documented here: #34 How about if I restrict the capitalize method to only work on the Meta (ie, ObjectStore) fields? EDIT: no, won't work either. If you have an idea how best to solve it, I would love to hear it. |
More in-depth: I added this change to JOSS because the metadata header was capitalized by Swift itself. By already capitalizing in JOSS, the behaviour between Swift and mock implementation would be similar. I wonder: does your Swift implementation also capitalize the headers if you save the headers directly through the REST API? |
Phil, I also tried this on Swiftstack using curl and the behaviour on the metadata headers is exactly the same what I see on the CloudVPS implementation. I'm sorry to say I cannot change anything in JOSS to make your life easier, so I'm going to close this issue. My advice would be to write custom code that uncapitalizes your metadata header names. |
Sorry about the late reply. I am seeing the same things that you are describing where Swift is auto capitalizing. I agree that Joss is behaving the way it should. I am using a library designed for S3 and am able to capture the data coming out of Swift in order to modify it (i.e. make it lowercase) so that the S3 library works. I also agree that this is an S3 / Swift compatibility issue that is an upstream problem (which I won't pursue since I have an acceptable workaround). Thanks for all of the time you spent looking into my issue and for the quick response. |
I am uses a third party library (Amazon's SDK) which puts encryption keys in the metadata when you store the object. This is an implementation of envelope encryption. When the object is retrieved it uses the keys to decrypt the file (it is a little bit more complicated than that, but that will suffice).
When the library sets a metadata entry it will be in the form of x-amz-iv, x-amz-key, and x-amz-matdesc. Joss then proceeds to change these names to X-Amz-Iv, X-Amz-Key, and X-Amz-Matdesc. When the sdk goes to get the encryption keys it asks for the metadata by the names it stored it as: x-amz-iv, x-amz-key, and x-amz-matdesc which don't exist and so the decryption fails.
Why is Swift changing my metadata names? Is there a way to turn this off?
This is happening in
org.javaswift.joss.headers.Metadata
. The constructor like looks like:The text was updated successfully, but these errors were encountered: