You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Config via API, in issuer metadata; independent decoding passes
mDL tests pass; docs updated
Wallet downloads and shows it; verifier reports it verified
Summary by CodeRabbit
New Features
Added support for issuing ISO/IEC TS 23220 Photo ID credentials, including mandatory-field checks and encoding for dates, portraits, and age attestations.
Added a Photo ID profile and sample configuration for local setup, plus a Postman collection for the authorization-code issuance flow.
Bug Fixes
Improved mdoc template validation, including clearer errors for malformed entries and handling of null values and unsupported numeric values.
Documentation
Updated setup guides, API documentation, and release notes with Photo ID configuration and credential requirements.
The change adds ISO/IEC TS 23220 Photo ID support for mdoc credentials. It adds configuration checks for mandatory Photo ID elements and template structure, plus processing and CBOR encoding rules for Photo ID and mDL elements. It also adds a mock Photo ID profile, seeded credential configuration, and tests for validation and issuance. Documentation describes the profile and the added rules.
Path filters excluded changed files. This rating applies only to the assessed changes.
Photo ID issuance can produce a credential without a mandatory element, such as the portrait, when the template sets it to null. This should be resolved or explicitly accepted before merge. The sample Postman flow can also leave a stale client key after a failed registration request. Unsigned age claims are not strictly validated.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
[#1181] Directly linked issue. Coding requirements: Photo ID mso_mdoc issuance in DataProvider mode, with validation, encoding, sample, tests, and docs.
Covered by the change summary: - Mandatory ele…
Confirm that docker-compose/docker-compose-injistack/config/photo_id_data.csv (excluded by !**/*.csv) supplies a value for every org.iso.23220.1 mandatory element (family_name, given_name, birth_date, portrait, issue_date, `…
Passed checks: 3 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: issuing a non-mDL mso_mdoc credential, the ISO/IEC TS 23220 Photo ID. The changeset adds Photo ID issuance in DataProvider mode, including the org.iso.23220.photoid.1 …
Out of Scope Changes check
Each change maps to a linked-issue task or supports one. - PhotoIdDataElements, MDocProcessor, and the validators implement tasks 2 to 6 (portrait, dates, value types and nulls, template validatio…
Full details: Title check
Explanation
The title names the main change: issuing a non-mDL mso_mdoc credential, the ISO/IEC TS 23220 Photo ID. The changeset adds Photo ID issuance in DataProvider mode, including the org.iso.23220.photoid.1 docType, mandatory-element checks, encoding, docs, and tests. The title is specific and matches the linked issue #1181 and the PR objectives. It is 88 characters, slightly long, but still clear.
Full details: Out of Scope Changes check
Explanation
Each change maps to a linked-issue task or supports one.
PhotoIdDataElements, MDocProcessor, and the validators implement tasks 2 to 6 (portrait, dates, value types and nulls, template validation, birth_date map).
The null-omission and integer-range changes apply to all mso_mdoc credentials, including mDL. Task 4 requires null omission. The mDL output change for null elements is stated in the PR and is intended.
The PHOTO_ID_MANDATORY_FIELDS_MISSING constant and Photo ID tests implement task 9.
The sample seed, certify_init.sql entry, mock-photoid properties, CSV mount, and docker-compose changes implement task 1.
Documentation changes implement task 8.
The Postman collection under docs/postman_collections is a test tool for the Photo ID issuance flow. Its partner-auth and OIDC client setup steps are test scaffolding and do not change product behavior. This is a judgment call.
No change was shown to be unrelated to #1181.
Full details: Linked Issues check
Explanation
[#1181] Directly linked issue. Coding requirements: Photo ID mso_mdoc issuance in DataProvider mode, with validation, encoding, sample, tests, and docs.
Covered by the change summary:
Mandatory elements: PhotoIdDataElements.MANDATORY and missingMandatory report absent org.iso.23220.1 elements with photo_id_mandatory_fields_missing. Element names are listed. Checked on Add and Update through MsoMdocCredentialConfigValidator and CredentialConfigurationServiceImpl.
Portrait: portrait is encoded as JPEG byte string. Base64 and JPEG data-URI inputs are tested. Invalid images are rejected.
Dates: issue_date and expiry_date use full-date (tag 1004). portrait_capture_date uses tdate (tag 0). birth_date accepts full-date or map form.
Value types and nulls: null elements are omitted. Integers are CBOR integers in the range -2^64 to 2^64-1. Unsupported number types are rejected.
Template errors: missing element name or value fails with mdoc_template_processing_failed, and the message names the field.
Signing and binding: MDocCredentialPhotoIdTest checks ES256 signature, digests, docType, and deviceKey.
Tests: MDocProcessorTest, MsoMdocCredentialConfigValidatorTest, and CredentialConfigMetadataAttributesTest cover these cases. Existing mDL tests are reported as passing.
Docs: README, technical docs, Stoplight, and Releases are updated.
Not established:
The sample mock data requirement depends on docker-compose/docker-compose-injistack/config/photo_id_data.csv. This file is excluded by rule !**/*.csv and was not reviewed. Whether it supplies all mandatory elements cannot be confirmed.
Wallet download/display and verifier acceptance are manual end-to-end checks. They are non-coding and are not assessed.
Issuer key and certificate trust for the verifier relies on Certify's own signing key (CERTIFY_VC_SIGN_EC_R1). Verifier trust is not confirmed by code evidence.
Resolution
Confirm that docker-compose/docker-compose-injistack/config/photo_id_data.csv (excluded by !**/*.csv) supplies a value for every org.iso.23220.1 mandatory element (family_name, given_name, birth_date, portrait, issue_date, expiry_date, issuing_authority_unicode, issuing_country, age_over_18) and that its birth_date form matches the supported full-date or map formats. Verifier acceptance remains a manual check outside this assessment.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Data Integrity & Integration · Quick win
Reject unset mandatory elements after rendering.
If a Photo ID template declares portrait with elementValue: null, configuration validation accepts it. This branch then removes portrait. The remaining validation does not check mandatory-element presence, so the processed credential and its digest map lack a mandatory portrait.
Check mandatory elements after null omission. Keep null omission for optional elements. Apply the check to rendered templates, including Velocity-generated element lists.
Example check after namespace processing
if (PhotoIdDataElements.DOC_TYPE.equals(docType)) {
List<?> elements = (List<?>) nameSpaces.getOrDefault(
PhotoIdDataElements.NAMESPACE, List.of());
Set<String> identifiers = newHashSet<>();
for (Objectelement : elements) {
identifiers.add((String) ((Map<?, ?>) element)
.get(Constants.ELEMENT_IDENTIFIER));
}
List<String> missing = PhotoIdDataElements.missingMandatory(identifiers);
if (!missing.isEmpty()) {
thrownewCertifyException(
ErrorConstants.PHOTO_ID_MANDATORY_FIELDS_MISSING,
"Missing Photo ID elements: " + String.join(", ", missing));
}
}
This PR leaves out an element whose value is null (every mdoc, mDL included). So a template with "portrait": null passes Add/Update (only identifiers are checked) and issues a document without its portrait. Before this PR the mDL rejected a null portrait at issuance.
CodeRabbit suggests checking mandatory elements at issuance, which is the check you asked me to remove in #1178 (point 1).
Options:
Add/Update only (my preference): a mandatory element whose template value is literally null counts as missing (mdl_mandatory_fields_missing / photo_id_mandatory_fields_missing). A null that only appears after Velocity renders is still left out.
Issuance check as CodeRabbit suggests, for both the mDL and the Photo ID.
No change: a null mandatory element is left out, as now.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Stability & Availability · Heavy lift
Do not replace the active client key before registration succeeds.
If the request fails to connect, eSignet still has the old public key. Postman has no response to run the rollback script, so Get Tokens V2 signs with the new, unregistered private key. Stage the candidate pair separately and use its public key in the registration body. Promote the pair only after an ACTIVE response for the requested client. Keep the candidate available for recovery if the server outcome is unknown. (learning.postman.com)
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai Valid gap, but not specific to this collection: the "Create OIDC client" script is shared with the mock-identity, DPoP and mDL collections. The rollback added in #1037 restores the previous key after an error response, but not when no response arrives (the test script never runs).
Fixing it in one collection would leave the others inconsistent, so I'll stage the new key and promote it only after an ACTIVE response in all four collections as part of #1174 (PR #1202), which already updates them.
@mayuradesh flagging this so the fix lands with #1174 rather than here. Let me know if you'd prefer it in this PR.
The reason will be displayed to describe this comment to others. Learn more.
@bernard42 Addressing this across all four collections in #1202 makes sense.
Please also check the case where the server registers the candidate key but the response is lost. The candidate key must remain available for recovery. I’m not marking the finding as addressed until the fix is verified.
Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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 #1181. Certify issues an ISO/IEC TS 23220 Photo ID (
org.iso.23220.photoid.1) in DataProvider mode, per TS 23220-4 Annex C.Changes
PhotoIdDataElements(besideMdlDataElements);MDocProcessorencodes and checks per namespace, mDL output unchangedportrait→ JPEG bytes;issue_date/expiry_date→ full-date;portrait_capture_date→ tdate;birth_date→ full-date or map;age_over_NN→ booleanphoto_id_mandatory_fields_missing); missing element name/value named in the errorPhotoIDCredentialseed,mock-photoidprofile,photo_id_data.csvBehaviour changes (every mso_mdoc, incl. mDL)
nullelement is left out instead of written as CBOR nulllongare CBOR integers (were text); beyond ±2^64 are rejectedDocs: README, docker-compose README, Local_Development, Credential_Issuer_Configuration, Stoplight, Releases
Done when
Summary by CodeRabbit