Skip to main content

qubit_redact/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#[must_use]
15#[non_exhaustive]
16#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
17pub enum TextBodyPolicy {
18    /// Replaces opaque text with a redaction marker.
19    #[default]
20    Redact,
21    /// Preserves opaque text for diagnostics.
22    PassThrough,
23}