aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/key.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-06-14 17:13:41 +0200
committerAlex Auvolat <alex@adnab.me>2023-06-14 17:19:25 +0200
commit8ef42c9609bcefc642cc9739acb921dffba49b89 (patch)
tree5d479c3ad3951d5d44cea5c2e033b506733c4f0f /src/api/admin/key.rs
parenta83a092c032058728f191119de99f38844aa74f5 (diff)
downloadgarage-8ef42c9609bcefc642cc9739acb921dffba49b89.tar.gz
garage-8ef42c9609bcefc642cc9739acb921dffba49b89.zip
admin docs: reformatting, key admin: add check
Diffstat (limited to 'src/api/admin/key.rs')
-rw-r--r--src/api/admin/key.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/admin/key.rs b/src/api/admin/key.rs
index 0d1f799b..8d1c6890 100644
--- a/src/api/admin/key.rs
+++ b/src/api/admin/key.rs
@@ -93,7 +93,8 @@ pub async fn handle_import_key(
&req.access_key_id,
&req.secret_access_key,
req.name.as_deref().unwrap_or("Imported key"),
- );
+ )
+ .ok_or_bad_request("Invalid key format")?;
garage.key_table.insert(&imported_key).await?;
key_info_results(garage, imported_key, false).await