Skip to main content

qubit_redact/http/
url_path_policy.rs

1// =============================================================================
2//    Copyright (c) 2025 - 2026 Haixing Hu.
3//
4//    SPDX-License-Identifier: Apache-2.0
5//
6//    Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! Policy for rendering URL paths in HTTP diagnostics.
9
10/// Controls whether complete URL paths remain visible after redaction.
11///
12/// This policy does not affect URL userinfo, fragments, or recognized
13/// sensitive query values. Non-root paths are redacted by default because path
14/// segments frequently contain opaque identifiers or credentials.
15#[must_use]
16#[non_exhaustive]
17#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
18pub enum UrlPathPolicy {
19    /// Preserves the complete URL path.
20    Preserve,
21    /// Replaces a non-root URL path with a fixed redaction marker.
22    #[default]
23    Redact,
24}