ListBucket and GetBucketInfo

This commit is contained in:
Alex Auvolat
2022-05-12 10:20:34 +02:00
parent aeb978552a
commit 2b93a01d2b
6 changed files with 355 additions and 13 deletions
+6 -10
View File
@@ -203,11 +203,7 @@ async fn key_info_results(garage: &Arc<Garage>, key: Key) -> Result<Response<Bod
write: p.allow_write,
owner: p.allow_owner,
})
.unwrap_or(KeyBucketPermResult {
read: false,
write: false,
owner: false,
}),
.unwrap_or_default(),
}
})
.collect::<Vec<_>>(),
@@ -246,9 +242,9 @@ struct KeyInfoBucketResult {
permissions: KeyBucketPermResult,
}
#[derive(Serialize)]
struct KeyBucketPermResult {
read: bool,
write: bool,
owner: bool,
#[derive(Serialize, Default)]
pub(crate) struct KeyBucketPermResult {
pub(crate) read: bool,
pub(crate) write: bool,
pub(crate) owner: bool,
}