MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / validate_resolved_secret

Function validate_resolved_secret

crates/openshell-core/src/secrets.rs:544–552  ·  view source on GitHub ↗

Validate that a resolved secret value does not contain characters that could enable HTTP header injection or request splitting.

(value: &str)

Source from the content-addressed store, hash-verified

542/// Validate that a resolved secret value does not contain characters that
543/// could enable HTTP header injection or request splitting.
544fn validate_resolved_secret(value: &str) -> Result<&str, &'static str> {
545 if value
546 .bytes()
547 .any(|b| b == b'\r' || b == b'\n' || b == b'\0')
548 {
549 return Err("resolved secret contains prohibited control characters (CR, LF, or NUL)");
550 }
551 Ok(value)
552}
553
554// ---------------------------------------------------------------------------
555// Percent encoding/decoding (RFC 3986)

Callers 1

resolve_placeholderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected