Skip to content

Commit

Permalink
chore: "fixed succeed when valid JWT with DCQL query is passed in" to…
Browse files Browse the repository at this point in the history
… pass in a SIOPv2_D12_OID4VP_D20 version request
  • Loading branch information
sanderPostma committed Dec 18, 2024
1 parent 34ec540 commit f94344e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ describe('create JWT from Request JWT should', () => {
DcqlQuery.validate(dcqlParsedQuery)

const requestOpts: CreateAuthorizationRequestOpts = {
version: SupportedVersion.SIOPv2_ID1,
version: SupportedVersion.SIOPv2_D12_OID4VP_D20,
requestObject: {
passBy: PassBy.REFERENCE,
reference_uri: 'https://my-request.com/here',
Expand All @@ -700,11 +700,7 @@ describe('create JWT from Request JWT should', () => {
scope: 'test',
response_type: 'id_token vp_token',
redirect_uri: EXAMPLE_REDIRECT_URL,
claims: {
vp_token: {
dcql_query: dcqlParsedQuery,
},
},
dcql_query: JSON.stringify(dcqlParsedQuery),
},
},
clientMetadata: {
Expand Down Expand Up @@ -761,25 +757,6 @@ describe('create JWT from Request JWT should', () => {
const responseOpts: AuthorizationResponseOpts = {
responseURI: EXAMPLE_REDIRECT_URL,
responseURIType: 'redirect_uri',
registration: {
authorizationEndpoint: 'www.myauthorizationendpoint.com',
issuer: ResponseIss.SELF_ISSUED_V2,
responseTypesSupported: [ResponseType.ID_TOKEN],
passBy: PassBy.REFERENCE,
reference_uri: EXAMPLE_REFERENCE_URL,

subject_syntax_types_supported: ['did:ethr:', SubjectIdentifierType.DID],
vpFormats: {
ldp_vc: {
proof_type: [IProofType.EcdsaSecp256k1Signature2019, IProofType.EcdsaSecp256k1Signature2019],
},
},
logo_uri: VERIFIER_LOGO_FOR_CLIENT,
clientName: VERIFIER_NAME_FOR_CLIENT,
'clientName#nl-NL': VERIFIER_NAME_FOR_CLIENT_NL + '2022100316',
clientPurpose: VERIFIERZ_PURPOSE_TO_VERIFY,
'clientPurpose#nl-NL': VERIFIERZ_PURPOSE_TO_VERIFY_NL,
},
createJwtCallback: getCreateJwtCallback({
did: mockResEntity.did,
hexPrivateKey: mockResEntity.hexPrivateKey,
Expand All @@ -790,7 +767,7 @@ describe('create JWT from Request JWT should', () => {
dcqlQuery: {
encodedPresentationRecord
},
responseMode: ResponseMode.POST,
responseMode: ResponseMode.DIRECT_POST,
}

const requestObject = await RequestObject.fromOpts(requestOpts)
Expand Down
2 changes: 1 addition & 1 deletion packages/siop-oid4vp/lib/id-token/IDToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class IDToken {
const did = jwtIssuer.didUrl.split('#')[0]
this._payload.sub = did

const issuer = this._responseOpts.registration.issuer || this._payload.iss
const issuer = this._responseOpts.registration?.issuer || this._payload.iss
if (!issuer || !(issuer.includes(ResponseIss.SELF_ISSUED_V2) || issuer === this._payload.sub)) {
throw new Error(SIOPErrors.NO_SELF_ISSUED_ISS)
}
Expand Down

0 comments on commit f94344e

Please sign in to comment.