Skip to content

Commit

Permalink
chore: dcql fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Jan 13, 2025
1 parent 4ff1d70 commit 7e8a5fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions packages/siop-oid4vp/lib/__tests__/SdJwt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { defaultHasher, SigningAlgo } from '@sphereon/oid4vc-common'
import { IPresentationDefinition } from '@sphereon/pex'
import { decodeSdJwtVc, OriginalVerifiableCredential } from '@sphereon/ssi-types'
import { DcqlCredential, DcqlQuery } from 'dcql'
import { Json } from 'dcql/dist/src/u-dcql'

import {
OP,
Expand Down Expand Up @@ -35,6 +34,11 @@ import {

jest.setTimeout(30000)

type Json = string | number | boolean | null | { // Not exported from dcql
[key: string]: Json;
} | Json[];


const EXAMPLE_REDIRECT_URL = 'https://acme.com/hello'

const HOLDER_DID = 'did:example:ebfeb1f712ebc6f1c276e12ec21'
Expand Down Expand Up @@ -371,7 +375,7 @@ describe.skip('RP and OP interaction should', () => {
.withResponseType([ResponseType.ID_TOKEN, ResponseType.VP_TOKEN])
.withResponseMode(ResponseMode.DIRECT_POST)
.withRedirectUri(EXAMPLE_REDIRECT_URL)
.withDcqlQuery(JSON.stringify(sdJwtVcQuery), [PropertyTarget.REQUEST_OBJECT])
.withDcqlQuery(sdJwtVcQuery, [PropertyTarget.REQUEST_OBJECT])
.withPresentationVerification(presentationVerificationCallback)
.withRevocationVerification(RevocationVerification.NEVER)
.withRequestBy(PassBy.VALUE)
Expand Down
3 changes: 2 additions & 1 deletion packages/siop-oid4vp/lib/rp/RPBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { EventEmitter } from 'events'

import { IPresentationDefinition } from '@sphereon/pex'
import { Hasher } from '@sphereon/ssi-types'
import { DcqlQuery } from 'dcql'

import { PropertyTarget, PropertyTargets } from '../authorization-request'
import { PresentationVerificationCallback } from '../authorization-response'
Expand All @@ -23,7 +24,7 @@ import {
import { assignIfAuth, assignIfRequestObject, isTarget, isTargetOrNoTargets } from './Opts'
import { RP } from './RP'
import { IRPSessionManager } from './types'
import { DcqlQuery } from 'dcql'


export class RPBuilder {
requestObjectBy: ObjectBy
Expand Down
2 changes: 1 addition & 1 deletion packages/siop-oid4vp/lib/types/SIOP.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export interface AuthorizationRequestPayloadVD12OID4VPD20
presentation_definition_uri?: string
client_id_scheme?: ClientIdSchemeOID4VPD20
response_uri?: string // New since OID4VP18 OPTIONAL. The Response URI to which the Wallet MUST send the Authorization Response using an HTTPS POST request as defined by the Response Mode direct_post. The Response URI receives all Authorization Response parameters as defined by the respective Response Type. When the response_uri parameter is present, the redirect_uri Authorization Request parameter MUST NOT be present. If the redirect_uri Authorization Request parameter is present when the Response Mode is direct_post, the Wallet MUST return an invalid_request Authorization Response error.
dcql_query?: DcqlQuery
dcql_query?: string
}

export type ClientIdSchemeOID4VPD18 = 'pre-registered' | 'redirect_uri' | 'entity_id' | 'did'
Expand Down

0 comments on commit 7e8a5fd

Please sign in to comment.