diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/api/admin/key.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/admin/key.rs b/src/api/admin/key.rs index 25ba76f8..664fde4c 100644 --- a/src/api/admin/key.rs +++ b/src/api/admin/key.rs @@ -65,7 +65,7 @@ pub async fn handle_create_key( ) -> Result<Response<Body>, Error> { let req = parse_json_body::<CreateKeyRequest>(req).await?; - let key = Key::new(&req.name); + let key = Key::new(req.name.as_deref().unwrap_or("Unnamed key")); garage.key_table.insert(&key).await?; key_info_results(garage, key).await @@ -74,7 +74,7 @@ pub async fn handle_create_key( #[derive(Deserialize)] #[serde(rename_all = "camelCase")] struct CreateKeyRequest { - name: String, + name: Option<String>, } pub async fn handle_import_key( |