BKHQHXZQDFC6SSIQ3XBNIBYQJBD3EN6VFKK7VBWY4BOT2H2ZRQAAC
RAXDAROSIIJBXZHCH3RKJU5N4VED5O36ZOIEC62C7G6NKLL6UEFAC
3GGMBQ2NU3GTQ3I5C4TSW5XOWSYDLR3QIRXZWZJK2DP7M5I7QD3QC
ZRU62WXDVY32ZF7AUYONXUQUAKZZGCUFWAYYBA32OXEBARVDVSNAC
4MZ4VIR7FU3PQ3WKJI6TJIKYOIIBODFEPKLMQ32S4AKPZSDFO6AQC
7R6HAATP4CKWKNOFWAVCZFJVF6LADPHHIINR37PYNGAWGCTBJSJQC
WVHXYKCVPKAFVMXBEMD3IHG54RKOIDSOCVNR3OIPEZQG36IGYJZQC
Z3SYSC25TVJBLI4JBYM3OCBK7DYCC2BKPAYW6OVTN2ILFQ4ANUMQC
BCXEUKX6RVE4UQE46ITSQY2NXYK3MJT7HHL7CJOM7T4OOOCADMIAC
WXRGEQOELNXAKIG2CT7G6OZWTFLNWPISLWHZ5B76HFUNNHYOFCCQC
NLEIFOAGRNGFH24MAEDEYVKNRSHZCWMHAI232E57QDSOBGLCHO4QC
IM5ZPD4NEWQ67NSRP3M4R6FBET5HLY5YCX6WOTGGVWIMRGFD3L3AC
let _cookies_key = if let Some(c) = cookies_key_base64 {
match base64::decode_config(c, base64::URL_SAFE_NO_PAD) {
Ok(b) => {
if b.len() < 64 {
log::error!("Small key for cookies");
return Err(std::io::Error::new(std::io::ErrorKind::Other, "Small key"));
} else {
actix_web::cookie::Key::from(&b)
}
}
Err(e) => {
log::error!("Incorrect key for cookies {}", e);
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Incorrect key",
));
}
}
} else {
log::error!("Missing key for cookies");
if let Some(nc) = actix_web::cookie::Key::try_generate() {
log::info!(
"Put line `cookies_key_base64 = \"{}\"` to config",
base64::encode_config(nc.master(), base64::URL_SAFE_NO_PAD)
);
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Missing key",
));
} else {
log::error!("Cann't generate key for cookies");
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Cann't generate key",
));
}
};
[dependencies.actix-web]
version = "4.2.1"
features = ["secure-cookies"]
[[package]]
name = "aead"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877"
dependencies = [
"generic-array",
]
[[package]]
name = "aes"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8"
dependencies = [
"cfg-if",
"cipher",
"cpufeatures",
"opaque-debug",
]
[[package]]
name = "aes-gcm"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6"
dependencies = [
"aead",
"aes",
"cipher",
"ctr",
"ghash",
"subtle",
]