diff --git a/packages/auth/src/interaction/routes.test.ts b/packages/auth/src/interaction/routes.test.ts index 50137533fe..8b5a539cb4 100644 --- a/packages/auth/src/interaction/routes.test.ts +++ b/packages/auth/src/interaction/routes.test.ts @@ -529,6 +529,7 @@ describe('Interaction Routes', (): void => { describe('IDP - Grant details', (): void => { let grant: Grant let access: Access + let interaction: Interaction beforeAll(async (): Promise => { grant = await Grant.query().insert({ @@ -539,6 +540,10 @@ describe('Interaction Routes', (): void => { ...BASE_GRANT_ACCESS, grantId: grant.id }) + + interaction = await Interaction.query().insert( + generateBaseInteraction(grant) + ) }) test('Can get grant details', async (): Promise => { @@ -558,6 +563,7 @@ describe('Interaction Routes', (): void => { await expect(interactionRoutes.details(ctx)).resolves.toBeUndefined() expect(ctx.status).toBe(200) expect(ctx.body).toEqual({ + grantId: grant.id, access: [ { actions: access.actions, diff --git a/packages/auth/src/interaction/routes.ts b/packages/auth/src/interaction/routes.ts index 8f29ea9fa5..cb8ecf0148 100644 --- a/packages/auth/src/interaction/routes.ts +++ b/packages/auth/src/interaction/routes.ts @@ -146,6 +146,7 @@ async function getGrantDetails( ) ctx.body = { + grantId: interaction.grant.id, access: access.map(toOpenPaymentsAccess), state: interaction.state } diff --git a/packages/auth/src/openapi/specs/id-provider.yaml b/packages/auth/src/openapi/specs/id-provider.yaml index d3be9e897b..ad5e1afd7f 100644 --- a/packages/auth/src/openapi/specs/id-provider.yaml +++ b/packages/auth/src/openapi/specs/id-provider.yaml @@ -129,6 +129,9 @@ paths: - PENDING - APPROVED - DENIED + grantId: + description: Id of a grant + type: string '401': description: Unauthorized '404':