mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-23 18:40:34 +00:00
Fix request signatures
We don't need to sha256 actually
This commit is contained in:
parent
d3c3180038
commit
438f244d88
1 changed files with 5 additions and 2 deletions
|
@ -29,11 +29,14 @@ pub fn signature<S: Signer>(signer: &S, headers: Headers, conn: &PgConnection) -
|
|||
let signed_string = headers.iter().map(|h| format!("{}: {}", h.name().to_lowercase(), h.value_string())).collect::<Vec<String>>().join("\n");
|
||||
let signed_headers = headers.iter().map(|h| h.name().to_string()).collect::<Vec<String>>().join(" ").to_lowercase();
|
||||
|
||||
println!("Signing {}", signed_string);
|
||||
println!("signed header {}", signed_headers);
|
||||
let data = signer.sign(signed_string);
|
||||
let sign = hex::encode(sha256(&data[..]));
|
||||
let sign = base64::encode(&data[..]);
|
||||
println!("sigature {}", sign);
|
||||
|
||||
Signature(format!(
|
||||
"keyId=\"{key_id}\",algorithm=\"rsa-sha256\",headers=\"#{signed_headers}\",signature=\"#{signature}\"",
|
||||
"keyId=\"{key_id}\",algorithm=\"rsa-sha256\",headers=\"{signed_headers}\",signature=\"{signature}\"",
|
||||
key_id = signer.get_key_id(conn),
|
||||
signed_headers = signed_headers,
|
||||
signature = sign
|
||||
|
|
Loading…
Reference in a new issue