Skip to content

[RELEASE] v1.4.1 - security fixes, template inspection repairs - #78

Merged
bnbong merged 2 commits into
mainfrom
dev
Sep 10, 2026
Merged

bnbong merged 2 commits into
mainfrom
dev

Conversation

@bnbong

@bnbong bnbong commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Requesting Merging

Description

v1.4.1 patch release. Removes two unmaintained auth dependencies (python-jose, passlib), resolves all open Dependabot alerts, and repairs the weekly template inspection so fastapi-psql-orm passes end to end again.

Type of Change

  • BUG FIX
  • ADDING NEW TEMPLATE
  • FEATURE ADDED/UPDATED
  • HOTFIX
  • DELETING UNNECESSARY FEATURES
  • DOCUMENTATION & DEVOPS
  • Etc..

Test Environment

  • macOS, Python 3.12, uv, Docker Desktop (Compose v2.18.1)
  • pytest: 977 passed · mypy strict / black / isort / pre-commit clean · mkdocs build --strict OK
  • scripts/inspect-templates.py --offline: 12/12 templates pass, including the Docker-backed fastapi-psql-orm with its smoke step
  • Generated fastapi-mcp project: 26 tests pass, pip-audit clean, no InsecureKeyLengthWarning

Major Changes

  • Security: python-josePyJWT[crypto] (drops unpatched ecdsa CVE-2024-23342) and passlib[bcrypt]pwdlib[argon2] in the JWT / FastAPI-Users catalog and the fastapi-mcp template
  • Dependabot: mkdocs-material ≥ 9.7.7, pymdown-extensions ≥ 11.0.1, idna ≥ 3.15; urllib3 / virtualenv / filelock refreshed in both lock files
  • Template inspector: write-free compile check moved before the Docker step, bind-mount ownership reclaimed after containers run, every docker-compose ps --format json shape parsed, docker compose plugin fallback, Docker templates smoke-tested via the published port
  • Scaffolding: copied text files normalized to LF with executable bits kept, new .gitattributes pins template line endings (fixes bash\r failures on Windows / autocrlf checkouts)
  • CI: PDM interpreter pinned to 3.12; security-scan workflow now emits valid JSON and counts vulnerabilities correctly (closes the miscounted "22 vulnerabilities" issue)
  • Docs: EN tutorial / CLI reference updated for PyJWT and pwdlib

Screenshots (optional)

N/A

Etc

Closes #76, closes #77.

Translated docs (ko/ja/zh/de/fr/es) still mention python-jose / passlib and will be synced by the translation workflow.

@bnbong bnbong self-assigned this Sep 10, 2026
@bnbong bnbong added bug Something isn't working template Add or editing a FastAPI template python Pull requests that update python code template-inspection labels Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Template Inspection Passed

All changed templates have been validated successfully.


Last updated: 2026-09-10T02:58:28.078Z

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3761f4b550

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const results = JSON.parse(fs.readFileSync('security_scan_results.json', 'utf8'));

results.templates.forEach(template => {
if (template.error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Surface scanner errors when the vulnerability count is zero

When pip-audit produces no parseable JSON, such as during a dependency-resolution or network failure, the report records template.error but leaves total_vulnerabilities at zero. The step-level condition on line 150 then skips this newly added error-reporting branch, and the summary instead claims that no vulnerabilities were found, leaving a failed weekly security scan looking successful. Gate issue creation on recorded scan errors as well as the vulnerability count, or fail the scan step.

Useful? React with 👍 / 👎.

Comment thread .gitattributes
* text=auto eol=lf

# Template payload files (the `-tpl` marker is stripped at generation time).
*-tpl text eol=lf

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude binary template payloads from text normalization

The broad *-tpl text rule also matches supported binary payloads such as logo.png-tpl; the later *.png binary rule does not match that suffixed filename. On checkout Git will therefore normalize the PNG signature's CRLF bytes before the transducer can copy the file unchanged, corrupting such assets—the added test_binary_files_are_copied_untouched case assumes exactly this filename remains byte-for-byte intact. Add binary rules for the .<binary-extension>-tpl forms or avoid forcing every template payload to text.

Useful? React with 👍 / 👎.

raise credentials_exception

except JWTError:
except jwt.PyJWTError:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Import jwt before catching PyJWTError

This src/auth/dependencies.py example is a separate module and never imports jwt. When an invalid, blacklisted, or subject-less token raises the intended HTTPException inside the try, Python evaluates jwt.PyJWTError while selecting a handler and raises NameError instead, turning the expected 401 into a 500 for readers who copy the tutorial. Import jwt in this snippet or remove the redundant handler because decode_token already converts JWT failures to None.

Useful? React with 👍 / 👎.

@bnbong
bnbong merged commit e45c464 into main Sep 10, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python Pull requests that update python code template Add or editing a FastAPI template template-inspection

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚨 Weekly Template Inspection Failed - 2026-09-09 🔒 Template Security Alert: 22 vulnerabilities found - 2026-09-07

1 participant