chore: migrate @sphereon/pex to @animo-id/pex 6.1.1 - #63
Open
jrhender wants to merge 2 commits into
Open
Conversation
Replace the unmaintained @sphereon/pex 1.x with @animo-id/pex 6.1.1, the fork used by Credo 0.7, so both resolve to a single copy of @sphereon/ssi-types. - presentationFrom now returns a PresentationResult; request the submission embedded in the presentation (presentationSubmissionLocation: PRESENTATION) to keep 1.x behavior - validateDefinition is now a static method on PEX - evaluatePresentation is told to generate a submission when the presentation does not carry one, matching 1.x tolerance - ProofPurpose/IPresentation/IVerifiableCredential/IProof now come from @sphereon/ssi-types; the ProofPurpose OpenAPI enum gains verificationMethod (additive) - bump @sphereon/pex-models to ^2.3.2; regenerate docs/openapi.json Signed-off-by: John Henderson <jrhender@users.noreply.github.com>
pex 6 validates field filters against the DIF Presentation Exchange filter schema, which does not allow free-form json-schema keywords (properties, $ref, definitions, additionalItems). The consent credential @context and credentialSubject filters used those keywords and were rejected, so creating the consent presentation exchange returned 400 in CI. Express the same checks with json paths into the context array and subject instead. Also clean nock interceptors between e2e tests: the 400 aborted one test and its unused callback interceptor absorbed the next tests\x27 callbacks, cascading into two unrelated-looking scope failures. Signed-off-by: John Henderson <jrhender@users.noreply.github.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.
Description
Replaces the unmaintained
@sphereon/pex1.1.3 with@animo-id/pex6.1.1 — the actively maintained fork that Credo 0.7 already depends on — so the workspace resolves a single copy of@sphereon/ssi-typesshared with Credo. Follow-up to the Credo 0.7 migration (part of the #57 modernization series); stacked onchore/credo-0.7.API adaptations for pex 6
pex.presentationFromnow returns aPresentationResult; we passpresentationSubmissionLocation: PRESENTATIONand use.presentations[0]so the submission stays embedded in the presentation, exactly as 1.x behaved.validateDefinitionis now a static method (PEX.validateDefinition).evaluatePresentationis called withgeneratePresentationSubmissionset when the presentation carries no submission, matching the 1.x tolerance for submission-less presentations.ProofPurpose/IPresentation/IVerifiableCredential/IProofnow come from@sphereon/ssi-types. TheProofPurposeOpenAPI enum gains one additive value,verificationMethod(see regenerateddocs/openapi.json).@sphereon/pex-modelsbumped ~2.0.2 → ^2.3.2.Behavior change: stricter presentation-definition validation
pex 6 validates input-descriptor field
filters against the DIF Presentation Exchange filter schema (a keyword whitelist:const,enum,type,pattern,format,contains, tupleitems,not, …). pex 1.x accepted free-form JSON Schema keywords such asproperties,$ref/definitions, andadditionalItems; definitions using those now get a 400 when creating an exchange. The consent e2e fixture used such filters and has been rewritten to express the same checks with JSON paths into the context array and credential subject (spec-conformant and portable across PE implementations).The e2e suites now also run
nock.cleanAll()between tests, so one failed test's unconsumed callback interceptors can no longer absorb later tests' callbacks and cascade into misleading failures.Side benefit
The ajv "strict mode" warning spam emitted by pex 1.x during presentation-definition evaluation is gone.
Verification
credentials/issue→presentations/from(returns embeddedpresentation_submission) →presentations/prove→presentations/verifyreturnsverified: true.PEX.validateDefinitionpasses andevaluatePresentationmatches the exact VP shape the tests submit (both the two-group and single-group variants).🤖 Generated with Claude Code