apache / apache/libcloud

Object metadata keys are lowercased when uploading to GCS

Đang mở
#1,530 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
api: storage drivers: google storage feature request stale
Ngôn ngữ chính
Python
Star
2.1k
Fork
931
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
4

Mô tả

## Summary

Mixed-case metadata is lowercased when using libcloud to upload objects to Google Cloud Storage.

## Detailed Information

I'm using libcloud to upload files to a Google Cloud Storage bucket together with object metadata.
In the process, the keys in my metadata dict are being lowercased. This is not due to Google Cloud Storage, which does support mixed case metadata.

The issue can be reproduced following the example from the docs:
```
from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver

cls = get_driver(Provider.GOOGLE_STORAGE)
driver = cls('SA-EMAIL', './SA.json') # provide service account credentials here

FILE_PATH = '/home/user/file'

extra = {'meta_data': {'camelCase': 'foo'}}

# Upload with metadata
with open(FILE_PATH, 'rb') as iterator:
obj = driver.upload_object_via_stream(iterator=iterator,
container=container,
object_name='file',
extra=extra)
```
The file uploads succesfully, but resulting metadata will look as follows:
![image](https://user-images.githubusercontent.com/25384180/102534327-dd828780-40a6-11eb-999a-ae3d775c3786.png)

Where `camelCase` has been turned into `camelcase`.

I'm using apache-libcloud==3.0.0 with Python 3.8 on Linux (the python:3.8 Docker image).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu từ điểm vào upload_object_via_stream và lần theo cách dict siêu dữ liệu bổ sung được chuẩn bị cho Google Cloud Storage. Tái hiện ví dụ với khóa camelCase, sau đó xác minh rằng siêu dữ liệu của đối tượng đã tải lên vẫn giữ nguyên cách viết hoa và viết thường ban đầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
google-cloud, python
Lĩnh vực
cloud
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.