aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/api_server.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-06-14 16:56:15 +0200
committerAlex Auvolat <alex@adnab.me>2023-06-14 16:56:15 +0200
commit7895f99d3afc6e97f62f52abe06a6ee8d0f0617f (patch)
tree54918eaff3880d013d59b77db2091c56c5f45fb7 /src/api/admin/api_server.rs
parent4a82f6380e6a7d7c841477fc914fd96e6c09adad (diff)
downloadgarage-7895f99d3afc6e97f62f52abe06a6ee8d0f0617f.tar.gz
garage-7895f99d3afc6e97f62f52abe06a6ee8d0f0617f.zip
admin and cli: hide secret keys unless asked
Diffstat (limited to 'src/api/admin/api_server.rs')
-rw-r--r--src/api/admin/api_server.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/api/admin/api_server.rs b/src/api/admin/api_server.rs
index b0dfdfb7..6819e28e 100644
--- a/src/api/admin/api_server.rs
+++ b/src/api/admin/api_server.rs
@@ -242,8 +242,13 @@ impl ApiHandler for AdminApiServer {
Endpoint::RevertClusterLayout => handle_revert_cluster_layout(&self.garage, req).await,
// Keys
Endpoint::ListKeys => handle_list_keys(&self.garage).await,
- Endpoint::GetKeyInfo { id, search } => {
- handle_get_key_info(&self.garage, id, search).await
+ Endpoint::GetKeyInfo {
+ id,
+ search,
+ show_secret_key,
+ } => {
+ let show_secret_key = show_secret_key.map(|x| x == "true").unwrap_or(false);
+ handle_get_key_info(&self.garage, id, search, show_secret_key).await
}
Endpoint::CreateKey => handle_create_key(&self.garage, req).await,
Endpoint::ImportKey => handle_import_key(&self.garage, req).await,