aliyun-log-sdk-sign

Crates.ioaliyun-log-sdk-sign
lib.rsaliyun-log-sdk-sign
version0.2.1
created_at2025-04-29 08:12:33.455048+00
updated_at2025-04-29 08:43:38.203493+00
descriptionA crate to calculate signature for HTTP request to Aliyun Log Service.
homepagehttps://github.com/aliyun/aliyun-log-rust-sdk/tree/master/sign
repositoryhttps://github.com/aliyun/aliyun-log-rust-sdk/tree/master/sign
max_upload_size
id1653280
size36,260
Crimson (crimson-gao)

documentation

https://docs.rs/aliyun-log-sdk-protobuf

README

aliyun-log-sdk-sign

Description

This crate is used to generate signature for aliyun log service.

For more Documents.

Quick Start

Add this crate to your Cargo.toml using the following command:

cargo add aliyun-log-sdk-sign

Use it in your code:

use aliyun_log_sdk_sign::{sign_v1, QueryParams};
let mut headers = http::HeaderMap::new();
let signature_result = sign_v1(
    "your_access_key_id",
    "your_access_key_secret",
    None,
    http::Method::GET,
    "/",
    &mut headers,
    QueryParams::empty(),
    None,
);
if let Err(err) = signature_result {
    println!("signature error: {}", err);
}

// with body, security token and query params
let signature_result = sign_v1(
    "your_access_key_id",
    "your_access_key_secret",
    Some("your_security_token"),
    &http::Method::POST,
    "/logstores/test-logstore/logs",
    &mut headers,
    [("key1", "value1"), ("key2", "value2")].into(),
    Some("HTTP body contents"),
);
if let Err(err) = signature_result {
    println!("signature error: {}", err);
}
Commit count: 8

cargo fmt