/// Exfiltrates the actions in the ActionsSchema.
///
/// This method will enumerate the actions in the ActionsSchema and determine
/// which Actions are included based on the directive. Actions only contain a
/// single tag so an Include directive implies that all other tags should be
/// excluded and an Exclude directive implies that all other tags should be
/// included.
Exfiltrates the actions in the ActionsSchema.
This method will enumerate the actions in the ActionsSchema and determine
which Actions are included based on the directive. Actions only contain a
single tag so an Include directive implies that all other tags should be
excluded and an Exclude directive implies that all other tags should be
included.
Exfiltrates the actions in the ActionsSchema . This method will enumerate the actions in the ActionsSchema and determine which Actions are included based on the directive . Actions only contain a single tag so an Include directive implies that all other tags should be excluded and an Exclude directive implies that all other tags should be included .
fn filter_actions(actions: ActionsSchema, action_directive: &ActionTagDirective) -> ActionsSchema {
    match action_directive {
        ActionTagDirective::AllowAll => actions,
        ActionTagDirective::Include(tags) => actions
            .into_iter()
            .filter(|(_, a)| match &a.tag {
                Some(tag) => tags.contains(tag),
                None => false,
            })
            .collect(),
        ActionTagDirective::Exclude(tags) => actions
            .into_iter()
            .filter(|(_, a)| match &a.tag {
                Some(tag) => !tags.contains(tag),
                None => true,
            })
            .collect(),
    }
}
fn filter_actions ( actions : ActionsSchema , action_directive : & ActionTagDirective ) -> ActionsSchema { match action_directive { ActionTagDirective :: AllowAll => actions , ActionTagDirective :: Include ( tags ) => actions . into_iter ( ) . filter ( | ( _ , a ) | match & a . tag { Some ( tag ) => tags . contains ( tag ) , None => false , } ) . collect ( ) , ActionTagDirective :: Exclude ( tags ) => actions . into_iter ( ) . filter ( | ( _ , a ) | match & a . tag { Some ( tag ) => ! tags . contains ( tag ) , None => true , } ) . collect ( ) , } }
Exfiltrates the actions in the ActionsSchema.
Exfiltrates the actions in the ActionsSchema .
actions
ActionsSchema
action_directive
&ActionTagDirective