#[non_exhaustive]pub struct CommandTaxonomy {
pub allowed_test_commands: Vec<CommandPattern>,
pub allowed_build_commands: Vec<CommandPattern>,
pub allowed_lint_commands: Vec<CommandPattern>,
pub network_programs: Vec<String>,
pub shell_programs: Vec<String>,
pub package_managers: Vec<String>,
pub destructive_fragments: Vec<String>,
}Expand description
Command taxonomy and host-provided allowlists for coding policy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.allowed_test_commands: Vec<CommandPattern>Test command prefixes allowed without approval.
allowed_build_commands: Vec<CommandPattern>Build command prefixes allowed without approval.
allowed_lint_commands: Vec<CommandPattern>Lint command prefixes allowed without approval.
network_programs: Vec<String>Program names treated as network-capable.
shell_programs: Vec<String>Program names treated as shells.
package_managers: Vec<String>Program names treated as package managers.
destructive_fragments: Vec<String>Lowercase command fragments treated as destructive.
Implementations§
Source§impl CommandTaxonomy
impl CommandTaxonomy
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Constructs the conservative taxonomy with no test/build/lint allowlist.
Sourcepub fn with_allowed_test_command<I, S>(self, argv_prefix: I) -> Self
pub fn with_allowed_test_command<I, S>(self, argv_prefix: I) -> Self
Adds a test command allowlist prefix.
Sourcepub fn with_allowed_build_command<I, S>(self, argv_prefix: I) -> Self
pub fn with_allowed_build_command<I, S>(self, argv_prefix: I) -> Self
Adds a build command allowlist prefix.
Sourcepub fn with_allowed_lint_command<I, S>(self, argv_prefix: I) -> Self
pub fn with_allowed_lint_command<I, S>(self, argv_prefix: I) -> Self
Adds a lint command allowlist prefix.
Sourcepub fn classify_command(
&self,
request: &CommandRequest,
) -> Vec<CodingPolicyClass>
pub fn classify_command( &self, request: &CommandRequest, ) -> Vec<CodingPolicyClass>
Classifies one command request.
Trait Implementations§
Source§impl Clone for CommandTaxonomy
impl Clone for CommandTaxonomy
Source§impl Debug for CommandTaxonomy
impl Debug for CommandTaxonomy
Source§impl Default for CommandTaxonomy
impl Default for CommandTaxonomy
Source§impl<'de> Deserialize<'de> for CommandTaxonomywhere
CommandTaxonomy: Default,
impl<'de> Deserialize<'de> for CommandTaxonomywhere
CommandTaxonomy: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CommandTaxonomy
Source§impl PartialEq for CommandTaxonomy
impl PartialEq for CommandTaxonomy
Source§impl Serialize for CommandTaxonomy
impl Serialize for CommandTaxonomy
impl StructuralPartialEq for CommandTaxonomy
Auto Trait Implementations§
impl Freeze for CommandTaxonomy
impl RefUnwindSafe for CommandTaxonomy
impl Send for CommandTaxonomy
impl Sync for CommandTaxonomy
impl Unpin for CommandTaxonomy
impl UnsafeUnpin for CommandTaxonomy
impl UnwindSafe for CommandTaxonomy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.