kych

OAuth 2.0 API for Swiyu to enable Taler integration of Swiyu for KYC (experimental)
Log | Files | Refs

commit 8190ae9da8df13436f0e9d361ed07c72a75feb92
parent 2419d3a35c837625ccbc503a624dbd3e4537a7d2
Author: Henrique Chan Carvalho Machado <henriqueccmachado@tecnico.ulisboa.pt>
Date:   Fri,  5 Dec 2025 15:51:40 +0100

oauth2_gateway: fix client cli list print

Diffstat:
Moauth2_gateway/src/bin/client_management_cli.rs | 18++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/oauth2_gateway/src/bin/client_management_cli.rs b/oauth2_gateway/src/bin/client_management_cli.rs @@ -143,15 +143,13 @@ async fn cmd_list_clients(pool: &sqlx::PgPool) -> Result<()> { return Ok(()); } - println!("{:<36} {:<20} {:<40} {}", "UUID", "CLIENT_ID", "WEBHOOK_URL", "CREATED"); - println!("{}", "-".repeat(120)); - for client in clients { + println!("{}", "-".repeat(80)); println!( - "{:<36} {:<20} {:<40} {}", + "UUID: {}\nCLIENT_ID: {}\nWEBHOOK_URL: {} \nCREATED: {}\n", client.id, - truncate(&client.client_id, 20), - truncate(&client.webhook_url, 40), + client.client_id, + client.webhook_url, client.created_at.format("%Y-%m-%d %H:%M") ); } @@ -277,11 +275,3 @@ async fn cmd_delete_client(pool: &sqlx::PgPool, client_id: &str, skip_confirm: b Ok(()) } - -fn truncate(s: &str, max_len: usize) -> String { - if s.len() <= max_len { - s.to_string() - } else { - format!("{}...", &s[..max_len - 3]) - } -}