feat: updates
This commit is contained in:
@@ -14,7 +14,11 @@ const SEQ: AtomicU64 = AtomicU64::new(0);
|
||||
|
||||
struct Request {
|
||||
pub version: String,
|
||||
pub region: String,
|
||||
pub product: String,
|
||||
pub action: String,
|
||||
pub method: String,
|
||||
pub pathname: String,
|
||||
pub access_key: Option<AccessKey>,
|
||||
pub user_agent: String,
|
||||
pub sign_algorithm: SignAlgorithm,
|
||||
@@ -43,6 +47,7 @@ fn add_common_headers(header: &mut BTreeMap<String, String>, request: &Request)
|
||||
}
|
||||
}
|
||||
|
||||
let ymd = "yyyymmdd";
|
||||
let query = BTreeMap::new();
|
||||
|
||||
if let Some(access_key) = &request.access_key {
|
||||
@@ -54,9 +59,9 @@ fn add_common_headers(header: &mut BTreeMap<String, String>, request: &Request)
|
||||
let signing_key = get_signing_key(
|
||||
&request.sign_algorithm,
|
||||
&access_key.access_key_secret,
|
||||
"yyyy-mm-dd",// TODO DATE,
|
||||
"region", // TODO REGION
|
||||
"product", // TODO PRODUCT
|
||||
ymd,
|
||||
&request.region,
|
||||
&request.product,
|
||||
);
|
||||
let derived_access_key = DerivedAccessKey {
|
||||
access_key_id: access_key.access_key_id.clone(),
|
||||
@@ -65,11 +70,11 @@ fn add_common_headers(header: &mut BTreeMap<String, String>, request: &Request)
|
||||
let authorization = get_authorization(
|
||||
&request.sign_algorithm,
|
||||
&derived_access_key,
|
||||
"yyyy-mm-dd",// TODO DATE,
|
||||
"region", // TODO REGION
|
||||
"product", // TODO PRODUCT
|
||||
"pathname", // TODO pathname
|
||||
"method", // TODO method
|
||||
ymd,
|
||||
&request.region,
|
||||
&request.product,
|
||||
&request.pathname,
|
||||
&request.method,
|
||||
&query,
|
||||
header,
|
||||
"payload", // TODO payload
|
||||
@@ -79,9 +84,9 @@ fn add_common_headers(header: &mut BTreeMap<String, String>, request: &Request)
|
||||
}
|
||||
|
||||
|
||||
fn get_timestamp() -> String {
|
||||
fn get_timestamp() -> (String, String) {
|
||||
// TODO ...
|
||||
"yyyy-mm-dd".into()
|
||||
("yyyymmdd".into(), "yyyy-mm-dd".into())
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user