mrapids 0.1.31

Your OpenAPI, but executable
Documentation
pub mod connect;
pub mod detect;
pub mod validate;

use anyhow::Result;
use clap::Subcommand;

/// Authentication management commands
#[derive(Debug, Subcommand)]
pub enum AuthCommand {
    /// Detect and analyze authentication requirements from OpenAPI spec
    Detect(detect::DetectCommand),

    /// Connect and configure authentication credentials
    Connect(connect::ConnectCommand),

    /// Validate configured authentication credentials
    Validate(validate::ValidateCommand),
}

impl AuthCommand {
    #[allow(dead_code)]
    pub async fn execute(self) -> Result<()> {
        match self {
            Self::Detect(cmd) => cmd.execute().await,
            Self::Connect(cmd) => cmd.execute().await,
            Self::Validate(cmd) => cmd.execute().await,
        }
    }
}