Skip to content

typed-path 0.8.0

Latest
Compare
Choose a tag to compare
@chipsenkbeil chipsenkbeil released this 25 Feb 03:01
2eadf1b

Notable Changes

  • Add push_checked function, which ensures that any path added to an existing PathBuf or TypedPathBuf must abide by the following rules:
    1. It cannot be an absolute path. Only relative paths allowed.
    2. In the case of Windows, it cannot start with a prefix like C:.
    3. All normal components of the path must contain only valid characters.
    4. If parent directory (..) components are present, they must not result in a path traversal attack (impacting the current path).
  • Add join_checked function, which ensures that any path joied with an existing path follows the rules of push_checked
  • Add with_encoding_checked function to ensure that the resulting path from an encoding conversion is still valid
  • Add with_unix_encoding_checked and with_windows_encoding_checked functions as shortcuts to with_encoding_checked
  • Add is_valid to Component and Utf8Component traits alongside Path and Utf8Path to indicate if a component/path is valid for the given encoding