Code review and clean up #18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/code-review-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR addresses all findings from the internal code review, covering security, correctness,
maintainability, i18n, accessibility, and tooling.
Security and correctness
/uploads/{user_id}/{filename}, authenticated users can't read other users' filesHTTP 400on malformed date parameters in scope helpershttponly=Trueto locale cookieuser_id,filename) tuple for orphan image detection instead of bare filenameRefactoring and code quality
_get_entry,_set_login_csrf_cookie,_count_unused_recovery_codeshelpers to eliminate repeated blocksapp/export.pyout ofaccount.pytheme.js, removes duplication betweenui.jsandlanding.jsapp/auth.pytoapp/session_token.pyto eliminate naming collision withapp/routers/auth.pyapp/static/css/export-bundle.css, loaded once at module importi18n
calendar.jsnow reads month and weekday names fromwindow.PIRUETAS, addedSHORT_WEEKDAY_NAMESandget_short_weekday_names()toi18n.pysignup.html,admin/tasks.html,admin/users.html, andrecovery-codes.jswith
t.*keystis defined fallback guards from templates,tis always injected byctx()Accessibility
aria-disabled="true"to mobile date next-arrow when on todayrole="dialog"andaria-modal="true"to mobile sheet overlaysTooling and infrastructure
ruffrules B, UP, and targeted S checks; enforce 99% coverage floor.dockerignoreuvversion inDockerfilevia official image copyhealthcheckand restart policy tocompose.ymlTests and test infrastructure
TEST_SECRET_KEYand_get_auth_cookieshelper intotests/e2e/conftest.pynetworkidlewaits after deterministic DOM signals in e2e testsMinor fixes
noreferrerto external links inindex.htmlsrcrewriteAny logged-in user could read another user's uploaded images by requesting /uploads/{other_user_id}/{filename} directly. Added an ownership check (current_user.id == user_id) on the authenticated branch; raises 403 on mismatch. Added regression tests for cross-user access and the happy-path own-file 200.