feat: profile ALL filter all envelops
This commit is contained in:
@@ -173,10 +173,16 @@ impl TinyEncryptConfig {
|
|||||||
let mut key_ids = vec![];
|
let mut key_ids = vec![];
|
||||||
if key_filter.is_none() || profile.is_some() {
|
if key_filter.is_none() || profile.is_some() {
|
||||||
let profile = profile.as_ref().map(String::as_str).unwrap_or("default");
|
let profile = profile.as_ref().map(String::as_str).unwrap_or("default");
|
||||||
|
if profile == "ALL" {
|
||||||
|
self.envelops.iter().for_each(|e| {
|
||||||
|
key_ids.push(e.kid.to_string());
|
||||||
|
});
|
||||||
|
} else {
|
||||||
if let Some(kids) = self.profiles.get(profile) {
|
if let Some(kids) = self.profiles.get(profile) {
|
||||||
kids.iter().for_each(|k| key_ids.push(k.to_string()));
|
kids.iter().for_each(|k| key_ids.push(k.to_string()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if let Some(key_filter) = key_filter {
|
if let Some(key_filter) = key_filter {
|
||||||
key_filter.split(',').for_each(|k| {
|
key_filter.split(',').for_each(|k| {
|
||||||
let k = k.trim();
|
let k = k.trim();
|
||||||
|
|||||||
Reference in New Issue
Block a user