path_ratchet

Crates.iopath_ratchet
lib.rspath_ratchet
version0.3.0
sourcesrc
created_at2023-12-04 16:38:16.302383
updated_at2023-12-09 10:12:25.30921
descriptionPrevent path traversal attacks at type level
homepage
repositoryhttps://github.com/TheAlgorythm/path-ratchet
max_upload_size
id1057789
size21,307
zSchoen (TheAlgorythm)

documentation

https://docs.rs/crate/path_ratchet

README

Path Ratchet

LGPL 3.0 License Crates.io Workflow Status crev reviews

Prevent path traversal attacks at type level.

use std::path::PathBuf;
use path_ratchet::prelude::*;

let user_input = "/etc/shadow";
let mut filename = PathBuf::from("/tmp");
filename.push_component(SingleComponentPath::new(user_input).unwrap());
Commit count: 24

cargo fmt