MCPcopy Create free account
hub / github.com/bootc-dev/bootc / get_keys_from_command

Function get_keys_from_command

crates/system-reinstall-bootc/src/users.rs:181–193  ·  view source on GitHub ↗
(command: &str, command_user: &str)

Source from the content-addressed store, hash-verified

179
180#[context("get_keys_from_command")]
181fn get_keys_from_command(command: &str, command_user: &str) -> Result<Vec<PublicKey>> {
182 let user_config = uzers::get_user_by_name(command_user).context(format!(
183 "authorized_keys_command_user {command_user} not found"
184 ))?;
185
186 let mut cmd = Command::new(command);
187 cmd.uid(user_config.uid());
188 let output = cmd
189 .run_get_output()
190 .context(format!("running authorized_keys_command {command}"))?;
191 let keys = PublicKey::read_keys(output)?;
192 Ok(keys)
193}
194
195#[context("get_all_users_keys")]
196pub(crate) fn get_all_users_keys() -> Result<Vec<UserKeys>> {

Callers 1

get_all_users_keysFunction · 0.85

Calls 1

run_get_outputMethod · 0.80

Tested by

no test coverage detected