Skip to content

Fix preview delete crash, pip-audit gate and CLI SECRET_KEY guard#1162

Merged
frankrousseau merged 2 commits into
cgwire:mainfrom
frankrousseau:main
Jul 13, 2026
Merged

Fix preview delete crash, pip-audit gate and CLI SECRET_KEY guard#1162
frankrousseau merged 2 commits into
cgwire:mainfrom
frankrousseau:main

Conversation

@frankrousseau

Copy link
Copy Markdown
Contributor

Problem

  • update_preview_file_raw reads preview_file.id in its StaleDataError handler after the failed commit expired the instance, raising an unhandled ObjectDeletedError instead of a clean 404 when a preview is deleted mid-update.
  • The pip-audit CI gate fails on new pillow (PYSEC-2026-2253 through 2257) and pyopenssl (PYSEC-2026-2269) advisories.
  • The default-SECRET_KEY guard only exempts the CLI when launched via the zou console script, so python zou/cli.py and python -m zou.cli are wrongly blocked.

Solution

  • Capture the preview file id before update() so the handler never re-touches the expired ORM instance.
  • Bump pillow to 12.3.0; ignore PYSEC-2026-2269, blocked by pysaml2 7.5.4's pyopenssl<24.3 cap.
  • Also exempt the guard when the __main__ module is cli.py.

frankrousseau and others added 2 commits July 13, 2026 15:16
update_preview_file_raw catches StaleDataError when a preview row is
deleted mid-update, but read preview_file.id after base.update() had
rolled back and expired the instance. That reload hit the deleted row
and raised an unhandled ObjectDeletedError instead of a clean 404.

Capture the id before update() so the handler never re-touches the
expired instance.

Tests: test_update_preview_file_raw_deleted_midflight_raises_not_found

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pip-audit started failing on two new advisories. Bump pillow to 12.3.0
to clear PYSEC-2026-2253 through PYSEC-2026-2257. pyopenssl
PYSEC-2026-2269 is fixed only in 26.0.0, which pysaml2 7.5.4 blocks via
its pyopenssl<24.3 cap, so add it to the ignore list alongside the
documented chain.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@frankrousseau
frankrousseau merged commit 99e58b0 into cgwire:main Jul 13, 2026
14 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