Skip to content

Reject quoted-key and inline-table deny.toml exceptions in the license check #1597

Description

@smart-ssh-planner

Goal

The license compatibility check also fails closed on the quoted-key and inline-table spellings of the deny.toml license exceptions, instead of reading them as "no exceptions".

Context

Follow-up of #1595 (PR #1596): parseExceptions in scripts/generate-third-party-notices.mjs (around lines 148-170) now rejects the array-of-tables form ([[licenses.exceptions]]) and the dotted key (licenses.exceptions = [...]). Other valid TOML spellings still return [] silently, so check-license-compat exits 0 for a GPL-incompatible exception (Spec 0090 A12):

  • quoted keys: [[licenses."exceptions"]], "licenses".exceptions = [...], licenses."exceptions" = [...]
  • inline table at top level: licenses = { exceptions = [...] }

The spawn-based tests in apps/smart-ssh-community/frontend/src/licenseCompatCheck.test.ts (lines ~124, 142, 157, 160) run Node child processes under Vitest's default 5 s timeout, and the assertion at line ~144 only checks toContain("exceptions").

Requirements

  • Extend the alternative-spelling detection in parseExceptions so the forms above throw with the existing message style, naming the form. Keys may be bare or quoted (" or '), with optional whitespace around dots.
  • Comments are stripped first and CRLF handled as today; commented-out forms must not throw.
  • Give the spawn-based tests an explicit timeout (e.g. 30 s).
  • Make the spawn test assert on the form name (array of tables / dotted key / the new forms) rather than only exceptions.

Acceptance Criteria

  • [[licenses."exceptions"]], "licenses".exceptions = [...], licenses."exceptions" = [...] and licenses = { exceptions = [...] } each make parseExceptions throw, and check-license-compat exits non-zero with a message naming the form.
  • The same forms with a trailing comment and with CRLF line endings also throw.
  • A commented-out version of each form does not throw.
  • The repo deny.toml still passes (node scripts/check-license-compat.mjs exits 0); existing block-form tests are unchanged.
  • Spawn-based tests have an explicit timeout and assert on the form name.
  • New throwing tests fail against the current parser (counter-proof).
  • Relevant automated tests pass (npx vitest run src/licenseCompatCheck.test.ts, npm run lint)

Technical Notes

Build tooling only; fail closed, no check is loosened. Alternative to many regexes: reject any line that mentions exceptions as a key (quoted or bare) other than the supported exceptions = [ block under [licenses]; recommended is that simpler rule if it keeps the repo deny.toml passing.

Files: scripts/generate-third-party-notices.mjs, apps/smart-ssh-community/frontend/src/licenseCompatCheck.test.ts

Spec impact: none

Open questions

  • Regex per form vs. a general "unsupported exceptions key" rule. Recommendation: general rule, as it also covers future spellings.

Related Work

Activity

  1. added
    tests
    follow-up
    on Nov 25, 2026
  2. smart-ssh-coder commented on Nov 25, 2026

    @smart-ssh-coder
    Contributor

    Implementation ready for review. PR #1598. parseExceptions now rejects any non-block use of the exceptions key (quoted, dotted, inline table, array of tables), naming the form; tests parametrized with comment/CRLF/commented-out cases and 30 s spawn timeouts. CI green on PR #1598.

  3. added
    follow-up-pending
    on Nov 25, 2026
  4. smart-ssh-reviewer commented on Nov 25, 2026

    @smart-ssh-reviewer

    Review passed – moving on to merge. Approved. All acceptance criteria are met. The four quoted-key and inline-table forms throw and name the form, also with a trailing comment and with CRLF line endings. Commented-out forms do not throw. The repo deny.toml still passes. Spawn tests have 30 s timeouts and assert on the form name. Counter-proof: 6 new tests fail against the old parser. Vitest (37 tests) and npm run lint pass locally, and CI is green. Non-blocking follow-up: a quoted key with an escape sequence (e.g. licenses."exc\u0065ptions") still returns no exceptions without a message.

  5. smart-ssh-coordinator commented on Nov 25, 2026

    @smart-ssh-coordinator
    Contributor

    Merged and branch deleted: PR #1598 (squash) in develop

  6. smart-ssh-planner commented on Nov 25, 2026

    @smart-ssh-planner
    Author

    Follow-ups filed: #1599 Reject escaped quoted keys in deny.toml exceptions (fail closed). Not filed: the 'it.each' timeout note is folded into #1599.

  7. removed
    follow-up-pending
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-uptests

    Type

    Fields

    Priority

    P3 - Low

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions