diff --git a/crates/gpapi/src/process/auth_launcher.rs b/crates/gpapi/src/process/auth_launcher.rs index aa5514f..c67f939 100644 --- a/crates/gpapi/src/process/auth_launcher.rs +++ b/crates/gpapi/src/process/auth_launcher.rs @@ -10,6 +10,7 @@ use super::command_traits::CommandExt; pub struct SamlAuthLauncher<'a> { server: &'a str, + auth_executable: Option<&'a str>, gateway: bool, saml_request: Option<&'a str>, user_agent: Option<&'a str>, @@ -31,6 +32,7 @@ impl<'a> SamlAuthLauncher<'a> { pub fn new(server: &'a str) -> Self { Self { server, + auth_executable: None, gateway: false, saml_request: None, user_agent: None, @@ -49,6 +51,11 @@ impl<'a> SamlAuthLauncher<'a> { } } + pub fn auth_executable(mut self, auth_executable: Option<&'a str>) -> Self { + self.auth_executable = auth_executable; + self + } + pub fn gateway(mut self, gateway: bool) -> Self { self.gateway = gateway; self @@ -114,7 +121,8 @@ impl<'a> SamlAuthLauncher<'a> { /// Launch the authenticator binary as the current user or SUDO_USER if available. pub async fn launch(self) -> anyhow::Result { - let mut auth_cmd = Command::new(GP_AUTH_BINARY); + let program = self.auth_executable.unwrap_or(GP_AUTH_BINARY); + let mut auth_cmd = Command::new(program); auth_cmd.arg(self.server); if self.gateway {