aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/key.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/admin/key.rs')
-rw-r--r--src/api/admin/key.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/api/admin/key.rs b/src/api/admin/key.rs
index 1252d2c8..19ad5160 100644
--- a/src/api/admin/key.rs
+++ b/src/api/admin/key.rs
@@ -198,7 +198,7 @@ async fn key_info_results(garage: &Arc<Garage>, key: Key) -> Result<Response<Bod
permissions: key_state
.authorized_buckets
.get(&bucket.id)
- .map(|p| KeyBucketPermResult {
+ .map(|p| ApiBucketKeyPerm {
read: p.allow_read,
write: p.allow_write,
owner: p.allow_owner,
@@ -239,12 +239,15 @@ struct KeyInfoBucketResult {
global_aliases: Vec<String>,
#[serde(rename = "localAliases")]
local_aliases: Vec<String>,
- permissions: KeyBucketPermResult,
+ permissions: ApiBucketKeyPerm,
}
-#[derive(Serialize, Default)]
-pub(crate) struct KeyBucketPermResult {
+#[derive(Serialize, Deserialize, Default)]
+pub(crate) struct ApiBucketKeyPerm {
+ #[serde(default)]
pub(crate) read: bool,
+ #[serde(default)]
pub(crate) write: bool,
+ #[serde(default)]
pub(crate) owner: bool,
}