Skip to main content

allow_report/
lib.rs

1//! Human and machine artifact rendering for cargo-allow.
2//!
3//! This crate renders reports, receipts, PR summaries, explanations, lists,
4//! worklists, migration summaries, SARIF, and HTML while preserving the
5//! source-tree claim boundary. Renderers describe what cargo-allow scanned and
6//! what it did not execute; they do not perform scanning or validation.
7
8mod add;
9#[cfg(test)]
10mod add_tests;
11mod allow_entry_json;
12#[cfg(test)]
13mod allow_entry_json_tests;
14mod artifacts;
15mod audit_remediation;
16mod contracts;
17mod diff;
18mod diff_finding_detail;
19mod diff_human;
20mod diff_json;
21mod diff_markdown;
22mod diff_policy_detail;
23mod diff_posture;
24mod doctor;
25#[cfg(test)]
26mod doctor_tests;
27mod evidence_reference_human;
28mod evidence_repair;
29mod explain;
30mod explain_common;
31mod explain_human;
32mod explain_json;
33#[cfg(test)]
34mod explain_tests;
35mod html;
36#[cfg(test)]
37mod html_tests;
38mod json;
39#[cfg(test)]
40mod json_tests;
41mod list;
42#[cfg(test)]
43mod list_tests;
44mod migrate;
45#[cfg(test)]
46mod migrate_tests;
47mod non_rust;
48mod path_text;
49#[cfg(test)]
50mod path_text_tests;
51mod propose;
52#[cfg(test)]
53mod propose_tests;
54mod prune;
55#[cfg(test)]
56mod prune_tests;
57mod receipt;
58#[cfg(test)]
59mod receipt_tests;
60mod report_json;
61mod report_text;
62mod sarif;
63#[cfg(test)]
64mod sarif_tests;
65mod source_inventory;
66mod summary;
67mod text;
68mod worklist;
69mod worklist_human;
70mod worklist_json;
71mod worklist_summary;
72
73pub use add::{render_add_human, render_add_json};
74pub use allow_entry_json::{render_allow_entry_json, render_last_seen_json, render_selector_json};
75pub use artifacts::{
76    AddReport, DiffEvidenceChange, DiffExceptionIdentityChange, DiffFindingChange,
77    DiffLifecycleChange, DiffMetadataChange, DiffOccurrenceLimitChange, DiffPolicyChange,
78    DiffPolicyStatusChange, DiffPostureSummary, DiffReport, DiffRequirementChange, DiffScopeChange,
79    DiffSelectorIdentityChange, DiffSelectorPrecisionChange, DoctorReport, EvidenceReference,
80    ExplainReport, ListFilters, ListRow, MigrateReport, ProposeReport, PruneCandidate,
81    PruneModeContext, WorklistFilters, WorklistItem,
82};
83pub use contracts::{
84    ADD_SCHEMA_ID, ADD_SCHEMA_VERSION, ARTIFACT_CONTRACTS, ARTIFACT_STATUS_FAILED,
85    ARTIFACT_STATUS_PASSED, ARTIFACT_STATUSES, ArtifactContract, CLAIM_BOUNDARY,
86    CLAIM_BOUNDARY_TEXT, DOCTOR_SCHEMA_ID, DOCTOR_SCHEMA_VERSION, EXPLAIN_SCHEMA_ID,
87    EXPLAIN_SCHEMA_VERSION, INVENTORY_SCANNER_POLICY_MIGRATION, INVENTORY_SCANNER_SOURCE_SYNTAX,
88    INVENTORY_SCANNER_SOURCE_TREE_GRAPH, INVENTORY_SCOPE_SOURCE_TREE, INVENTORY_SOURCE_UNKNOWN,
89    InventoryContext, LIST_SCHEMA_ID, LIST_SCHEMA_VERSION, MIGRATE_SCHEMA_ID,
90    MIGRATE_SCHEMA_VERSION, PROPOSE_SCHEMA_ID, PROPOSE_SCHEMA_VERSION, PRUNE_SCHEMA_ID,
91    PRUNE_SCHEMA_VERSION, RECEIPT_COMMAND_CHECK, RECEIPT_SCHEMA_ID, RECEIPT_SCHEMA_VERSION,
92    REPORT_COMMAND_AUDIT, REPORT_COMMAND_CHECK, REPORT_COMMAND_DIFF, REPORT_COMMANDS,
93    REPORT_SCHEMA_ID, REPORT_SCHEMA_VERSION, ReportContext, SCANNER_LIMITATIONS,
94    SPEC_SYSTEM_CLAIM_BOUNDARY, SPEC_SYSTEM_SCANNER_LIMITATIONS, SPEC_SYSTEM_SCHEMA_ID,
95    SPEC_SYSTEM_SCHEMA_VERSION, WORKLIST_SCHEMA_ID, WORKLIST_SCHEMA_VERSION,
96    artifact_contract_for_schema_id, claim_boundary_for_schema_id,
97    scanner_limitations_for_schema_id,
98};
99pub use diff::{
100    DiffNetPosture, diff_net_posture, diff_posture_summary, insert_markdown_pr_summary,
101    render_diff_finding_changes_human, render_diff_finding_changes_markdown,
102    render_diff_json_with_posture, render_diff_policy_changes_human,
103    render_diff_policy_changes_markdown, render_diff_posture_summary_human,
104    render_diff_posture_summary_human_with_evidence_health,
105    render_diff_posture_summary_human_with_evidence_health_counts, render_diff_pr_summary_markdown,
106    render_diff_pr_summary_markdown_with_evidence_health,
107    render_diff_pr_summary_markdown_with_evidence_health_counts,
108};
109pub use doctor::{render_doctor_human, render_doctor_json};
110pub(crate) use explain::finding_location_text;
111pub use explain::{render_explain_finding_json, render_explain_human, render_explain_json};
112pub use html::{render_html, render_html_with_context};
113pub use json::{
114    render_claim_boundary_json, render_inventory_json, render_scanner_limitations_json,
115};
116pub use list::{render_list_human, render_list_json};
117pub use migrate::{render_migrate_human, render_migrate_json};
118pub use path_text::source_tree_path_text;
119pub use propose::{render_propose_human, render_propose_json};
120pub use prune::{render_prune_human, render_prune_human_with_context, render_prune_json};
121pub use receipt::{
122    render_receipt, render_receipt_with_context, render_receipt_with_context_and_inventory,
123};
124pub use report_json::{render_json, render_json_with_context, render_json_with_context_and_diff};
125pub use report_text::{
126    render_human, render_human_with_context, render_markdown, render_markdown_with_context,
127};
128pub use sarif::{render_sarif, render_sarif_with_context};
129pub use summary::{
130    Summary, matched_policy_missing_evidence_entries, policy_baseline_debt_entries,
131    policy_missing_evidence_entries,
132};
133pub use worklist::{render_worklist_human, render_worklist_json};
134
135pub(crate) use non_rust::{FilePosture, non_rust_file_rows};
136pub(crate) use source_inventory::{
137    render_source_inventory_html, render_source_inventory_human, render_source_inventory_json,
138    render_source_inventory_markdown,
139};
140pub(crate) use summary::{
141    AUDIT_REVIEW_QUEUE_STATUSES, ReviewSignals, STATUS_COUNT_ORDER, audit_review_queue,
142    baseline_debt_count, broken_evidence_link_count, policy_missing_evidence_count,
143    render_count_fields_with_policy_context, weak_evidence_reference_count,
144};
145
146#[cfg(test)]
147mod diff_human_tests;
148#[cfg(test)]
149mod diff_json_detail_tests;
150#[cfg(test)]
151mod diff_json_tests;
152#[cfg(test)]
153mod diff_markdown_tests;
154#[cfg(test)]
155mod schema_tests;
156#[cfg(test)]
157mod text_tests;
158#[cfg(test)]
159mod worklist_tests;