feat: add support for salted password hash authentication
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -26,6 +26,7 @@ pub struct ServerConfig {
|
||||
pub port: Option<u16>,
|
||||
pub password_file: Option<PathBuf>,
|
||||
pub password: Option<String>,
|
||||
pub password_hash: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
@@ -49,6 +50,7 @@ pub struct Settings {
|
||||
pub quiet: bool,
|
||||
pub force: bool,
|
||||
pub server_password: Option<String>,
|
||||
pub server_password_hash: Option<String>,
|
||||
pub server_address: Option<String>,
|
||||
pub server_port: Option<u16>,
|
||||
pub compression: Option<String>,
|
||||
@@ -90,6 +92,9 @@ impl Settings {
|
||||
let server_password = args.options.server_password.clone()
|
||||
.or_else(|| config.get_server_password().ok().flatten());
|
||||
|
||||
let server_password_hash = args.options.server_password_hash.clone()
|
||||
.or_else(|| config.server.as_ref().and_then(|s| s.password_hash.clone()));
|
||||
|
||||
let server_address = args.mode.server_address.clone()
|
||||
.or_else(|| config.server.as_ref().and_then(|s| s.address.clone()));
|
||||
|
||||
@@ -119,6 +124,7 @@ impl Settings {
|
||||
quiet,
|
||||
force,
|
||||
server_password,
|
||||
server_password_hash,
|
||||
server_address,
|
||||
server_port,
|
||||
compression,
|
||||
|
||||
Reference in New Issue
Block a user