Skip to main content

session_id

Function session_id 

Source
pub fn session_id(id: &str) -> Result<()>
Expand description

Validate that a session ID is safe for use in file paths and CLI arguments.

Session IDs are generated as UUIDs internally, but external callers (server API, MCP, CLI prefix lookups) can supply arbitrary strings. This rejects path traversal (../), shell metacharacters, and anything that isn’t alphanumeric or a hyphen.