auth: Enable backends based on the configuration or --backends

This commit is contained in:
George Kaklamanos 2023-11-25 18:08:56 +02:00
parent eebb4ca762
commit 7a294ee146
No known key found for this signature in database
GPG key ID: C0CAB8A6BDC9399D
4 changed files with 39 additions and 18 deletions

View file

@ -1,26 +1,27 @@
use clap::{Parser, ValueEnum};
use serde::Deserialize;
use serde::{Deserialize, Serialize};
#[derive(Parser, Debug)]
#[derive(Serialize, Parser, Debug)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
#[arg(short, long, value_enum)]
pub backend: Backend,
pub backends: Option<Vec<Backend>>,
}
#[derive(Parser, ValueEnum, Clone, Debug)]
#[derive(Serialize, Deserialize, Parser, ValueEnum, Clone, Debug)]
#[serde(rename_all = "lowercase")]
pub enum Backend {
#[cfg(feature = "csv")]
CSV,
}
#[derive(Parser, Debug)]
#[derive(Serialize, Parser, Debug)]
pub enum Command {
Open(Open),
}
#[derive(Parser, Debug)]
#[derive(Serialize, Parser, Debug)]
pub struct Open {
pub method: String,
pub identifier: String,