aboutsummaryrefslogtreecommitdiff
path: root/src/garage/cli
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/garage/cli
parent53f71b3a57b3c1828292e26b7865d31e9bec44d6 (diff)
downloadgarage-0bbb6673e7ce703e470a3c2aad620ee5f009bc84.tar.gz
garage-0bbb6673e7ce703e470a3c2aad620ee5f009bc84.zip
Model changes
Diffstat (limited to 'src/garage/cli')
-rw-r--r--src/garage/cli/cmd.rs3
-rw-r--r--src/garage/cli/structs.rs5
-rw-r--r--src/garage/cli/util.rs7
3 files changed, 11 insertions, 4 deletions
diff --git a/src/garage/cli/cmd.rs b/src/garage/cli/cmd.rs
index 015eeec9..b7508e45 100644
--- a/src/garage/cli/cmd.rs
+++ b/src/garage/cli/cmd.rs
@@ -164,8 +164,7 @@ pub async fn cmd_admin(
let mut table = vec![];
for alias in bl {
if let Some(p) = alias.state.get().as_option() {
- let wflag = if p.website_access { "W" } else { " " };
- table.push(format!("{}\t{}\t{:?}", wflag, alias.name, p.bucket_id));
+ table.push(format!("\t{}\t{:?}", alias.name, p.bucket_id));
}
}
format_table(table);
diff --git a/src/garage/cli/structs.rs b/src/garage/cli/structs.rs
index 590be1c0..1905069e 100644
--- a/src/garage/cli/structs.rs
+++ b/src/garage/cli/structs.rs
@@ -238,6 +238,11 @@ pub struct PermBucketOpt {
#[structopt(long = "write")]
pub write: bool,
+ /// Allow/deny administrative operations operations
+ /// (such as deleting bucket or changing bucket website configuration)
+ #[structopt(long = "owner")]
+ pub owner: bool,
+
/// Bucket name
pub bucket: String,
}
diff --git a/src/garage/cli/util.rs b/src/garage/cli/util.rs
index ba88502d..f586d55b 100644
--- a/src/garage/cli/util.rs
+++ b/src/garage/cli/util.rs
@@ -11,6 +11,7 @@ pub fn print_key_info(key: &Key) {
println!("Secret key: {}", key.secret_key);
match &key.state {
Deletable::Present(p) => {
+ println!("Can create buckets: {}", p.allow_create_bucket.get());
println!("\nKey-specific bucket aliases:");
let mut table = vec![];
for (alias_name, _, alias) in p.local_aliases.items().iter() {
@@ -25,7 +26,8 @@ pub fn print_key_info(key: &Key) {
for (b, perm) in p.authorized_buckets.items().iter() {
let rflag = if perm.allow_read { "R" } else { " " };
let wflag = if perm.allow_write { "W" } else { " " };
- table.push(format!("\t{}{}\t{:?}", rflag, wflag, b));
+ let oflag = if perm.allow_owner { "O" } else { " " };
+ table.push(format!("\t{}{}{}\t{:?}", rflag, wflag, oflag, b));
}
format_table(table);
}
@@ -58,7 +60,8 @@ pub fn print_bucket_info(bucket: &Bucket) {
for (k, perm) in p.authorized_keys.items().iter() {
let rflag = if perm.allow_read { "R" } else { " " };
let wflag = if perm.allow_write { "W" } else { " " };
- println!("- {}{} {}", rflag, wflag, k);
+ let oflag = if perm.allow_owner { "O" } else { " " };
+ println!("- {}{}{} {}", rflag, wflag, oflag, k);
}
}
};