WIP: Automatically create node layout, keys and buckets #883

Draft
apapsch wants to merge 6 commits from apapsch/garage:feature/auto-config into main
Showing only changes of commit 53a8d8e720 - Show all commits

View file

@ -201,30 +201,36 @@ pub struct AdminConfig {
pub trace_sink: Option<String>, pub trace_sink: Option<String>,
} }
/// Configuration to apply automatically /// Configuration to apply without manual intervention
#[derive(Deserialize, Debug, Clone, Default)] #[derive(Deserialize, Debug, Clone, Default)]
pub struct AutoConfig { pub struct AutoConfig {
/// Buckets to create automatically
pub buckets: Vec<AutoBucket>, pub buckets: Vec<AutoBucket>,
/// Keys to automatically create on startup /// Keys to create automatically
pub keys: Vec<AutoKey>, pub keys: Vec<AutoKey>,
/// Node layout to automatically configure. /// Node layout to create automatically
pub nodes: Vec<AutoNode>, pub nodes: Vec<AutoNode>,
} }
/// Key to create automatically /// Key to create automatically
#[derive(Deserialize, Debug, Clone, Default)] #[derive(Deserialize, Debug, Clone, Default)]
pub struct AutoKey { pub struct AutoKey {
/// Key name
pub name: String, pub name: String,
/// Key ID starting with GK
pub id: String, pub id: String,
/// Secret key
pub secret: String, pub secret: String,
} }
/// Bucket to create automatically /// Bucket to create automatically
#[derive(Deserialize, Debug, Clone, Default)] #[derive(Deserialize, Debug, Clone, Default)]
pub struct AutoBucket { pub struct AutoBucket {
/// Bucket name
pub name: String, pub name: String,
/// Permissions to grant on bucket to given keys
pub allow: Vec<AutoPermission>, pub allow: Vec<AutoPermission>,
} }