keyhog 0.5.73

GPU-accelerated secret scanner for code, Git history, cloud, containers, browser assets, and live credential verification
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! `redact_url_target`, relocated out of `crate::reporting` (the
//! `reporting_no_inline_tests` gate forbids inline `#[cfg(test)]`). Reached
//! through the `crate::testing` facade.

use keyhog::testing::{CliTestApi as _, API};

#[test]
fn url_targets_hide_queries_and_fragments() {
    assert_eq!(
        API.redact_url_target("https://example.com/app.js?token=secret#frag"),
        "https://example.com/app.js?<redacted>"
    );
    assert_eq!(
        API.redact_url_target("https://example.com/app.js#frag"),
        "https://example.com/app.js"
    );
}