Skip to content

Bump path_jail core to 0.5 (release 0.3.0) - #1

Merged
aimable100 merged 2 commits into
mainfrom
bump-path-jail-0.5
Oct 8, 2026
Merged

aimable100 merged 2 commits into
mainfrom
bump-path-jail-0.5

Conversation

@aimable100

Copy link
Copy Markdown
Collaborator

Summary

Moves the bindings from path_jail 0.2 to 0.5.0 and bumps the package to 0.3.0.

The bindings wrap only the path-based API (Jail, join, contains, relative), so the core upgrade needs no binding code changes. One core behavior change reaches Python:

  • Fail closed on unreadable components. join/contains/relative now raise OSError (e.g. permission denied) when an existing component cannot be inspected. 0.2 treated it as nonexistent and returned a path.

Also

  • InvalidRoot is mapped explicitly to ValueError (drops the generic path_jail error: prefix).
  • Exception docs fixed in docstrings, .pyi stubs and the README: a non-directory or filesystem root raises ValueError; a missing root raises OSError. The README previously said OSError for both.
  • README: the TOCTOU section has a concrete O_NOFOLLOW write snippet and notes that the core's guard API is not exposed yet. The FastAPI example now imports Path. Examples are reformatted by ruff format (whitespace only), which CI's unpinned ruff now checks in Markdown.
  • __version__ reads package metadata (it was stuck at 0.1.0).
  • Homepage/author domain: tenuo.dev → tenuo.ai, matching the core crate.

Tests

New: non-directory root → ValueError, unreadable component → OSError (POSIX, non-root), __version__ matches metadata.

Local (macOS arm64, Python 3.13): maturin develop --release, pytest 48 passed, cargo fmt --check, cargo clippy -D warnings, ruff check, ruff format --check, mypy.

Release

After merge, pushing tag v0.3.0 runs release.yml (Linux/macOS/Windows wheels + sdist → PyPI).

- Depend on path_jail 0.5 (from 0.2). The core now fails closed when an
  existing path component cannot be inspected: join/contains/relative raise
  OSError (e.g. permission denied) instead of treating it as nonexistent.
- Map InvalidRoot explicitly to ValueError without the generic prefix.
- Fix exception docs (docstrings, stubs, README): a non-directory or
  filesystem root raises ValueError; a missing root raises OSError.
- README: O_NOFOLLOW write snippet for the TOCTOU section, note that the
  core's guard API is not exposed yet; FastAPI example imports Path;
  examples formatted with ruff.
- __version__ reads package metadata (was stuck at 0.1.0).
- Homepage/author domain: tenuo.dev -> tenuo.ai.
- Tests: non-directory root, unreadable component, version metadata.
@aimable100
aimable100 merged commit d887fc2 into main Oct 8, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant