8 releases (4 breaking)

new 0.5.3 Apr 27, 2024
0.5.2 Apr 24, 2024
0.4.0 Apr 14, 2024
0.3.0 Apr 10, 2024
0.1.1 Apr 5, 2024

#2236 in Web programming

Download history 307/week @ 2024-04-05 429/week @ 2024-04-12 255/week @ 2024-04-19

991 downloads per month

MIT/Apache

130KB
3K SLoC

cloud-storage-signature

This crate is in ALPHA. Do not use in production.

ci crates.io docs.rs license

TODOs

  • Support signBlob with ServiceAccount
  • Support HMAC key
  • Improve error handling
  • Add doc comments
  • Refactor
    • Remove http crate from dependencies

lib.rs:

A Cloud Storage signature utils

HTML Form Data

HtmlFormData is a struct that represents a form data for a POST request to upload an object to Google Cloud Storage.

https://cloud.google.com/storage/docs/xml-api/post-object-forms

use cloud_storage_signature::HtmlFormData;
assert_eq!(
    HtmlFormData::builder()
        .key("object_name1")
        .build()
        .await?
        .into_vec(),
    vec![("key".to_string(), "object_name1".to_string())]
);

This form data does not include the file field, so you need to add the file field to upload a file. See image-uploader example.

Dependencies

~13–25MB
~473K SLoC