1mod auth;
14mod bridge;
15mod funcs;
16mod keys;
17mod pty;
18mod run;
19mod runtime;
20mod state;
21mod types;
22mod validate;
23
24pub use funcs::{module_with, module_with_endpoints};
25use oxdock_core::HostModule;
26pub use oxdock_process::DefaultProcessManager;
27
28pub use types::{SshServerTag, SshSessionTag};
29
30pub fn generate_password() -> String {
34 use aes_gcm::aead::Generate;
35 use aes_gcm::{Aes256Gcm, Key};
36
37 let key = Key::<Aes256Gcm>::generate();
38 hex::encode(key)
39}
40
41pub fn module() -> HostModule<DefaultProcessManager> {
43 module_with()
44}
45
46#[cfg(test)]
47mod tests {
48 use super::*;
49
50 #[test]
51 fn generated_passwords_are_unique_hex() {
52 let a = generate_password();
53 let b = generate_password();
54 assert_eq!(a.len(), 64, "256 bits render as 64 hex chars");
55 assert!(
56 a.chars().all(|c| c.is_ascii_hexdigit()),
57 "hex only, safe in scripts and shells"
58 );
59 assert_ne!(a, b, "two draws must differ");
60 }
61}