Class AdapterRedactionPolicy
The policy is stateless, immutable, and thread-safe. It is used by public report, status, audit, evidence, result, and configuration records before adapter-provided metadata is exposed to callers. The policy redacts both sensitive metadata keys and credential-like values under otherwise harmless keys. TCK runners can additionally detect the redaction marker to reject adapters that attempted to place sensitive data in public compatibility reports.
The policy is deliberately vendor-neutral. It does not parse or validate external product credentials and does not treat a redacted report as proof of authorization. Implementations remain responsible for normalizing public errors and for avoiding raw credential values in exception messages.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsRedactionMarker(Object value) Returns whether public text contains the redaction marker.static booleancontainsSensitiveValue(String value) Returns whether a text value contains a sentinel or credential-like value that must not appear in public adapter output.static booleanisSensitiveKey(String key) Returns whether a metadata key is sensitive.static booleanReturns whether public text still contains a configured sensitive sentinel.redactMetadata(Map<String, String> values) Redacts a metadata map.static StringredactText(String value) Redacts sensitive value patterns from public text.
-
Field Details
-
REDACTED
Public marker used when a sensitive key or value is redacted.- See Also:
-
-
Method Details
-
isSensitiveKey
Returns whether a metadata key is sensitive.- Parameters:
key- metadata key to inspect- Returns:
truewhen the key must not expose its value
-
containsSensitiveValue
Returns whether a text value contains a sentinel or credential-like value that must not appear in public adapter output.- Parameters:
value- text value to inspect- Returns:
truewhen the text contains sensitive data
-
redactText
-
redactMetadata
-
publicTextLeaksSensitiveValue
Returns whether public text still contains a configured sensitive sentinel.- Parameters:
value- public value to inspect- Returns:
truewhen a sensitive sentinel remains visible
-
containsRedactionMarker
Returns whether public text contains the redaction marker.The TCK uses this signal on scenario and failure-mode report metadata to reject adapters that attempted to place sensitive data in compatibility evidence. The marker itself is safe for callers.
- Parameters:
value- public value to inspect- Returns:
truewhen the redaction marker is present
-