Expand description
EventSink wrapper that redacts nominated JSON fields before forwarding.
CloudEvents emitted by the supervisor can contain:
argv— command lines, which may include secrets passed as argumentspath— artifact and working-directory filesystem pathssecretRefs— names (not values) of secrets referenced by the cellreason— teardown error messages, which may contain paths or argv fragments
This sink wraps any Arc<dyn EventSink> and, before calling inner.emit(),
walks the CloudEventV1.data JSON tree replacing the values of nominated
top-level and nested field names with a fixed placeholder string.
§Activation
In the composition root, set CELLOS_REDACT_EVENT_FIELDS to a
comma-separated list of JSON field names to redact, e.g.:
CELLOS_REDACT_EVENT_FIELDS=argv,path,reasonUse CELLOS_REDACT_EVENT_FIELDS=defaults to apply the built-in
conservative set: argv,path,reason.
§Security notes
- Secret values never appear in events; only secret names (
secretRefs). - Redaction applies to the JSON value tree, not to CloudEvent metadata fields (id, source, type, time).
- The placeholder value is the fixed string
"[redacted]"for scalar values and["[redacted]"]for arrays; maps are replaced with{}. - An absent or empty
datafield is forwarded unchanged.
Structs§
- Redacting
Event Sink - Wraps an inner
EventSink, walking thedataJSON tree and replacing the values of any nominated field names with the placeholder"[redacted]".
Constants§
- DEFAULT_
REDACT_ FIELDS - The conservative default set of field names to redact.