Skip to content

Bugfix Issue 2125 Authored Security Chapter

github-actions[bot] edited this page Nov 30, 2026 · 1 revision

Bugfix — Issue #2125: authored Security Testing chapter text

Symptom

Chapter 23 (Non-Functional: Security Testing) was a read-only page. gui/templates/strategy/nfrSecurity.html had no textarea and no save action, so teams could not record the threat model, penetration/vulnerability scan results or access-control matrix their project actually applies. Measured before the fix: grep -c '<textarea>' = 0, live DOM textareas: 0, buttons: [], zero strategychapter network requests, and an authenticated BFF init call for chapter=security returned 400 bad_chapter while chapter=accessibility returned 200.

Root cause

The chapter was still a static translated page. Unlike the seven already authored chapters (intro, objectives, usability, accessibility, compatibility, reliability, maintainability), it was not wired to api/strategychapter/index.php, and the report title map in gui/templates/results/strategyReport.html did not recognize the security chapter code. The BFF allowlist in schapterCodes() had no security entry either, even though the chapter itself was exposed by api/strategy/index.php:80. This is an unfinished migration, not a regression: 1.9.20 shipped all NFR pages as static translated content and 2.0.1 migrated them one at a time (#2101, #2127, #2126, #2128, #2129, #2130).

Approach (why this fix)

The fix extends the existing per-project chapter infrastructure instead of introducing a parallel storage path. Adding security to the BFF allowlist is additive: all existing chapters keep the same rights checks, atomic upsert and AUDIT event. The chapter page mirrors the already-verified #2126/#2127 Dashio editor, and the report map gains one key so Markdown, HTML, PDF and print exports show the localized title instead of the raw security code. Two alternatives were rejected: localStorage text (not project-scoped, no rights, absent from the report/PDF) and a new BFF/table (duplicates working infrastructure).

Files changed

  • api/strategychapter/index.php: added security to schapterCodes() and to the documented route contract, so init, list and save use the same per-project persistence and rights checks as every other authored chapter.
  • gui/templates/strategy/nfrSecurity.html: added the Dashio editor card with a textarea, author/timestamp metadata, Save button, localized status messages, project-context footer and the standard 401/403/400 error handling. Read-only project roles get a disabled textarea and Save button.
  • gui/templates/results/strategyReport.html: added security: 'ts.chapterSecurity' to chapterTitle() so report panel 11 uses the localized chapter title in Markdown, HTML, PDF and print exports.
  • gui/templates/i18n/*.json: added ts.secNotesTitle, ts.secNotesHint, ts.secNotesLabel and ts.secNotesSave to all ten bundles, translated in the nine non-English bundles. The pre-existing ts.chapterSecurity remains the English source string in eight bundles (a separate translation gap).
  • CHANGELOG: one 2.0.1 KEY BUGFIX line for #2125.
  • tmp/TLU_Test_Cases.md: numbered regression suite with measured results.

Screenshots

Security Testing chapter before the fix — static page without editor

Security Testing chapter after the fix — editor with saved note

German Test Strategy report panel 11 showing the Security Testing note

Verification

  • php -l api/strategychapter/index.php: no syntax errors.
  • Extracted page JavaScript passed node --check; grep -c '<textarea>' → 1.
  • python3 -m json.tool passed for all ten bundles; bash ai/verify_i18n_coverage.sh: 9 bundles passed, 0 missing.
  • Admin UI: fixture project 1 (SEC); saved a two-line note and reloaded → Updated: 2026-11-30 01:50:26 by admin with the text preserved verbatim.
  • BFF: init returned code/text/author/timestamps; list returned ["security"]; bad chapter → 400, missing project → 400, unknown project → 404, DELETE → 405 with Allow: GET, POST, unauthenticated → 401.
  • Read-only user secviewer (project role 5): textarea and Save disabled with saved text visible; direct POST → 403 no_right; DB text unchanged.
  • Report panel 11: ?locale=de&tproject_id=1 showed the note with Security Testing · Letzter Autor: admin · Aktualisiert: 2026-11-30 01:50:26; ?locale=ro&tproject_id=1 showed Testare de Securitate · Ultimul autor: admin · Actualizat: 2026-11-30 01:50:26. No raw security code leaked.
  • Event Viewer (events table): 3 rows, all log_level=16 AUDIT (one STRATEGY_CHAPTER_SAVE, two logins) → 0 Error/Warning entries.
  • Suite gate: TLU_REQUIRE_SUITE="Issue #2125" bash ai/verify_test_suites.sh → 34 PASS / 0 FAIL / 0 SKIP; 1036 → 1037 suites, no suite lost.

Result

PASS — Fixes #2125. Refs #2101.

Clone this wiki locally