Skip to main content

qubit_redact/formats/http/
text_body_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 HTTP text bodies that lack structured fields.
9
10/// Controls whether opaque HTTP text is redacted or rendered unchanged.
11///
12/// [`Self::Redact`] is the safe default. [`Self::PassThrough`] is an explicit
13/// diagnostic opt-in and may expose application secrets.
14///
15/// # Examples
16///
17/// ```
18/// use qubit_redact::formats::http::TextBodyPolicy;
19///
20/// assert_eq!(TextBodyPolicy::default(), TextBodyPolicy::Redact);
21/// ```
22#[non_exhaustive]
23#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
24pub enum TextBodyPolicy {
25    /// Replaces opaque text with a redaction marker.
26    #[default]
27    Redact,
28    /// Preserves opaque text for diagnostics.
29    PassThrough,
30}