Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/jarm_sdk #158

Merged
merged 86 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
e9dd686
feat: changed the default uri scheme to openid4vp
sksadjad Sep 3, 2024
5954644
chore: fixed tests to be inline with changes in the uri scheme of rp
sksadjad Sep 3, 2024
44b35dc
chore: fixed tests to be inline with changes in the uri scheme of rp
sksadjad Sep 3, 2024
e3e862f
Merge remote-tracking branch 'origin/feat/SPRIND-50' into feature/fro…
sanderPostma Sep 13, 2024
820e507
chore: cherry picked & cleaned up changes from Funke branch
sanderPostma Sep 13, 2024
08d54c9
chore: new ssi-sdk
sanderPostma Sep 16, 2024
f2b5a4b
chore: getTypesFromCredentialSupported fix for v13
sanderPostma Sep 17, 2024
fa80d94
Merge remote-tracking branch 'origin/develop' into feature/from-funke
sanderPostma Sep 18, 2024
072576a
chore: post-merge fixes
sanderPostma Sep 19, 2024
d7fb47a
Merge branch 'fix/conformance-fixes' into feature/from-funke
sanderPostma Sep 20, 2024
faa6060
Merge remote-tracking branch 'origin/fix/post-merge' into feature/fro…
sanderPostma Sep 20, 2024
4a43bd7
chore: test-utils fix
sanderPostma Sep 20, 2024
ec20823
chore: lib version updates
sanderPostma Sep 23, 2024
8ae9923
chore: updated pex version
sanderPostma Sep 23, 2024
e929c18
chore: updated pex version
sanderPostma Sep 23, 2024
6fde238
chore: updated pex version
sanderPostma Sep 23, 2024
ab32f58
chore: updated pex version
sanderPostma Sep 23, 2024
f0375b5
chore: disabled test which should fail but does not anymore
sanderPostma Sep 23, 2024
505ee0d
chore: expect possible mdocs in assertValidVerifiablePresentations
sanderPostma Sep 23, 2024
695f4a9
chore: fixes during conformance testing
sanderPostma Sep 25, 2024
22ec4c9
chore: latest pex
sanderPostma Sep 25, 2024
872893a
chore: PR feedback
sanderPostma Sep 25, 2024
48418e4
chore: reverted unnecessary event changes
sanderPostma Sep 25, 2024
9017e1f
chore: lockfile
sanderPostma Sep 25, 2024
95e52dc
chore: evaluationResults.errors eval fix
sanderPostma Sep 26, 2024
6e2a518
chore: dummy commit
sanderPostma Sep 26, 2024
304c131
chore: conformance cherrypicks
sanderPostma Sep 26, 2024
2684b15
chore: ts compile fixes
sanderPostma Sep 27, 2024
c97c034
chore: fixed tests
sanderPostma Sep 27, 2024
c3767b6
chore: fixed tests
sanderPostma Sep 27, 2024
d36176c
chore: fixed tests
sanderPostma Sep 27, 2024
2a8e323
chore: fixed correlationId issue
sanderPostma Sep 27, 2024
339661c
chore: fixes for mattr.launchpad.spec.ts
sanderPostma Sep 27, 2024
9d73138
chore: siop-oid4vp tests passing
sanderPostma Sep 27, 2024
6af9026
chore: picks from conformance branch
sanderPostma Sep 27, 2024
78339f3
Merge branch 'feature/branched-off-develop-20240918' into feature/fro…
sanderPostma Sep 27, 2024
020cb9a
chore: fixed tests
sanderPostma Sep 27, 2024
00f6008
chore: new pexversion
sanderPostma Oct 1, 2024
11890c5
chore: new pexversion
sanderPostma Oct 1, 2024
7f68c75
chore: new pexversion
sanderPostma Oct 1, 2024
104fa7e
chore: dummy commit
sanderPostma Oct 1, 2024
0d48112
chore: lockfile
sanderPostma Oct 1, 2024
9a9f1ab
chore: added redirectUri support
sanderPostma Oct 2, 2024
6900e09
chore: redirectUri correlationId & state params substitution
sanderPostma Oct 2, 2024
b10e7a4
chore: redirectUri fix
sanderPostma Oct 2, 2024
549dddb
chore: multi-vp fixes
sanderPostma Oct 2, 2024
2eda61d
chore: multi-vp fixes
sanderPostma Oct 2, 2024
993a655
chore: multi-vp fixes
sanderPostma Oct 2, 2024
e4e28fa
chore: redirect_uri changes
sanderPostma Oct 2, 2024
e194376
chore: lockfile
sanderPostma Oct 2, 2024
dc97861
chore: updated test
sanderPostma Oct 2, 2024
b3104e6
Merge remote-tracking branch 'auer-martin/jarm' into feature/jarm_sdk
nklomp Oct 3, 2024
7effabd
chore: merge fixes
nklomp Oct 3, 2024
0d7ae93
chore: responseRedirectUri fixes
sanderPostma Oct 3, 2024
fba3f6b
chore: redirect_uri changes
sanderPostma Oct 2, 2024
04dc758
chore: responseRedirectUri fixes
sanderPostma Oct 3, 2024
6e7f459
chore: remove old resolutions
sanderPostma Oct 3, 2024
9429e05
chore: set released version of ssi-types
sanderPostma Oct 3, 2024
566f226
chore: fixed broken word
sanderPostma Oct 3, 2024
25e694d
chore: getResponseRedirectUri mappings optional
sanderPostma Oct 3, 2024
34d9734
Merge remote-tracking branch 'origin/develop' into feature/jarm_sdk
nklomp Oct 3, 2024
d69bad5
Merge remote-tracking branch 'origin/feature/SDK-35_redirect_uri' int…
nklomp Oct 3, 2024
604e62b
chore: merge fixes
nklomp Oct 3, 2024
e520711
fix: missing export
nklomp Oct 3, 2024
e71cd2d
feat: Improve create jarm response callback to also include clientMet…
nklomp Oct 3, 2024
1c1b668
chore: schema update
sanderPostma Oct 4, 2024
be5ceef
feat: Update CI to build branch named unstable releases, fixing dupli…
nklomp Oct 4, 2024
cc8fd0a
Merge branch 'feature/SDK-35_redirect_uri' into feature/multi-vp-fixes
sanderPostma Oct 4, 2024
2ea042b
chore: lockfile
sanderPostma Oct 4, 2024
355a256
chore: fixed $[0] issue
sanderPostma Oct 7, 2024
fffe923
Merge branch 'feature/multi-vp-fixes' into feature/jarm_sdk
sanderPostma Oct 7, 2024
2c7d3e6
chore: pex fixes
sanderPostma Oct 7, 2024
3c63a27
chore: clientMetadata fix
sanderPostma Oct 7, 2024
104a2b5
Merge pull request #156 from Sphereon-Opensource/feature/SDK-35_redir…
nklomp Oct 8, 2024
bb1002c
chore: fixed emitEvent's
sanderPostma Oct 9, 2024
e2dd3ce
Merge remote-tracking branch 'origin/develop' into feature/from-funke
nklomp Oct 9, 2024
05e3b18
chore: Post merge changes
nklomp Oct 9, 2024
019a955
Merge remote-tracking branch 'origin/feature/from-funke' into feature…
nklomp Oct 9, 2024
36c7e09
fix: Codecov
nklomp Oct 9, 2024
b3acdfb
fix: workflows
nklomp Oct 9, 2024
f439944
chore: PR feedback (partly)
sanderPostma Oct 9, 2024
51a21d6
Merge remote-tracking branch 'origin/feature/jarm_sdk' into feature/j…
sanderPostma Oct 9, 2024
d6854b9
chore: PR feedback (partly)
sanderPostma Oct 9, 2024
d0b4ad4
chore: PR feedback (partly)
sanderPostma Oct 10, 2024
d484513
chore: PR feedback (partly)
sanderPostma Oct 10, 2024
0603b43
chore: PR feedback (partly)
sanderPostma Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/build-test-publish-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,25 @@ jobs:
- name: diff
run: git diff

- name: Sets PREID
env:
name: "${{github.ref_name}}"
run: |
echo "PRE_ID=${name//[\/_-]/.}" >> $GITHUB_ENV

- name: publish @latest when on main
if: github.ref == 'refs/heads/main'
run: pnpm publish:latest
run: lerna publish --conventional-commits --force-publish --include-merged-tags --sync-dist-version --create-release github --yes --dist-tag latest --registry https://registry.npmjs.org

- name: publish @next when on develop
if: github.ref == 'refs/heads/develop'
run: pnpm publish:next
run: lerna publish --conventional-prerelease --force-publish --canary --sync-dist-version --no-git-tag-version --include-merged-tags --preid next --pre-dist-tag next --yes --registry https://registry.npmjs.org",

- name: publish @next when on fix
- name: publish @next when on fix branch
if: startsWith(github.ref, 'refs/heads/fix')
run: pnpm publish:next
run: lerna publish --conventional-prerelease --force-publish --canary --sync-dist-version --no-git-tag-version --include-merged-tags --preid fix --pre-dist-tag fix --yes --registry https://registry.npmjs.org",

- name: publish @unstable when on unstable branch
if: startsWith(github.ref, 'refs/heads/feat')
run: pnpm publish:unstable
run: lerna publish --conventional-prerelease --force-publish --canary --sync-dist-version --no-git-tag-version --include-merged-tags --preid $PRE_ID --pre-dist-tag unstable --yes --throttle-size 75 --registry https://registry.npmjs.org

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@
"OID4VP"
]
}

2 changes: 1 addition & 1 deletion packages/callback-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@sphereon/oid4vci-client": "workspace:*",
"@sphereon/oid4vci-common": "workspace:*",
"@sphereon/oid4vci-issuer": "workspace:*",
"@sphereon/ssi-types": "0.29.1-unstable.208",
"@sphereon/ssi-types": "0.30.1",
"jose": "^4.10.0"
},
"devDependencies": {
Expand Down
18 changes: 14 additions & 4 deletions packages/client/lib/OpenID4VCIClientV1_0_13.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export class OpenID4VCIClientV1_0_13 {
);
}
const credentialsSupported = metadata.credential_configurations_supported;
if (!metadata.credential_configurations_supported || !credentialsSupported[credentialIdentifier]) {
if (!credentialsSupported || !credentialsSupported[credentialIdentifier]) {
throw new Error(`Credential type ${credentialIdentifier} is not supported by issuer ${this.getIssuer()}`);
}
} else if (!types) {
Expand All @@ -472,9 +472,19 @@ export class OpenID4VCIClientV1_0_13 {
console.log(`Not all credential types ${JSON.stringify(credentialTypes)} are present in metadata for ${this.getIssuer()}`);
// throw Error(`Not all credential types ${JSON.stringify(credentialTypes)} are supported by issuer ${this.getIssuer()}`);
}
} else if (metadata.credential_configurations_supported && !Array.isArray(metadata.credential_configurations_supported)) {
const credentialsSupported = metadata.credential_configurations_supported;
if (types.some((type) => !metadata.credential_configurations_supported || !credentialsSupported[type])) {
} else if (metadata.credential_configurations_supported && typeof(metadata.credential_configurations_supported) === 'object') {
let typeSupported = false;
Object.values(metadata.credential_configurations_supported).forEach((supportedCredential) => {
const subTypes = getTypesFromCredentialSupported(supportedCredential);
if (
subTypes.every((t, i) => types[i] === t) ||
(types.length === 1 && (types[0] === supportedCredential.id || subTypes.includes(types[0])))
) {
typeSupported = true;
}
})

if (!typeSupported) {
throw Error(`Not all credential types ${JSON.stringify(credentialTypes)} are supported by issuer ${this.getIssuer()}`);
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/client/lib/__tests__/SphereonE2E.spec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,4 @@ describe('ismapolis bug report #63, https://github.com/Sphereon-Opensource/OID4V
console.log(JSON.stringify(credentialResponse.credential));
});
});

2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@sphereon/oid4vc-common": "workspace:*",
"@sphereon/oid4vci-common": "workspace:*",
"@sphereon/ssi-types": "0.29.1-unstable.208",
"@sphereon/ssi-types": "0.30.1",
"cross-fetch": "^3.1.8",
"debug": "^4.3.5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:clean": "tsc --build --clean && tsc --build"
},
"dependencies": {
"@sphereon/ssi-types": "0.29.1-unstable.208",
"@sphereon/ssi-types": "0.30.1",
"jwt-decode": "^4.0.0",
"sha.js": "^2.4.11",
"uint8arrays": "3.1.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/did-auth-siop-adapter/lib/did/DidJWT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function assertIssSelfIssuedOrDid(payload: JWTPayload) {
}
}

export function getSubDidFromPayload(payload: JWTPayload, header?: JWTHeader): string {
export function getSubDidFromPayload(payload: JWTPayload, header?: JWTHeader): string | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert. The assert method below ensures a string is always present

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it now. But my tsc does not look inside assertIssSelfIssuedOrDid, so have to return payload.sub! instead

assertIssSelfIssuedOrDid(payload)

if (isIssSelfIssued(payload)) {
Expand All @@ -258,9 +258,9 @@ export function getSubDidFromPayload(payload: JWTPayload, header?: JWTHeader): s

export function isIssSelfIssued(payload: JWTPayload): boolean {
return (
(payload.iss && payload.iss.includes(ResponseIss.SELF_ISSUED_V1)) ||
(payload.iss && (payload.iss.includes(ResponseIss.SELF_ISSUED_V1)) ||
(payload.iss && payload.iss.includes(ResponseIss.SELF_ISSUED_V2)) ||
payload.iss === payload.sub
payload.iss === payload.sub)
)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/issuer-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"@sphereon/oid4vc-common": "workspace:*",
"@sphereon/oid4vci-common": "workspace:*",
"@sphereon/oid4vci-issuer": "workspace:*",
"@sphereon/ssi-express-support": "0.29.1-unstable.208",
"@sphereon/ssi-types": "0.29.1-unstable.208",
"@sphereon/ssi-express-support": "0.30.1",
"@sphereon/ssi-types": "0.30.1",
"body-parser": "^1.20.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/issuer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@sphereon/oid4vc-common": "workspace:*",
"@sphereon/oid4vci-common": "workspace:*",
"@sphereon/ssi-types": "0.29.1-unstable.208",
"@sphereon/ssi-types": "0.30.1",
"uuid": "^9.0.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/oid4vci-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@sphereon/oid4vc-common": "workspace:*",
"@sphereon/ssi-types": "0.29.1-unstable.208",
"@sphereon/ssi-types": "0.30.1",
"cross-fetch": "^3.1.8",
"debug": "^4.3.5",
"jwt-decode": "^4.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@ describe('create Request Uri should', () => {
response_type: 'id_token',
request_object_signing_alg_values_supported: [SigningAlgo.EDDSA, SigningAlgo.ES256],
redirect_uri: EXAMPLE_REDIRECT_URL,
claims: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this all of a sudden? claims are only required when it really is OID4VP. Not for SIOPv2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed again and tests are passing. I remember tests failing at some point, but something else must have been fixed by now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually test "succeed when requesting with a valid PD" fails when I do not provide the claims on line 553

TypeError: Cannot read properties of undefined (reading 'vp_token')

vp_token: {
presentation_definition: {
id: 'Ontario Health Insurance Plan',
name: 'Ontario',
purpose: 'purpose',
input_descriptors: [
{
id: 'Ontario Health Insurance Plan',
name: 'Ontario',
schema: [
{
uri: 'https://did.itsourweb.org:3000/smartcredential/Ontario-Health-Insurance-Plan',
},
],
},
],
} as IPresentationDefinition,
},
},
},
requestObject: {
jwtIssuer: {
Expand Down Expand Up @@ -152,7 +172,7 @@ describe('create Request Uri should', () => {
expect(uriRequest.authorizationRequestPayload).toBeDefined()

const uriDecoded = decodeURIComponent(uriRequest.encodedUri)
expect(uriDecoded).toContain(`openid://`)
expect(uriDecoded).toContain(`openid4vp://`)
expect(uriDecoded).toContain(`response_type=${ResponseType.ID_TOKEN}`)
expect(uriDecoded).toContain(`&redirect_uri=${opts.payload?.redirect_uri}`)
expect(uriDecoded).toContain(`&scope=${Scope.OPENID}`)
Expand All @@ -167,6 +187,33 @@ describe('create Request Uri should', () => {
expect.assertions(4)
const opts: CreateAuthorizationRequestOpts = {
version: SupportedVersion.SIOPv2_ID1,
payload: {
client_id: WELL_KNOWN_OPENID_FEDERATION,
scope: 'test',
response_type: 'id_token',
request_object_signing_alg_values_supported: [SigningAlgo.ES256, SigningAlgo.EDDSA],
redirect_uri: EXAMPLE_REDIRECT_URL,
claims: {
vp_token: {
presentation_definition: {
id: 'Ontario Health Insurance Plan',
name: 'Ontario',
purpose: 'purpose',
input_descriptors: [
{
id: 'Ontario Health Insurance Plan',
name: 'Ontario',
schema: [
{
uri: 'https://did.itsourweb.org:3000/smartcredential/Ontario-Health-Insurance-Plan',
},
],
},
],
} as IPresentationDefinition,
},
},
},
requestObject: {
jwtIssuer: { method: 'did', didUrl: KID, alg: SigningAlgo.ES256 },
passBy: PassBy.REFERENCE,
Expand All @@ -184,6 +231,26 @@ describe('create Request Uri should', () => {
response_type: 'id_token',
request_object_signing_alg_values_supported: [SigningAlgo.ES256, SigningAlgo.EDDSA],
redirect_uri: EXAMPLE_REDIRECT_URL,
claims: {
vp_token: {
presentation_definition: {
id: 'Ontario Health Insurance Plan',
name: 'Ontario',
purpose: 'purpose',
input_descriptors: [
{
id: 'Ontario Health Insurance Plan',
name: 'Ontario',
schema: [
{
uri: 'https://did.itsourweb.org:3000/smartcredential/Ontario-Health-Insurance-Plan',
},
],
},
],
} as IPresentationDefinition,
},
},
},
},
clientMetadata: {
Expand Down Expand Up @@ -222,6 +289,33 @@ describe('create Request Uri should', () => {
expect.assertions(3)
const opts: CreateAuthorizationRequestOpts = {
version: SupportedVersion.SIOPv2_ID1,
payload: {
client_id: WELL_KNOWN_OPENID_FEDERATION,
scope: 'test',
response_type: 'id_token',
request_object_signing_alg_values_supported: [SigningAlgo.ES256, SigningAlgo.EDDSA],
redirect_uri: EXAMPLE_REDIRECT_URL,
claims: {
vp_token: {
presentation_definition: {
id: 'Ontario Health Insurance Plan',
name: 'Ontario',
purpose: 'purpose',
input_descriptors: [
{
id: 'Ontario Health Insurance Plan',
name: 'Ontario',
schema: [
{
uri: 'https://did.itsourweb.org:3000/smartcredential/Ontario-Health-Insurance-Plan',
},
],
},
],
} as IPresentationDefinition,
},
},
},
requestObject: {
passBy: PassBy.VALUE,
jwtIssuer: {
Expand Down Expand Up @@ -268,10 +362,10 @@ describe('create Request Uri should', () => {
const uriRequest = await URI.fromOpts(opts)

const uriDecoded = decodeURIComponent(uriRequest.encodedUri)
expect(uriDecoded).toContain(`openid://?request=eyJhbGciOi`)
expect(uriDecoded).toContain(`openid4vp://?client_id=https://www.example.com/`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not remove the test for request = jwt. This obviously should have been a new expect. And then not toContain but a check that it starts with

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


const data = URI.parse(uriDecoded)
expect(data.scheme).toEqual('openid://')
expect(data.scheme).toEqual('openid4vp://')
expect(data.authorizationRequestPayload.request).toContain(`eyJhbGciOi`)
})
})
Expand Down Expand Up @@ -511,30 +605,33 @@ describe('create Request JWT should', () => {
it('succeed when requesting with a valid PD', async () => {
const opts: CreateAuthorizationRequestOpts = {
version: SupportedVersion.SIOPv2_ID1,
/*payload: {
payload: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the payload fully re-enabled, whilst this test already contains a request object. If you need to add things add them there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted.
I guess I must have been testing with a broken pex or something

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually test "should throw error if presentation definition object is not valid" fails without the payload
It expects

Presentation definition in the request claims is not valid

but receives

Received message: "referenceUri specified, but object to host there is not present"

  14 |     if (opts.reference_uri) {
  15 |       // reference URI, but no actual payload to host there!
> 16 |       throw Error(SIOPErrors.REFERENCE_URI_NO_PAYLOAD)
     |             ^
  17 |     } else if (checkRequestObject) {
  18 |       throw Error(SIOPErrors.BAD_PARAMS)
  19 |     }

There is a payload in the opts root, but that doesn't end up in the requestObject

client_id: WELL_KNOWN_OPENID_FEDERATION,
scope: 'test',
response_type: 'id_token',
request_object_signing_alg_values_supported: [SigningAlgo.ES256, SigningAlgo.EDDSA],
redirect_uri: EXAMPLE_REDIRECT_URL,
request_object_signing_alg_values_supported: [SigningAlgo.EDDSA, SigningAlgo.ES256],
claims: {
vp_token: {
presentation_definition: {
id: 'Insurance Plans',
id: 'Ontario Health Insurance Plan',
name: 'Ontario',
purpose: 'purpose',
input_descriptors: [
{
id: 'Ontario Health Insurance Plan',
name: 'Ontario',
schema: [
{
uri: 'https://did.itsourweb.org:3000/smartcredential/Ontario-Health-Insurance-Plan',
},
],
},
],
},
} as IPresentationDefinition,
},
},
},*/
},
requestObject: {
jwtIssuer: { method: 'did', didUrl: KID, alg: SigningAlgo.ES256K },
passBy: PassBy.REFERENCE,
Expand Down Expand Up @@ -598,7 +695,7 @@ describe('create Request JWT should', () => {
const uriRequest = await URI.fromOpts(opts)

const uriDecoded = decodeURIComponent(uriRequest.encodedUri)
expect(uriDecoded).toEqual(`openid://?request_uri=https://rp.acme.com/siop/jwts`)
expect(uriDecoded).toEqual(`openid4vp://?client_id=https://www.example.com/.well-known/openid-federation&scope=test&response_type=id_token&request_object_signing_alg_values_supported=[\"ES256\",\"EdDSA\"]&redirect_uri=https://acme.com/hello&claims={"vp_token\":{\"presentation_definition":{\"id\":\"Ontario Health Insurance Plan\",\"name\":"Ontario\",\"purpose":"purpose\","input_descriptors":[{\"id":\"Ontario Health Insurance Plan\",\"name":\"Ontario\",\"schema":[{\"uri\":\"https://did.itsourweb.org:3000/smartcredential/Ontario-Health-Insurance-Plan\"}]}]}}}&request_uri=https://rp.acme.com/siop/jwts`)
expect((await (await uriRequest.toAuthorizationRequest())?.requestObject?.getPayload())?.claims.vp_token).toBeDefined()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ describe('create JWT from Request JWT should', () => {
}),
jwtIssuer: { method: 'did', didUrl: `${mockResEntity.did}#controller`, alg: SigningAlgo.ES256K },
presentationExchange: {
verifiablePresentations: [verifiablePresentationResult.verifiablePresentation],
verifiablePresentations: verifiablePresentationResult.verifiablePresentations,
vpTokenLocation: VPTokenLocation.ID_TOKEN,
presentationSubmission: await createPresentationSubmission([verifiablePresentationResult.verifiablePresentation], {
presentationSubmission: await createPresentationSubmission(verifiablePresentationResult.verifiablePresentations, {
presentationDefinitions: [definition],
}),
},
Expand Down Expand Up @@ -634,8 +634,8 @@ describe('create JWT from Request JWT should', () => {
}),
jwtIssuer: { method: 'did', didUrl: `${mockResEntity.did}#controller`, alg: SigningAlgo.ES256K },
presentationExchange: {
verifiablePresentations: [verifiablePresentationResult.verifiablePresentation],
presentationSubmission: await createPresentationSubmission([verifiablePresentationResult.verifiablePresentation], {
verifiablePresentations: verifiablePresentationResult.verifiablePresentations,
presentationSubmission: await createPresentationSubmission(verifiablePresentationResult.verifiablePresentations, {
presentationDefinitions: [definition],
}),
vpTokenLocation: VPTokenLocation.ID_TOKEN,
Expand Down
Loading
Loading