Skip to main content

rskit_git/cli/
auth.rs

1//! CLI auth helpers.
2
3use crate::auth::TransportAuth;
4use rskit_errors::AppResult;
5
6/// Placeholder hook for future CLI auth composition.
7#[allow(dead_code)]
8pub fn apply_transport(_auth: Option<&TransportAuth>) -> AppResult<()> {
9    Ok(())
10}
11
12#[cfg(test)]
13mod tests {
14    use super::*;
15
16    #[test]
17    fn apply_transport_accepts_default_and_explicit_auth_without_side_effects() {
18        apply_transport(None).expect("default CLI auth is accepted");
19        apply_transport(Some(&TransportAuth::Token {
20            username: Some("git".to_string()),
21            token: "secret".to_string(),
22        }))
23        .expect("token CLI auth is accepted for later command composition");
24    }
25}