Skip to main content

cloud_sdk/operation/prepared/
body.rs

1//! Prepared request-body security and replay policy.
2
3/// Whether one prepared request body can be sent again byte-for-byte.
4#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5pub enum BodyReplayability {
6    /// The body source cannot guarantee an identical subsequent read.
7    NotReplayable,
8    /// The complete body is an immutable byte snapshot for the request lifetime.
9    Replayable,
10}
11
12/// Whether a prepared request body contains caller-designated sensitive data.
13#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14pub enum RequestBodySensitivity {
15    /// The body has no provider-declared confidential fields.
16    Public,
17    /// The body contains confidential material and requires digest fingerprints.
18    Sensitive,
19}
20
21impl RequestBodySensitivity {
22    /// Reports whether exact canonical fingerprint retention is forbidden.
23    #[must_use]
24    pub const fn requires_digest(self) -> bool {
25        matches!(self, Self::Sensitive)
26    }
27}