mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-10 07:06:53 +00:00
add bucket notification configuration (#502)
This commit is contained in:
@@ -69,7 +69,7 @@ impl EventNotifier {
|
||||
target_list_guard
|
||||
.keys()
|
||||
.iter()
|
||||
.map(|target_id| target_id.to_arn(region).to_arn_string())
|
||||
.map(|target_id| target_id.to_arn(region).to_string())
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
||||
@@ -101,8 +101,8 @@ impl BucketNotificationConfig {
|
||||
for target_id in target_id_set {
|
||||
// Construct the ARN string for this target_id and self.region
|
||||
let arn_to_check = target_id.to_arn(&self.region); // Assuming TargetID has to_arn
|
||||
if !arn_list.contains(&arn_to_check.to_arn_string()) {
|
||||
return Err(BucketNotificationConfigError::ArnNotFound(arn_to_check.to_arn_string()));
|
||||
if !arn_list.contains(&arn_to_check.to_string()) {
|
||||
return Err(BucketNotificationConfigError::ArnNotFound(arn_to_check.to_string()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ impl QueueConfig {
|
||||
// Validate ARN (similar to Go's Queue.Validate)
|
||||
// The Go code checks targetList.Exists(q.ARN.TargetID)
|
||||
// Here we check against a provided arn_list
|
||||
let _config_arn_str = self.arn.to_arn_string();
|
||||
let _config_arn_str = self.arn.to_string();
|
||||
if !self.arn.region.is_empty() && self.arn.region != region {
|
||||
return Err(ParseConfigError::UnknownRegion(self.arn.region.clone()));
|
||||
}
|
||||
@@ -187,8 +187,8 @@ impl QueueConfig {
|
||||
partition: self.arn.partition.clone(), // or default "rustfs"
|
||||
};
|
||||
|
||||
if !arn_list.contains(&effective_arn.to_arn_string()) {
|
||||
return Err(ParseConfigError::ArnNotFound(effective_arn.to_arn_string()));
|
||||
if !arn_list.contains(&effective_arn.to_string()) {
|
||||
return Err(ParseConfigError::ArnNotFound(effective_arn.to_string()));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -266,7 +266,7 @@ impl NotificationConfiguration {
|
||||
queue_config.validate(current_region, arn_list)?;
|
||||
let queue_key = (
|
||||
queue_config.id.clone(),
|
||||
queue_config.arn.to_arn_string(), // Assuming that the ARN structure implements Display or ToString
|
||||
queue_config.arn.to_string(), // Assuming that the ARN structure implements Display or ToString
|
||||
);
|
||||
if !unique_queues.insert(queue_key.clone()) {
|
||||
return Err(ParseConfigError::DuplicateQueueConfiguration(queue_key.0, queue_key.1));
|
||||
|
||||
Reference in New Issue
Block a user