Skip to content

Commit 1f9c1e4

Browse files
committed
fix: update tests and seed data for allowTokenExchange
1 parent 32313d4 commit 1f9c1e4

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

packages/core/src/oidc/grants/token-exchange/index.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ const { buildHandler } = await import('./index.js');
1616
const noop = async () => {};
1717
const findSubjectToken = jest.fn();
1818
const updateSubjectTokenById = jest.fn();
19-
const findApplicationById = jest.fn().mockResolvedValue(mockApplication);
19+
const findApplicationById = jest.fn().mockResolvedValue({
20+
...mockApplication,
21+
customClientMetadata: { ...mockApplication.customClientMetadata, allowTokenExchange: true },
22+
});
2023

2124
const mockQueries = {
2225
subjectTokens: {

packages/core/src/routes/applications/application.test.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ const tenantContext = new MockTenant(
4949
...mockApplication.oidcClientMetadata,
5050
...body.oidcClientMetadata,
5151
},
52+
customClientMetadata: {
53+
...mockApplication.customClientMetadata,
54+
...body.customClientMetadata,
55+
},
5256
})
5357
),
5458
updateApplicationById,
@@ -113,6 +117,10 @@ describe('application route', () => {
113117
name,
114118
description,
115119
type,
120+
customClientMetadata: {
121+
...mockApplication.customClientMetadata,
122+
allowTokenExchange: true,
123+
},
116124
});
117125
});
118126

@@ -157,7 +165,10 @@ describe('application route', () => {
157165
id: mockId,
158166
name,
159167
type,
160-
customClientMetadata,
168+
customClientMetadata: {
169+
...customClientMetadata,
170+
allowTokenExchange: true,
171+
},
161172
});
162173
});
163174

packages/schemas/src/seeds/application.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export const createTenantMachineToMachineApplication = (
113113
},
114114
customClientMetadata: {
115115
tenantId,
116+
allowTokenExchange: true,
116117
},
117118
});
118119

packages/schemas/src/types/mapi-proxy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,7 @@ export const getMapiProxyM2mApp = (tenantId: string): Readonly<CreateApplication
5858
redirectUris: [],
5959
postLogoutRedirectUris: [],
6060
},
61+
customClientMetadata: {
62+
allowTokenExchange: true,
63+
},
6164
});

0 commit comments

Comments
 (0)