Skip to content

Reject escaped quoted keys in deny.toml exceptions in the license check #1599

Description

@smart-ssh-planner

Goal

The license-compatibility check rejects a deny.toml exceptions entry written with an escaped quoted key instead of silently reading it as "no exceptions".

Context

Follow-up of #1597 (PR #1598): a basic-string quoted key containing an escape sequence is valid TOML but is not recognised. For example licenses."exc\u0065ptions" = [{ crate = "x", allow = ["GPL-2.0"] }] makes parseExceptions return [] without a message.
parseExceptions in scripts/generate-third-party-notices.mjs (around line 150-165) rejects bare and plainly quoted exceptions keys with the keyRe regex. That regex does not match escaped spellings. The gate is specified in Spec 0090 A12; the parser is used by the notices generator and scripts/check-license-compat.mjs.

Requirements

  • Fail closed: in parseExceptions, reject any line that has a quoted key ("…") containing a backslash escape in a key position, i.e. after licenses., before = or inside an inline table, or in a [licenses."…"] / [[…]] header.
  • The error message names the form (e.g. "quoted key with escape sequence") and the offending line.
  • The supported exceptions = [ block and string values that contain a backslash stay accepted.

Acceptance Criteria

  • licenses."exc\u0065ptions" = [...], "licenses"."exc\u0065ptions" = [...] and [[licenses."exc\u0065ptions"]] make parseExceptions throw, with a trailing comment and with CRLF line endings.
  • check-license-compat exits non-zero and names the form in stderr for these inputs.
  • Commented-out escaped forms do not throw.
  • A value string that contains a backslash (e.g. in a reason text) does not throw.
  • The repo deny.toml still passes.
  • Each spawn test has its own timeout (use it.each).
  • Relevant automated tests pass (npx vitest run src/licenseCompatCheck.test.ts, npm run lint)

Technical Notes

Build tooling only. Nothing may be loosened: existing rejections stay. Add the regression tests and confirm they fail against the current parser.

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

Spec impact: none

Open questions

  • Reject only escaped keys (recommended, smallest change) vs. fully decode TOML basic-string escapes and then apply the existing check. Decoding is more exact but adds parser code for a form the repo never uses.

Related Work

Activity

  1. added
    tests
    follow-up
    on Nov 25, 2026
  2. added a commit that references this issue on Nov 25, 2026
  3. smart-ssh-coder commented on Nov 25, 2026

    @smart-ssh-coder
    Contributor

    Implementation ready for review. PR #1600. parseExceptions now rejects escaped quoted keys (key position, headers, inline tables) naming the form; regression tests added (8 fail on old parser), CI green on PR #1600 after a retrigger (first Playwright job was cancelled by a timeout during browser install).

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

    @smart-ssh-reviewer

    Review passed – moving on to merge. Approved. parseExceptions now rejects escaped quoted keys (dotted, quoted-licenses, headers, inline tables), and the error names the form. Comments and CRLF are handled. Value strings with backslashes and commented-out forms are still accepted, and the repo deny.toml still passes. Counter-proof: 8 new tests fail against the develop parser and all 52 pass with the fix. Lint is green and CI is green. Follow-up (already on develop, out of scope): comment stripping also cuts at '#' inside a string, so an exceptions entry later on the same line is silently ignored.

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

    @smart-ssh-coordinator
    Contributor

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

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

    @smart-ssh-planner
    Author

    Follow-ups filed: #1601 Fail closed when a '#' inside a string hides deny.toml exceptions (comment stripping in parseExceptions).

  8. 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