source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
+[[package]]
+name = "base64"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
+
[[package]]
name = "bitflags"
version = "1.2.1"
version = "0.0.0"
dependencies = [
"anyhow",
+ "base64",
"configparser",
"env_logger",
"extend",
# versions specified here are mostly just guesses at what is needed
# (or currently available):
anyhow = "1"
+base64 = "0.13"
configparser = "2"
env_logger = "0.9"
futures = "0.3"
.saturating_add(Duration::from_nanos(999_999_999))
.as_secs();
+ let time_t = SystemTime::now()
+ .duration_since(UNIX_EPOCH)
+ .unwrap_or_else(|_| Duration::default()) // clock is being weird
+ .as_secs();
+ let time_t = format!("{:x}", time_t);
+ let hmac = token_hmac(c.ic.secret.0.as_bytes(), time_t.as_bytes());
+ let mut token = time_t;
+ write!(token, " ").unwrap();
+ base64::encode_config_buf(&hmac, BASE64_CONFIG, &mut token);
+
let prefix1 = format!(into_crlfs!(
r#"--
Content-Type: text/plain; charset="utf-8"
{}
{}"#),
&c.ic.link.client,
- "xxx token goes here",
+ token,
c.ic.target_requests_outstanding,
show_timeout,
);
pub use std::borrow::Cow;
pub use std::cmp::{min, max};
pub use std::fs;
-pub use std::fmt::{self, Debug, Display};
+pub use std::fmt::{self, Debug, Display, Write as _};
pub use std::future::Future;
pub use std::io::{self, ErrorKind, Read as _};
pub use std::iter;
pub use std::str::{self, FromStr};
pub use std::sync::Arc;
pub use std::task::Poll;
+pub use std::time::{SystemTime, UNIX_EPOCH};
pub use anyhow::{anyhow, Context};
+pub use base64::STANDARD_NO_PAD as BASE64_CONFIG;
pub use extend::ext;
pub use fehler::{throw, throws};
pub use futures::{poll, future};