pub fn validate_schema_path(
path: &str,
allowed_base: Option<&Path>,
) -> Result<(), ApiError>Expand description
Validate that a caller-supplied schema path is safe to open.
Two threats are guarded against:
- Path traversal — any component equal to
..would let an attacker escape the intended directory, so such paths are rejected. - Absolute-path escape — when an
allowed_baseis given, the resolved path must start with that prefix. An absolute path like/etc/passwdis rejected when the allowed base is/var/fraiseql.
§Errors
Returns ApiError with a validation error when the path is unsafe.