mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 16:28:15 +00:00
test accountinfo
This commit is contained in:
@@ -2,6 +2,7 @@ use crate::error::{Error, Result};
|
||||
// use rmp_serde::Serializer as rmpSerializer;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
use std::collections::HashSet;
|
||||
|
||||
use super::{
|
||||
action::{Action, ActionSet, IAMActionConditionKeyMap},
|
||||
@@ -35,11 +36,11 @@ pub struct BPStatement {
|
||||
pub principal: Principal,
|
||||
#[serde(rename = "Action")]
|
||||
pub actions: ActionSet,
|
||||
#[serde(rename = "NotAction", default)]
|
||||
#[serde(rename = "NotAction", skip_serializing_if = "ActionSet::is_empty")]
|
||||
pub not_actions: ActionSet,
|
||||
#[serde(rename = "Resource")]
|
||||
#[serde(rename = "Resource", skip_serializing_if = "ResourceSet::is_empty")]
|
||||
pub resources: ResourceSet,
|
||||
#[serde(rename = "Condition", default)]
|
||||
#[serde(rename = "Condition", skip_serializing_if = "Functions::is_empty")]
|
||||
pub conditions: Functions,
|
||||
}
|
||||
|
||||
|
||||
@@ -106,6 +106,9 @@ impl Functions {
|
||||
}
|
||||
set
|
||||
}
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.0.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
impl Debug for Functions {
|
||||
|
||||
@@ -228,6 +228,10 @@ impl ResourceSet {
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.0.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<HashSet<Resource>> for ResourceSet {
|
||||
|
||||
@@ -135,7 +135,7 @@ impl Operation for AccountInfoHandler {
|
||||
statements: vec![BPStatement {
|
||||
sid: "".to_owned(),
|
||||
effect: Effect::Allow,
|
||||
actions: ActionSet(s3_all_act),
|
||||
actions: ActionSet(s3_all_act.clone()),
|
||||
resources: ResourceSet(all_res),
|
||||
..Default::default()
|
||||
}],
|
||||
|
||||
Reference in New Issue
Block a user