()
| 14 | const LAUNCHPAD_ORIGINS: &[&str] = &["https://app.simdeck.sh"]; |
| 15 | |
| 16 | pub fn generate_access_token() -> String { |
| 17 | let mut bytes = [0u8; 32]; |
| 18 | if File::open("/dev/urandom") |
| 19 | .and_then(|mut file| file.read_exact(&mut bytes)) |
| 20 | .is_err() |
| 21 | { |
| 22 | let fallback = format!( |
| 23 | "{}:{}:{:?}", |
| 24 | std::process::id(), |
| 25 | chrono_free_now_nanos(), |
| 26 | std::thread::current().id() |
| 27 | ); |
| 28 | return hex::encode(Sha256::digest(fallback.as_bytes())); |
| 29 | } |
| 30 | hex::encode(bytes) |
| 31 | } |
| 32 | |
| 33 | pub fn server_identity(config: &Config) -> String { |
| 34 | server_identity_for_token(&config.access_token) |
no outgoing calls
no test coverage detected