commit 0ec8abec8d38e7fe789f0d7391ceb15afd28bc0d
parent 7d32e43b2337767d9a7ccc84d0b452d33f257605
Author: Henrique Chan Carvalho Machado <henriqueccmachado@tecnico.ulisboa.pt>
Date: Wed, 26 Nov 2025 11:43:49 +0100
oauth2_gateway: fix client management cli needs client prefix
Diffstat:
1 file changed, 39 insertions(+), 50 deletions(-)
diff --git a/oauth2_gateway/src/bin/client_management_cli.rs b/oauth2_gateway/src/bin/client_management_cli.rs
@@ -28,14 +28,6 @@ struct Args {
#[derive(Subcommand, Debug)]
enum Commands {
- Client {
- #[command(subcommand)]
- action: ClientAction,
- },
-}
-
-#[derive(Subcommand, Debug)]
-enum ClientAction {
List,
Show {
@@ -83,7 +75,7 @@ enum ClientAction {
#[arg(long, short = 'y')]
yes: bool,
- },
+ },
}
#[tokio::main]
@@ -101,45 +93,43 @@ async fn main() -> Result<()> {
.context("Failed to connect to database")?;
match args.command {
- Commands::Client { action } => match action {
- ClientAction::List => cmd_list_clients(&pool).await?,
- ClientAction::Show { client_id } => cmd_show_client(&pool, &client_id).await?,
- ClientAction::Create {
- client_id,
- secret,
- webhook_url,
- verifier_url,
- verifier_api_path,
- } => {
- cmd_create_client(
- &pool,
- &client_id,
- &secret,
- &webhook_url,
- &verifier_url,
- verifier_api_path.as_deref(),
- )
- .await?
- }
- ClientAction::Update {
- client_id,
- webhook_url,
- verifier_url,
- verifier_api_path,
- } => {
- cmd_update_client(
- &pool,
- &client_id,
- webhook_url.as_deref(),
- verifier_url.as_deref(),
- verifier_api_path.as_deref(),
- )
- .await?
- }
- ClientAction::Delete { client_id, yes } => {
- cmd_delete_client(&pool, &client_id, yes).await?
- }
- },
+ Commands::List => cmd_list_clients(&pool).await?,
+ Commands::Show { client_id } => cmd_show_client(&pool,&client_id).await?,
+ Commands::Create {
+ client_id,
+ secret,
+ webhook_url,
+ verifier_url,
+ verifier_api_path,
+ } => {
+ cmd_create_client(
+ &pool,
+ &client_id,
+ &secret,
+ &webhook_url,
+ &verifier_url,
+ verifier_api_path.as_deref(),
+ )
+ .await?
+ }
+ Commands::Update {
+ client_id,
+ webhook_url,
+ verifier_url,
+ verifier_api_path,
+ } => {
+ cmd_update_client(
+ &pool,
+ &client_id,
+ webhook_url.as_deref(),
+ verifier_url.as_deref(),
+ verifier_api_path.as_deref(),
+ )
+ .await?
+ }
+ Commands::Delete { client_id, yes } => {
+ cmd_delete_client(&pool, &client_id, yes).await?
+ }
}
Ok(())
@@ -294,4 +284,4 @@ fn truncate(s: &str, max_len: usize) -> String {
} else {
format!("{}...", &s[..max_len - 3])
}
-}
-\ No newline at end of file
+}