MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / validate_session

Function validate_session

libatomic/src/review/incremental.rs:170–176  ·  view source on GitHub ↗
(id: &str)

Source from the content-addressed store, hash-verified

168}
169
170fn validate_session(id: &str) -> CliResult<()> {
171 // Match SessionStore's path-component contract even when no store exists.
172 if id.is_empty() || id.len() > 255 || id.contains("..") || id.contains(['/', '\\', '\0']) {
173 return Err(invalid("Invalid session ID in turn/session context"));
174 }
175 Ok(())
176}
177
178fn parse_turn(input: &str) -> CliResult<(&str, u32)> {
179 let (session, number) = input

Callers 2

parse_turnFunction · 0.85
runtime_sessionFunction · 0.85

Calls 4

invalidFunction · 0.70
is_emptyMethod · 0.45
lenMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected