use super::*;
#[derive(Copy, Clone, Debug, Default)]
pub struct Plaintext;
#[derive(Clone, Debug)]
pub struct PlaintextSign(String);
impl SignatureMethod for Plaintext {
type Sign = PlaintextSign;
fn sign_with(self, client_secret: &str, token_secret: Option<&str>) -> PlaintextSign {
let mut key = String::with_capacity(128);
write_signing_key(&mut key, client_secret, token_secret);
PlaintextSign(key)
}
}
impl Sign for PlaintextSign {
type Signature = String;
fn get_signature_method_name(&self) -> &'static str {
"PLAINTEXT"
}
fn request_method(&mut self, _method: &str) {}
fn uri<T>(&mut self, _uri: T) {}
fn parameter<V>(&mut self, _key: &str, _value: V) {}
fn delimiter(&mut self) {}
fn end(self) -> String {
self.0
}
}