feat: profile ALL filter all envelops
This commit is contained in:
@@ -173,8 +173,14 @@ impl TinyEncryptConfig {
|
||||
let mut key_ids = vec![];
|
||||
if key_filter.is_none() || profile.is_some() {
|
||||
let profile = profile.as_ref().map(String::as_str).unwrap_or("default");
|
||||
if let Some(kids) = self.profiles.get(profile) {
|
||||
kids.iter().for_each(|k| key_ids.push(k.to_string()));
|
||||
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) {
|
||||
kids.iter().for_each(|k| key_ids.push(k.to_string()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(key_filter) = key_filter {
|
||||
|
||||
Reference in New Issue
Block a user