qubit_redact/http/unkeyed_json_value_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 JSON scalar values without an object-field context.
9
10/// Controls whether unkeyed JSON scalar values are redacted or preserved.
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 UnkeyedJsonValuePolicy {
18 /// Replaces unkeyed scalar values with a fixed redaction marker.
19 #[default]
20 Redact,
21 /// Preserves unkeyed scalar values for diagnostics.
22 PassThrough,
23}