Repository navigation
feat(EN10168): generate the v0.5.0 qr-code symbol at render time (#346) - #347
Merged
Merged
Conversation
Mirror of material-identity/schema#447. EN10168 v0.5.0 has carried `qr-code` in KeyValueObject.Type since the url/phone/email/image types were added (2ab1e35), but nothing generated a symbol: the stylesheet drew whatever image the value held, and the product's supplementary information never passed Type to KeyValue, so a url there printed as text and a qr-code as its raw value. The rule now, in v0.5.0 in place (no schema change): the value is the text the symbol encodes (typically a URL) and the renderer generates the symbol. A value that is already a data: image URI keeps rendering as that image. - QrSymbol (zxing core 3.5.3; SVG path data, ISO/IEC 18004 quiet zone, EC level M) is the same encoder as schema's :shared. - QrCodeValues replaces every encodable qr-code value with the symbol's SVG data URI on a copy of the certificate before the XSLT runs, in both the service (SchemasServiceImpl.renderPdf) and json2pdf (CommandLineApp); the attached JSON stays the certificate as issued. - The EN10168 v0.5.0 stylesheet is byte-identical to schema's legacy copy again: the B-section passes Type to KeyValue (schema#370) and the qr-code branch's comment states the semantics. - Fixture valid_certificate_11 (url + qr-code pair in B20/B21) with its reference PDF; tests round-trip the symbol, pin the substitution rules and gate the generated FO. RenderTest's attachment check covers the as-issued JSON. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
…ry until 1.2.2 clears the release-age window The weekly Grype DB of 2026-10-06 flags two packages in ui/package-lock.json on every branch, main included: - postcss-selector-parser 6.1.4 (GHSA-rj75-hqrm-r3gf, Medium): quadratic selector parsing. Pinned to 7.1.6 via npm overrides; tailwindcss 3.4.3 and postcss-nested asked for ^6 but build identically against 7.1.6 — the Angular build output is byte-identical before and after. - source-map-js 1.2.1 (GHSA-68fv-2mgg-jv7q, High): event-loop DoS on untrusted source maps. The fix, 1.2.2, was published 2026-09-30 and the repo's .npmrc (min-release-age=7) quarantines it until 2026-10-07. Reached only through postcss/sass inside the Angular CLI build, never deployed; accepted in .grype.yaml until the window clears, bump tracked in #348. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
eamon0989
approved these changes
Oct 6, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #346. Mirror of material-identity/schema#447 (schema PR #448).
What
EN10168 v0.5.0 has carried
qr-codeinKeyValueObject.Typesince #101/#107/#108 addedurl,phone,emailandimage(2ab1e35), but no FEP specified it and nothing generated a symbol: the stylesheet branch was theimagebranch with fixed sizing. The product's supplementary information (B-section) also never passedTypetoKeyValue, so aurlthere printed as text and aqr-codeas its raw value.The rule now, in v0.5.0 in place (no schema change): the value is the text the symbol encodes (typically a URL) and the renderer generates the symbol. A value that is already a
data:image URI keeps rendering as that image, so earlier certificates do not change.How
QrSymbol— zxing core 3.5.3 (new dependency, Apache-2.0, no transitives), SVG path data, ISO/IEC 18004 four-module quiet zone, EC level M. The same encoder as schema's:shared, so both services print the same picture.QrCodeValuesruns before the XSLT in bothSchemasServiceImpl.renderPdfandCommandLineApp(json2pdf): on a copy of the certificate it replaces every encodableqr-codevalue with the SVG data URI of its symbol. The stylesheet's existingfo:external-graphicbranch draws it; the JSON attached to the PDF stays the certificate as issued.schemas/EN10168/v0.5.0/stylesheet.xslis byte-identical to schema's legacy copy again: the B-section passesTypetoKeyValue(schema#370) and the branch comment states the semantics. Every existing B-supplementary fixture entry isstring/number, so no other render changes (RenderTest parity: 150/150).test/fixtures/EN10168/v0.5.0/valid_certificate_11.json(url+qr-codepair in B20/B21) with its reference PDF rendered byjson2pdf.Tests
QrSymbolTest(12): matrix and SVG-path round-trip decode, escaping, quiet zone, attribute-safe path, blank and oversized input refused without echoing it.QrCodeValuesTest(5): substitution rules (URL → symbol;data:/ other types / blank / missing untouched), entries found anywhere without mutating the input, FO gate (B20 links, B21 draws from an SVG data URI, URL printed once).RenderTestrenders the new fixture against its reference PDF and asserts the attached JSON equals the fixture as issued.mvn test: 150 render + 17 new, all green.npm test(fixture validation): 1979 passed.pdfimages -listshows no raster symbol).🤖 Generated with Claude Code