aboutsummaryrefslogtreecommitdiff
path: root/src/model/bucket_table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-16 11:47:58 +0100
committerAlex Auvolat <alex@adnab.me>2022-01-04 12:45:52 +0100
commit0bbb6673e7ce703e470a3c2aad620ee5f009bc84 (patch)
tree844e95b50e2bc129403b679a6c5d63ff82940ad6 /src/model/bucket_table.rs
parent53f71b3a57b3c1828292e26b7865d31e9bec44d6 (diff)
downloadgarage-0bbb6673e7ce703e470a3c2aad620ee5f009bc84.tar.gz
garage-0bbb6673e7ce703e470a3c2aad620ee5f009bc84.zip
Model changes
Diffstat (limited to 'src/model/bucket_table.rs')
-rw-r--r--src/model/bucket_table.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/model/bucket_table.rs b/src/model/bucket_table.rs
index ac40407e..6ae719ae 100644
--- a/src/model/bucket_table.rs
+++ b/src/model/bucket_table.rs
@@ -1,4 +1,5 @@
use serde::{Deserialize, Serialize};
+use serde_bytes::ByteBuf;
use garage_table::crdt::Crdt;
use garage_table::*;
@@ -27,6 +28,11 @@ pub struct BucketParams {
pub creation_date: u64,
/// Map of key with access to the bucket, and what kind of access they give
pub authorized_keys: crdt::Map<String, BucketKeyPerm>,
+ /// Whether this bucket is allowed for website access
+ /// (under all of its global alias names)
+ pub website_access: crdt::Lww<bool>,
+ /// The website configuration XML document
+ pub website_config: crdt::Lww<Option<ByteBuf>>,
/// Map of aliases that are or have been given to this bucket
/// in the global namespace
/// (not authoritative: this is just used as an indication to
@@ -44,6 +50,8 @@ impl BucketParams {
BucketParams {
creation_date: now_msec(),
authorized_keys: crdt::Map::new(),
+ website_access: crdt::Lww::new(false),
+ website_config: crdt::Lww::new(None),
aliases: crdt::LwwMap::new(),
local_aliases: crdt::LwwMap::new(),
}
@@ -53,6 +61,8 @@ impl BucketParams {
impl Crdt for BucketParams {
fn merge(&mut self, o: &Self) {
self.authorized_keys.merge(&o.authorized_keys);
+ self.website_access.merge(&o.website_access);
+ self.website_config.merge(&o.website_config);
self.aliases.merge(&o.aliases);
self.local_aliases.merge(&o.local_aliases);
}