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