Skip to content

Commit 2377872

Browse files
committed
feat(ci): CI-10 secret and credential leak scan step generator
1 parent 883855c commit 2377872

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//! Secret / Credential Leak Scan Step Generator — CI-10
2+
//!
3+
//! Always emitted regardless of platform or language. Gitleaks runs on the
4+
//! repository checkout — no Docker image or build artifact required.
5+
6+
use crate::generator::ci_generation::schema::SecretScanStep;
7+
8+
/// Returns a `SecretScanStep`. Unconditional — every pipeline gets this step.
9+
pub fn generate_secret_scan_step() -> SecretScanStep {
10+
SecretScanStep
11+
}
12+
13+
// ── Tests ─────────────────────────────────────────────────────────────────────
14+
15+
#[cfg(test)]
16+
mod tests {
17+
use super::*;
18+
19+
#[test]
20+
fn test_secret_scan_step_is_always_produced() {
21+
// SecretScanStep is a unit struct — constructing it succeeds and
22+
// confirms the function returns without conditions.
23+
let _ = generate_secret_scan_step();
24+
}
25+
26+
#[test]
27+
fn test_secret_scan_step_serializes() {
28+
let step = generate_secret_scan_step();
29+
let serialized = serde_json::to_string(&step);
30+
assert!(serialized.is_ok());
31+
}
32+
}

0 commit comments

Comments
 (0)