aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/key.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-12 11:19:41 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-12 11:19:41 +0200
commitfc2f73ddb5ecaca250daa7b034fe59fb8c47f570 (patch)
treef4287c3a90c32e2c9ea69c14085273ec32544749 /src/api/admin/key.rs
parentfe399a326506a9d8870cb7783a57495849793d2c (diff)
downloadgarage-fc2f73ddb5ecaca250daa7b034fe59fb8c47f570.tar.gz
garage-fc2f73ddb5ecaca250daa7b034fe59fb8c47f570.zip
BucketAllowKey and BucketDenyKey
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,
}