From fa1663453103770a8bbb3cbee0532fd0432c287f Mon Sep 17 00:00:00 2001 From: "A.G.J. Cate" Date: Wed, 22 Jan 2025 16:39:44 +0100 Subject: [PATCH] chore: revert isFirstParty flag --- packages/siop-oid4vp/lib/authorization-response/Payload.ts | 1 + packages/siop-oid4vp/lib/authorization-response/types.ts | 1 + packages/siop-oid4vp/lib/op/OP.ts | 1 + .../lib/schemas/AuthorizationResponseOpts.schema.ts | 3 +++ packages/siop-oid4vp/lib/types/SIOP.types.ts | 1 + 5 files changed, 7 insertions(+) diff --git a/packages/siop-oid4vp/lib/authorization-response/Payload.ts b/packages/siop-oid4vp/lib/authorization-response/Payload.ts index bdd7cc80..6dc5a533 100644 --- a/packages/siop-oid4vp/lib/authorization-response/Payload.ts +++ b/packages/siop-oid4vp/lib/authorization-response/Payload.ts @@ -24,6 +24,7 @@ export const createResponsePayload = async ( ...(responseOpts.accessToken && { access_token: responseOpts.accessToken, expires_in: responseOpts.expiresIn || 3600 }), ...(responseOpts.tokenType && { token_type: responseOpts.tokenType }), ...(responseOpts.refreshToken && { refresh_token: responseOpts.refreshToken }), + ...(responseOpts.isFirstParty && { is_first_party: responseOpts.isFirstParty }), state, } diff --git a/packages/siop-oid4vp/lib/authorization-response/types.ts b/packages/siop-oid4vp/lib/authorization-response/types.ts index 8979b649..fe442bfc 100644 --- a/packages/siop-oid4vp/lib/authorization-response/types.ts +++ b/packages/siop-oid4vp/lib/authorization-response/types.ts @@ -41,6 +41,7 @@ export interface AuthorizationResponseOpts { tokenType?: string refreshToken?: string presentationExchange?: PresentationExchangeResponseOpts + isFirstParty?: boolean } export interface PresentationExchangeResponseOpts { diff --git a/packages/siop-oid4vp/lib/op/OP.ts b/packages/siop-oid4vp/lib/op/OP.ts index 6ec4474d..041e2637 100644 --- a/packages/siop-oid4vp/lib/op/OP.ts +++ b/packages/siop-oid4vp/lib/op/OP.ts @@ -106,6 +106,7 @@ export class OP { issuer?: ResponseIss | string verification?: Verification presentationExchange?: PresentationExchangeResponseOpts + isFirstParty?: boolean }, ): Promise { if ( diff --git a/packages/siop-oid4vp/lib/schemas/AuthorizationResponseOpts.schema.ts b/packages/siop-oid4vp/lib/schemas/AuthorizationResponseOpts.schema.ts index ffb4eee2..3c5afdff 100644 --- a/packages/siop-oid4vp/lib/schemas/AuthorizationResponseOpts.schema.ts +++ b/packages/siop-oid4vp/lib/schemas/AuthorizationResponseOpts.schema.ts @@ -52,6 +52,9 @@ export const AuthorizationResponseOptsSchemaObj = { }, "presentationExchange": { "$ref": "#/definitions/PresentationExchangeResponseOpts" + }, + "isFirstParty": { + "type": "boolean" } }, "required": [ diff --git a/packages/siop-oid4vp/lib/types/SIOP.types.ts b/packages/siop-oid4vp/lib/types/SIOP.types.ts index 1bccd68a..3314f5b1 100644 --- a/packages/siop-oid4vp/lib/types/SIOP.types.ts +++ b/packages/siop-oid4vp/lib/types/SIOP.types.ts @@ -179,6 +179,7 @@ export interface AuthorizationResponsePayload { | MdocOid4vpMdocVpToken presentation_submission?: PresentationSubmission verifiedData?: IPresentation | AdditionalClaims + is_first_party?: boolean // eslint-disable-next-line @typescript-eslint/no-explicit-any [x: string]: any }