DLP core: the host-agnostic wire envelope for masked findings (idempotency keyed on tenant/device/event, never content), capture-mode policy, raw-capture leak-prevention types, and the pure land-path assembly (masked audit payload + notification body). Depends on infrastructure-dlp-detect; carries the pieces every DLP sensor host shares regardless of which OS adapters it wires.
| Tier | infrastructure |
| Role | unclassified (baselined) |
| Path | crates/infrastructure/dlp |
| Edition | 2021 |
| Targets | infrastructure_dlp |
| Public items | 16 across 3 modules |
| Tests | 11 |
What it is for
infrastructure-dlp — host-agnostic DLP core shared by every sensor host.
Sits above infrastructure_dlp_detect (the pure detector) and below whichever crate wires the OS-specific keyboard/clipboard/PTY adapters. It owns the parts that are identical regardless of that choice:
capture—CaptureModepolicy and theRawCaptureleak-prevention
type (R5/R6): raw bytes that cannot be serialized, cloned, or Debug-printed, and are zeroized on drop.
envelope— the masked-finding wireDlpFindingEnvelopewhose
idempotency key is (tenant, device, event) — never content-derived (R4).
land— pure assembly of the masked audit payload + notification body
from an envelope (the decidable half of the audit/notify land-path; the actual record_scoped/notification calls are wired by the consuming module).
Capabilities
CaptureMode
Capture-mode policy and the raw-capture leak-prevention type (T8, R5/R6).
| Item |
|---|
pub enum CaptureMode |
RawCapture
Capture-mode policy and the raw-capture leak-prevention type (T8, R5/R6).
| Item |
|---|
pub struct RawCapture |
RawCapture :: fn new(bytes : Vec <u8>) -> Self |
RawCapture :: fn expose(& self) -> & u8 |
RawCapture :: fn len(& self) -> usize |
RawCapture :: fn is_empty(& self) -> bool |
RawCapture :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result |
RawCapture :: fn drop(& mut self) |
DlpFindingEnvelope
The masked-finding wire envelope (T6, R4).
| Item |
|---|
pub struct DlpFindingEnvelope |
DlpFindingEnvelope :: fn idempotency_key(& self) -> String |
EnvFinding
The masked-finding wire envelope (T6, R4).
| Item |
|---|
pub struct EnvFinding |
Source
The masked-finding wire envelope (T6, R4).
| Item |
|---|
pub enum Source |
Source :: fn as_str(& self) -> & 'static str |
land (other)
Pure land-path assembly (T3): envelope → masked audit payload + notification
| Item |
|---|
pub const ACTION_DLP_DETECTED: & str |
fn audit_payload(env : & DlpFindingEnvelope) -> Value |
fn notification_body(env : & DlpFindingEnvelope) -> String |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
infrastructure_dlp
captureenvelopeland
flowchart TD n_infrastructure_dlp["infrastructure_dlp"] n_infrastructure_dlp --> n_capture["capture"] n_infrastructure_dlp --> n_envelope["envelope"] n_infrastructure_dlp --> n_land["land"]
Public surface
`capture`
| Item | What it is |
|---|---|
pub enum CaptureMode | How much a sensor retains |
pub struct RawCapture | Owner of raw captured bytes for CaptureMode::Raw |
RawCapture :: fn new(bytes : Vec <u8>) -> Self | Wrap raw bytes |
RawCapture :: fn expose(& self) -> & u8 | Explicit, deliberately named access to the raw bytes |
RawCapture :: fn len(& self) -> usize | Number of raw bytes held. |
RawCapture :: fn is_empty(& self) -> bool | Whether the buffer is empty. |
RawCapture :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result | — |
RawCapture :: fn drop(& mut self) | — |
`envelope`
| Item | What it is |
|---|---|
pub enum Source | Which sensor produced a finding. |
Source :: fn as_str(& self) -> & 'static str | Stable machine label. |
pub struct EnvFinding | The masked finding as it travels on the wire — masked-only, never raw. |
pub struct DlpFindingEnvelope | A host-side masked finding plus routing/idempotency metadata |
DlpFindingEnvelope :: fn idempotency_key(& self) -> String | Idempotency key: tenant:device:event |
`land`
| Item | What it is |
|---|---|
pub const ACTION_DLP_DETECTED: & str | The stable audit action for a DLP detection |
fn audit_payload(env : & DlpFindingEnvelope) -> Value | Build the masked metadata payload for the immutable audit record |
fn notification_body(env : & DlpFindingEnvelope) -> String | Build the operator-facing notification body |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
infrastructure_dlp_detectasdetect | infrastructure_dlp_detectasdetect |
{CaptureMode,RawCapture} | capture::{CaptureMode,RawCapture} |
{DlpFindingEnvelope,EnvFinding,Source} | envelope::{DlpFindingEnvelope,EnvFinding,Source} |
{audit_payload,notification_body} | land::{audit_payload,notification_body} |
Boundary
Depends on no other workspace tier.
Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | infrastructure |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/infrastructure/dlp |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `infrastructure-dlp-detect` | infrastructure | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
zeroize | ^1 | — | no | always |
Development. None.
Build. None.
Depended on by. 4 workspace crates.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_application_dlp["application-dlp"] -->|uses| SELF n_operations_dlp_agent["operations-dlp-agent"] -->|uses| SELF n_operations_dlp_sensor["operations-dlp-sensor"] -->|uses| SELF n_platform_privacy_scan_api["platform-privacy-scan-api"] -->|uses| SELF SELF["infrastructure-dlp"] SELF -->|runtime| n_infrastructure_dlp_detect["infrastructure-dlp-detect"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | infrastructure_dlp | `src/lib.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
4 workspace crates depend on this one: application-dlp, operations-dlp-agent, operations-dlp-sensor, platform-privacy-scan-api.
Verification
| Kind | Count |
|---|---|
| Unit tests | 11 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
capture | 2 | 0 | 6 |
envelope | 3 | 0 | 11 |
land | 3 | 0 | 1 |
What the tests establish, by name:
capture_mode_defaults_to_masked_only—src/capture.rscapture_mode_serde_snake_case—src/capture.rsraw_debug_is_redacted_never_leaks_contents—src/capture.rsraw_expose_is_the_only_reader—src/capture.rsai_prompt_source_label_and_serde—src/envelope.rsdistinct_events_have_distinct_keys—src/envelope.rsenvelope_serde_round_trips—src/envelope.rsidempotency_key_is_tenant_device_event_not_content—src/envelope.rsaction_constant_is_dlp_detected—src/land.rsaudit_payload_is_masked_and_keyed—src/land.rsnotification_body_is_masked_snippet_only—src/land.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 14 | 16 |
Public modules with a //! block | 3 | 3 |
pie showData
title Public items with rustdoc
"Documented" : 14
"No rustdoc detected" : 2
Metrics
| Metric | Value |
|---|---|
| Rust source files | 4 |
| Source lines | 384 |
| Code lines | 255 |
| Public API items | 16 |
| Public modules | 3 |
| Tests | 11 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 4 |
| Workspace reverse dependencies | 4 |
pie showData
title Public API by kind
"constant" : 1
"enum" : 2
"function" : 2
"method" : 8
"struct" : 3
pie showData
title Rust source composition
"Code" : 255
"Blank or comment" : 129
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.