mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-28 07:57:02 +00:00
New buckets for 0.6.0: fix model and migration
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_bytes::ByteBuf;
|
||||
|
||||
use garage_table::crdt::Crdt;
|
||||
use garage_table::*;
|
||||
@@ -8,8 +7,6 @@ use garage_util::time::*;
|
||||
|
||||
use crate::permission::BucketKeyPerm;
|
||||
|
||||
pub const DEFAULT_WEBSITE_CONFIGURATION: &[u8] = b""; // TODO (an XML WebsiteConfiguration document per the AWS spec)
|
||||
|
||||
/// A bucket is a collection of objects
|
||||
///
|
||||
/// Its parameters are not directly accessible as:
|
||||
@@ -33,7 +30,7 @@ pub struct BucketParams {
|
||||
/// Whether this bucket is allowed for website access
|
||||
/// (under all of its global alias names),
|
||||
/// and if so, the website configuration XML document
|
||||
pub website_config: crdt::Lww<Option<ByteBuf>>,
|
||||
pub website_config: crdt::Lww<Option<WebsiteConfig>>,
|
||||
/// 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
|
||||
@@ -45,6 +42,18 @@ pub struct BucketParams {
|
||||
pub local_aliases: crdt::LwwMap<(String, String), bool>,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
|
||||
pub enum WebsiteConfig {
|
||||
RedirectAll {
|
||||
hostname: String,
|
||||
protocol: String,
|
||||
},
|
||||
Website {
|
||||
index_document: String,
|
||||
error_document: Option<String>,
|
||||
},
|
||||
}
|
||||
|
||||
impl BucketParams {
|
||||
/// Create an empty BucketParams with no authorized keys and no website accesss
|
||||
pub fn new() -> Self {
|
||||
|
||||
Reference in New Issue
Block a user