Skip to content

Commit 18216e9

Browse files
committed
bumped crate to version v0.0.4
1 parent 5a601c2 commit 18216e9

File tree

5 files changed

+30
-24
lines changed

5 files changed

+30
-24
lines changed

CHANGELOG.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12+
## [0.0.4] - 2025-08-03
13+
1214
### Added
13-
- Virtual root display: Jailed paths now always display as starting from the jail root, using forward slashes (`/`) on all platforms.
14-
- Internal type-state engine (`ValidatedPath`): All path validation now uses a type-state pipeline for strict, auditable security guarantees. This benefits crate development and advanced users, but is fully hidden from typical API usage.
15-
- Improved docs, roadmap, and tests for new clamping, canonicalization, and display logic.
15+
16+
- **Virtual root display system**: `JailedPath` now always displays as starting from the jail root using forward slashes (`/`) on all platforms, hiding internal filesystem details from users
17+
- **Internal type-state validation engine**: Introduced `ValidatedPath` with compile-time state tracking for strict, auditable security guarantees through marker types (`Raw`, `Clamped`, `JoinedJail`, `Canonicalized`, `BoundaryChecked`)
18+
- **One-shot path validation**: New `try_jail()` function for convenient single-use path validation without creating a `PathValidator`
19+
- **Safe file operations trait**: `JailedFileOps` trait provides jail-safe file operations (`read_to_string()`, `write_bytes()`, `exists()`, `create_dir_all()`, etc.) without exposing raw paths
20+
- **Enhanced examples and documentation**: Added comprehensive examples for real-world usage patterns, marker types, virtual root display, and safe file operations
1621

1722
### Changed
18-
- All path validation now clamps traversal and absolute paths to the jail root; escapes are never allowed.
19-
- `JailedPath` and `PathValidator` refactored for stricter jail enforcement and cross-platform consistency.
2023

21-
### Removed / Refactored
22-
- **BREAKING:** Removed legacy types and traversal rejection; all path handling now clamps to jail root.
24+
- **BREAKING: Path validation behavior**: All path validation now clamps traversal and absolute paths to the jail root instead of rejecting them - escapes are mathematically impossible
25+
- **BREAKING: API restructure**: Complete refactor of `JailedPath` and `PathValidator` for stricter jail enforcement and cross-platform consistency using type-state validation
26+
- **Enhanced crate description**: Updated to "Prevent directory traversal with type-safe virtual path jails and safe symlinks"
27+
- **Non-existent jail handling**: `PathValidator` now allows creation with non-existent jail directories (validates they would be directories if they exist)
28+
- **Comprehensive test suite**: Updated all integration and unit tests to validate new clamping behavior and type-state API
2329

24-
### Fixed
25-
- Clippy lints, cross-platform display, and documentation issues.
30+
### Dependencies
2631

27-
### Changed
28-
- **PathValidator:** Now uses `ValidatedPath` for all jail and candidate path handling. Jail existence check allows non-existent jails, but requires directories if present.
29-
- **Clamping logic:** Absolute paths are forcibly clamped to jail root; all root components are stripped before joining to jail.
30-
- **Integration and unit tests:** Updated to use new type-state API and dynamic jail roots.
31-
- **README and docs:** Updated to explain type-state pattern, marker types, and new security guarantees.
32+
- **Added**: `tempfile = "3.20.0"` as dev dependency for robust testing
33+
34+
### Technical Implementation
3235

33-
### Removed / Refactored
34-
- **BREAKING:** Removed `ClampedPath` type and all related logic. All clamping and normalization is now performed by `ValidatedPath` and its `.clamp()` method.
35-
- **BREAKING:** Removed legacy newtypes and type aliases; all path handling now uses `ValidatedPath` and marker types.
36-
- **BREAKING:** All usages, tests, and documentation updated to use the new type-state API.
36+
- **Type-state pipeline**: All path validation uses `ValidatedPath<State>` where `State` tracks the exact sequence of security transformations
37+
- **Clamping algorithm**: Absolute paths are forcibly clamped to jail root; all root components stripped before joining to jail
38+
- **Virtual path abstraction**: Clean separation between user-facing virtual paths and internal real filesystem paths
3739

3840
### Fixed
39-
- Fixed: All Clippy lints (needless_borrow, redundant_clone) resolved. All doctests and integration tests pass. Absolute path clamping logic fixed. Documentation and examples now compile and run successfully.
41+
42+
- All Clippy lints resolved (`needless_borrow`, `redundant_clone`)
43+
- Cross-platform display consistency across Windows, macOS, and Linux
44+
- All doctests and integration tests now pass with new validation behavior
45+
- Documentation examples compile and run successfully
4046

4147
## [0.0.3] - 2025-07-21
4248

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "jailed-path"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
edition = "2021"
55
authors = ["David Krasnitsky <dikaveman@gmail.com>"]
66
description = "Prevent directory traversal with type-safe virtual path jails and safe symlinks"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ Add this to your `Cargo.toml`:
294294

295295
```toml
296296
[dependencies]
297-
jailed-path = "0.0.3"
297+
jailed-path = "0.0.4"
298298
```
299299

300300
## Why This Crate Is Exceptional

ROADMAP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This roadmap outlines the planned evolution of the `jailed-path` crate based on
1111

1212
**Goal:** Provide ergonomic, jail-safe file operations directly on `JailedPath` without exposing the inner `Path` or relying on `Deref`/`AsRef<Path>`.
1313

14-
**Status:****COMPLETED** - Available since version 0.0.3
14+
**Status:****COMPLETED** - Available since version 0.0.4
1515

1616
**What was implemented:**
1717
- The `JailedFileOps` trait provides comprehensive file I/O operations
@@ -44,7 +44,7 @@ file.write_string("Hello, secure world!")?;
4444
---
4545

4646
## Planned: Enhanced Security Features
47-
## Current Status (v0.0.3)
47+
## Current Status (v0.0.4)
4848

4949
**Implemented**
5050
- Core path validation with soft canonicalization

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
//! First, add `jailed-path` to your `Cargo.toml`:
177177
//! ```toml
178178
//! [dependencies]
179-
//! jailed-path = "0.0.3" # Replace with the latest version
179+
//! jailed-path = "0.0.4" # Replace with the latest version
180180
//! ```
181181
//!
182182
//! ### Basic Validation

0 commit comments

Comments
 (0)