feat(issuer2): configure mdoc MSO validity via msoData - #2169
feat(issuer2): configure mdoc MSO validity via msoData#2169JakeFernandes98 wants to merge 5 commits into
Conversation
Allow profile and offer msoData to set MSO validFrom, validUntil, and expectedUpdate at claim time, including timestamp data functions.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
szijpeter
left a comment
There was a problem hiding this comment.
The core MsoData/resolver design is sensible, but two supported issuance paths bypass or lose the configured policy and two public validity contracts remain incomplete; please also confirm the release decision for the binary-breaking expectedUpdate insertions in OAuth2Provider, MdocCredentialSigner, and MdocIssuer, which are only partially covered by the PR's Breaking section.
Keep issuer-configured MSO validity authoritative, copy profile msoData into offerless auth-code sessions, and reject tdate windows that collapse to equal seconds.
|
@szijpeter Thanks — all four inline items are addressed on On the binary-breaking |
|



Summary
This adds Issuer2
msoDataso mDoc issuance can set ISO 18013-5 MSOValidityInfo(validFrom,validUntil, optionalexpectedUpdate) at claim time. Operators can now choose a validity window other than the hardcoded ~365-day default, and timestamp data functions work for MSO dates the same way they already do for W3Cmapping.W3C
mapping.validFrom/validUntiland mDL namespaceissue_date/expiry_dateare still not MSO fields. That mismatch is what WAL-1365 and WAL-1015 reported.Related PRs:
MsoData/MsoValidityResolversurface)What Changed
Public API
msoDataon Issuer2 profiles,runtimeOverrides, and issuance sessions. Accepted only formso_mdoc; rejected on other formats.validFrom,validUntil, andexpectedUpdateis a static ISO-8601 timestamp or a timestamp data function, resolved at claim time.signedis not configurable.validFrom,validUntil, andexpectedUpdateindependently).issuer_state(including offerless) copy profilemsoDataonto the session.validFromequals the MSO signed time,validUntilis 365 days after claim,expectedUpdateis omitted.validUntilmust be aftervalidFrom;validFromcannot be before signed time; if set,expectedUpdatemust fall between them.requestForm["validUntil"]does not change the signed MSO window.Shared issuance
MsoDataand claim-timeMsoValidityResolverlive in openid4vci so OSS and Enterprise share one resolution path.validUntil: explicitmsoData.validUntil→ optionalfallbackValidUntil→ 365-day default. Enterprise uses the fallback for persistedIssuanceRequest.validUntil.expectedUpdateis threaded throughOAuth2Provider.createCredentialResponse,MdocCredentialSigner.generateMdocCredential,MdocIssuer, and both credential-handlersignoverloads. W3C and SD-JWT handlers accept the argument and ignore it.MsoMdocCredentialHandler.issueMdocnow receives the resolved instants instead of hardcodingvalidityDays = 365.ValidityInfo.precheck()requiresvalidUntil > validFromand checks theexpectedUpdatewindow. If a providedvalidFromfalls a moment behind the sign timestamp (claim-time resolve vs. signing), it is raised tosignedso ISOvalidFrom >= signedstill holds; a futurevalidFromis kept.Issuer2 wiring
msoDataunless metadata format ismso_mdoc.msoDataon the session.issuer_stateauthorization sessions copy profilemsoData.msoDataand passes the three instants intocreateCredentialResponse. Non-mDoc sessions that still carrymsoDatafail closed.Tests
fallbackValidUntil.expectedUpdateon the crypto2 mDoc issuer path.requestForm["validUntil"]cannot extend a configured window, and thatMsoMdocCredentialHandlerforwards the resolved instants.msoData, offerless scope and authorization_details sessions, and authorization-code with and withoutissuer_state.Architecture Notes
msoDatais nested, not top-levelvalidFrom/validUntil, so it cannot be confused with W3C mapping or namespace claims.Caveats and Follow-Ups
waltid-issuer-api) is unchanged.signedremains issuer-generated.validFrommust still be at or after claim/sign time; a timestamp captured at offer creation and claimed later is rejected.Breaking
CredentialEndpointHandler/Crypto2CredentialEndpointHandlersignnow requireexpectedUpdate: Instant?. Fun-interface implementors outside this repo must add the parameter.OAuth2Provider.createCredentialResponseinsertsexpectedUpdate: Instant? = nullbeforeproofValidationContext. Named-argument callers are source-compatible; positional callers that passedproofValidationContextaftervalidUntilmust be updated.MdocCredentialSigner.generateMdocCredentialandMdocIssueroverloads addexpectedUpdate: Instant?.MsoMdocCredentialHandler.issueMdocnow takesvalidFrom,validUntil, andexpectedUpdate(withvalidityDaysas a fallback default). External subclasses must update their override.msoDatakeeps the previous defaults. No issued-credential format change whenmsoDatais omitted.