Skip to content

Commit

Permalink
chore: update to latest pex-models and some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Jan 14, 2024
1 parent d89524b commit 103b861
Show file tree
Hide file tree
Showing 12 changed files with 1,286 additions and 1,019 deletions.
18 changes: 14 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
# Release Notes

## v3.0.0 - 2024-01-14

- Added:
- Initial support for Selective Disclosure JWTs (SD-JWT). API is mostly the same, but to be sure we released it as a
new major version
- Updated:
- Update to latest pex-models, containing some definition updates
- Fixed:
- Fix evaluation rule All when there are no marked input descriptors

## v2.2.2 - 2023-11-28

- Updated:
- Updated pex-model deps
- Added more logic to deduce holder(s) for a VP
- Fixed:
- Logic when to generate a presentation submission was incorrect
- Logic when to generate a presentation submission was incorrect

## v2.2.1 - 2023-10-23

Expand All @@ -25,9 +35,9 @@
- Fix issue with verifiableCredential path dereferencing

- Added:
- Support for external presentation submission paths for VPs and VCs as used by OID4VP (path_nested)
- Support for `jwt_vc_json` format
- Support for the `format` property at tje input descriptor level next to the global level
- Support for external presentation submission paths for VPs and VCs as used by OID4VP (path_nested)
- Support for `jwt_vc_json` format
- Support for the `format` property at tje input descriptor level next to the global level

## v2.1.2 and v2.1.1 - 2023-09-28

Expand Down
4 changes: 2 additions & 2 deletions lib/evaluation/evaluationClientWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,8 @@ export class EvaluationClientWrapper {
const descriptorMap = presentationSubmission
? presentationSubmission.descriptor_map
: this._client.generatePresentationSubmission
? this._client.presentationSubmission.descriptor_map
: undefined;
? this._client.presentationSubmission.descriptor_map
: undefined;

descriptorMap?.forEach((d) => {
// NOTE: currently we only support a single VP for a single PD, so that means an SD-JWT will always have the path '$'.
Expand Down
4 changes: 2 additions & 2 deletions lib/evaluation/handlers/uriEvaluationHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export class UriEvaluationHandler extends AbstractEvaluationHandler {
Array.isArray(credential.type)
? credential.type.forEach((type) => uris.push(type))
: credential.type
? uris.push(credential.type)
: undefined;
? uris.push(credential.type)
: undefined;
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/types/SSITypesBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SSITypesBuilder {
}

public static modelEntityInternalPresentationDefinitionV2(p: PdV2): InternalPresentationDefinitionV2 {
const pd: PdV2 = SSITypesBuilder.createCopyAndModifyPresentationDefinition(p);
const pd: PdV2 = SSITypesBuilder.createCopyAndModifyPresentationDefinition(p) as PresentationDefinitionV2;
return new InternalPresentationDefinitionV2(pd.id, pd.input_descriptors, pd.format, pd.frame, pd.name, pd.purpose, pd.submission_requirements);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/sdJwt.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Disclosure } from '@sd-jwt/core';
import { Base64url } from '@sd-jwt/core/build/base64url';
import { getDisclosuresForPresentationFrame } from '@sd-jwt/core/build/sdJwt';
import { swapClaims } from '@sd-jwt/core/build/sdJwt/swapClaim';
import { PresentationFrame } from '@sd-jwt/core/build/types/present';
import { Base64url } from '@sd-jwt/utils';
import {
Hasher,
SdJwtDecodedDisclosure,
Expand Down
1 change: 0 additions & 1 deletion lib/validation/bundlers/frameVB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ export class FrameVB extends ValidationBundler<unknown> {
}
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface Frame {}
47 changes: 26 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sphereon/pex",
"version": "2.2.3-unstable.0",
"version": "3.0.0-unstable.0",
"description": "A Typescript implementation of the v1 and v2 DIF Presentation Exchange specification",
"main": "dist/main/index.js",
"module": "dist/module/index.js",
Expand Down Expand Up @@ -38,39 +38,44 @@
"test:cov": "jest --ci --coverage && codecov"
},
"engines": {
"node": ">=16"
"node": ">=18"
},
"dependencies": {
"@astronautlabs/jsonpath": "^1.1.2",
"@sd-jwt/core": "0.1.2-alpha.0",
"@sphereon/pex-models": "^2.1.2",
"@sphereon/ssi-types": "0.17.6-unstable.69",
"@sd-jwt/core": "^0.1.2-alpha.2",
"@sphereon/pex-models": "^2.1.5",
"@sphereon/ssi-types": "0.18.0",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"jwt-decode": "^3.1.2",
"nanoid": "^3.3.6",
"string.prototype.matchall": "^4.0.8"
"nanoid": "^3.3.7",
"string.prototype.matchall": "^4.0.10"
},
"devDependencies": {
"@types/jest": "^29.5.2",
"@types/node": "^16.18.38",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"@types/jest": "^29.5.11",
"@types/node": "^18.19.6",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"ajv-cli": "^5.0.0",
"codecov": "^3.8.3",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.27.5",
"jest": "^29.6.1",
"eslint-plugin-import": "^2.29.1",
"jest": "^29.7.0",
"npm-run-all": "^4.1.5",
"open-cli": "^7.2.0",
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"open-cli": "^8.0.0",
"prettier": "^3.2.1",
"rimraf": "^5.0.5",
"ts-jest": "^29.1.1",
"ts-json-schema-generator": "^1.2.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
"ts-json-schema-generator": "^1.5.0",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"resolutions": {
"@sd-jwt/utils": "0.1.2-alpha.2",
"@sd-jwt/decode": "0.1.2-alpha.1",
"@sd-jwt/types": "0.1.2-alpha.3"
},
"files": [
"index.ts",
Expand Down
Loading

0 comments on commit 103b861

Please sign in to comment.