fix: promote certificate validity dates to signer root - #8039
Open
rodrigodev wants to merge 1 commit into
Open
Conversation
The certificate signers merge service stopped promoting the end-entity certificate validity dates (valid_from/valid_to) to the top-level signer object. The validation panel and the SignerDetail API contract read these fields from the signer root, so the panel always showed "No expiration date" even though the leaf certificate carries a valid notAfter. Restore the promotion of the ISO UTC validity dates from chain[0] to the signer root, as the pre-refactor logic did. Update the SignersLoader test that had codified the buggy behavior and add a regression test covering the merged contract. Signed-off-by: r.carneiro <rodrigo.carneiro.dev@gmail.com>
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.
Fixes #7825
Problem
On the document validation panel, every signer shows "No expiration date" even though the signer's leaf certificate carries a valid
notAfter.Root cause
The Apr-2026 refactor that extracted
CertificateSignersMergeService::processChainData()stopped promoting the end-entity (leaf) certificate'svalid_from/valid_toto the top-level signer object. Before that refactor,SignersLoadermergedchain[0]'s fields into the signer root viaarray_merge.The validation UI (
src/components/validation/SignerDetails.vue) and theSignerDetailOpenAPI schema both readvalid_from/valid_tofrom the signer root, so the panel always rendered "No expiration date".A unit test (
testLoadSignersFromCertDataPreventsDuplicateFormattedDates) had accidentally codified the buggy behavior by asserting root-levelvalid_toshould be absent — contradicting the existing contract from Oct-2025 (FileServiceTest+ OpenAPI).Fix
CertificateSignersMergeService::processChainData(): promote the ISO UTCvalid_from/valid_tofromchain[0]to the signer root. The chain still carries the full per-certificate dates for the certificate-chain view.testMergePromotesLeafCertValidityDatesToSignerRoot.testLoadSignersFromCertDataPreventsDuplicateFormattedDatesto assert the corrected contract (ISO dates present at root, locale-formatted backend strings and technical fields still excluded).tests/integration/features/file/validate.featurenow assertsvalid_from/valid_toonsigners[0]of the validate endpoint response.Validation
php -l, php-cs-fixer dry-run, psalm (no errors)test()pattern used inpage/index.feature