aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/router.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/router.rs
parent4a82f6380e6a7d7c841477fc914fd96e6c09adad (diff)
downloadgarage-7895f99d3afc6e97f62f52abe06a6ee8d0f0617f.tar.gz
garage-7895f99d3afc6e97f62f52abe06a6ee8d0f0617f.zip
admin and cli: hide secret keys unless asked
Diffstat (limited to 'src/api/admin/router.rs')
-rw-r--r--src/api/admin/router.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/api/admin/router.rs b/src/api/admin/router.rs
index 077509e3..97ad6f76 100644
--- a/src/api/admin/router.rs
+++ b/src/api/admin/router.rs
@@ -35,6 +35,7 @@ pub enum Endpoint {
GetKeyInfo {
id: Option<String>,
search: Option<String>,
+ show_secret_key: Option<String>,
},
DeleteKey {
id: String,
@@ -104,11 +105,11 @@ impl Endpoint {
POST ("/v0/layout/apply" | "/v1/layout/apply") => ApplyClusterLayout,
POST ("/v0/layout/revert" | "/v1/layout/revert") => RevertClusterLayout,
// API key endpoints
- GET ("/v0/key" | "/v1/key") if id => GetKeyInfo (query_opt::id, query_opt::search),
- GET ("/v0/key" | "/v1/key") if search => GetKeyInfo (query_opt::id, query_opt::search),
- POST ("/v0/key" | "/v1/key") if id => UpdateKey (query::id),
- POST ("/v0/key" | "/v1/key") => CreateKey,
- POST ("/v0/key/import" | "/v1/key/import") => ImportKey,
+ GET "/v1/key" if id => GetKeyInfo (query_opt::id, query_opt::search, query_opt::show_secret_key),
+ GET "/v1/key" if search => GetKeyInfo (query_opt::id, query_opt::search, query_opt::show_secret_key),
+ POST "/v1/key" if id => UpdateKey (query::id),
+ POST "/v1/key" => CreateKey,
+ POST "/v1/key/import" => ImportKey,
DELETE ("/v0/key" | "/v1/key") if id => DeleteKey (query::id),
GET ("/v0/key" | "/v1/key") => ListKeys,
// Bucket endpoints
@@ -153,6 +154,7 @@ generateQueryParameters! {
"search" => search,
"globalAlias" => global_alias,
"alias" => alias,
- "accessKeyId" => access_key_id
+ "accessKeyId" => access_key_id,
+ "showSecretKey" => show_secret_key
]
}