Skip to main content

PolicyGenerator

Struct PolicyGenerator 

Source
pub struct PolicyGenerator { /* private fields */ }

Implementations§

Source§

impl PolicyGenerator

Source§

impl PolicyGenerator

Source

pub fn skill_name(&self) -> &str

The name of the skill being analyzed.

Source

pub fn skill_path(&self) -> &str

Path to the primary skill artifact.

Source

pub fn primary_artifact_kind(&self) -> ArtifactKind

The artifact kind of the primary entrypoint.

Source

pub fn extension_kind(&self) -> AgentExtensionKind

The extension kind (Skill, AgentInstruction, etc.).

Source

pub fn classification(&self) -> ArtifactClassification

The artifact classification result.

Source

pub fn package_id(&self) -> Option<&str>

Optional package identifier.

Source

pub fn identity_source(&self) -> ArtifactIdentitySource

How the artifact identity was determined.

Source

pub fn structural_validity(&self) -> StructuralValidity

Structural validity of the analyzed artifact.

Source

pub fn heuristic_score(&self) -> u8

Heuristic score assigned during analysis.

Source

pub fn findings(&self) -> &[Finding]

The findings produced by analysis.

Source

pub fn artifact_graph(&self) -> &ArtifactGraph

The artifact dependency/capability graph.

Source

pub fn profile(&self) -> Option<PolicyProfile>

The active policy profile, if any.

Source

pub fn policy(&self) -> Option<&PolicyFile>

The loaded policy file, if any.

Source

pub fn suppression_summary(&self) -> &SuppressionSummary

Summary of suppressed findings.

Source

pub fn policy_audit(&self) -> &PolicyAudit

The policy audit trail.

Source

pub fn verdict_report(&self) -> Option<&PackageVerdictReport>

Pre-computed verdict report, if available.

Source

pub fn new( skill_name: impl Into<String>, skill_path: impl Into<String>, findings: Vec<Finding>, artifact_graph: ArtifactGraph, ) -> Self

Source

pub fn with_primary_artifact_kind(self, artifact_kind: ArtifactKind) -> Self

Source

pub fn with_profile(self, profile: PolicyProfile) -> Self

Source

pub fn with_extension_kind(self, extension_kind: AgentExtensionKind) -> Self

Source

pub fn with_classification(self, classification: ArtifactClassification) -> Self

Source

pub fn with_package_id(self, package_id: Option<String>) -> Self

Source

pub fn with_identity_source( self, identity_source: ArtifactIdentitySource, ) -> Self

Source

pub fn with_structural_validity( self, structural_validity: StructuralValidity, ) -> Self

Source

pub fn with_heuristic_score(self, heuristic_score: u8) -> Self

Source

pub fn with_policy(self, policy: PolicyFile) -> Self

Source

pub fn with_suppression_summary( self, suppression_summary: SuppressionSummary, ) -> Self

Source

pub fn with_policy_audit(self, policy_audit: PolicyAudit) -> Self

Source

pub fn with_verdict_report(self, verdict_report: PackageVerdictReport) -> Self

Source

pub fn generate_shield_md(&self) -> String

Source

pub fn generate_json(&self) -> JsonReport

Source

pub fn generate_sarif(&self) -> SarifReport

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more