generated from br3ndonland/template-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Add PUT uploads to object storage client
- DONE: can object metadata like content-type be set? -> yes, in headers - DONE: Backblaze B2 ignores request for SSE-B2 server-side encryption if provided in presigned URL query params -> move to header - DONE: signature incorrect if `X-Amz-Server-Side-Encryption` in header -> keys were out of order because dict key sorting is case-sensitive. Use httpx.Headers to lowercase the keys and avoid this issue. - DONE: provide checksum - https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html: "Currently, Amazon S3 presigned URLs don't support using the following data-integrity checksum algorithms (CRC32, CRC32C, SHA-1, SHA-256) when you upload objects. To verify the integrity of your object after uploading, you can provide an MD5 digest of the object when you upload it with a presigned URL. For more information about object integrity, see Checking object integrity." https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - `Content-MD5` header can be used. - DONE: signature incorrect if `Content-MD5` in header -> `PutObject` docs say, "The base64-encoded 128-bit MD5 digest of the message (without the headers) according to RFC 1864." Had to base64-encode the digest. The "Checking object integrity" docs neglect to mention the need for base64-encoding. https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - Does B2 support `Content-MD5`? It looks like B2 usually uses SHA-1 -> Yes, looks like B2 will pick up `Content-MD5`. - TODO: update tests for any uncovered or changed code
- Loading branch information
1 parent
8492656
commit fc3e417
Showing
3 changed files
with
80 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters