Skip to content

Commit 7970e21

Browse files
committed
fix(sailpoint): align account contract fixtures
1 parent b944a2f commit 7970e21

3 files changed

Lines changed: 26 additions & 4 deletions

File tree

apps/sim/blocks/blocks/sailpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ export const SailPointBlock: BlockConfig = {
10301030
wandConfig: {
10311031
enabled: true,
10321032
prompt:
1033-
'Generate the requestedForWithRequestedItems JSON array for SailPoint. Each entry requires identityId and requestedItems and may set identityType HUMAN or MACHINE. Machine requests must use MACHINE for every entry and support ENTITLEMENT items only. For Request Access, machine grants or modifications require the exact accountSelection returned by Get Account Selections; omit accountSelection when running Get Account Selections itself. Machine revokes use nativeIdentity without accountSelection. Human revoke requests must use the flat payload instead. Items may include comment, startDate, removeDate, accountSelection, nativeIdentity, formInstanceId, and clientMetadata where supported. Return ONLY the JSON array - no explanations, no extra text.',
1033+
"Generate the requestedForWithRequestedItems JSON array for SailPoint. Each entry requires identityId and requestedItems and may set identityType HUMAN or MACHINE. Machine requests must use MACHINE for every entry and support ENTITLEMENT items only. For Request Access, machine grants or modifications require the exact accountSelection returned by Get Account Selections; omit accountSelection when running Get Account Selections itself. Machine revokes omit accountSelection and normally include nativeIdentity; nativeIdentity may be omitted only when SailPoint can auto-resolve the machine's sole account on the entitlement source. Human revoke requests must use the flat payload instead. Items may include comment, startDate, removeDate, accountSelection, nativeIdentity, formInstanceId, and clientMetadata where supported. Return ONLY the JSON array - no explanations, no extra text.",
10341034
placeholder: 'Describe recipients, items, and account selections...',
10351035
},
10361036
},

apps/sim/lib/internal/sailpoint/execute-tool.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ describe('SailPoint internal tool handler', () => {
349349
it('sends the experimental header for account-selection discovery', async () => {
350350
mockFetch
351351
.mockResolvedValueOnce(tokenResponse())
352-
.mockResolvedValueOnce(Response.json({ accountsSelections: [] }))
352+
.mockResolvedValueOnce(Response.json({ identities: [] }))
353353
const response = await request('sailpoint_get_account_selections', {
354354
requestedFor: ['identity'],
355355
requestedItems: [{ type: 'ROLE', id: 'role' }],
@@ -361,12 +361,12 @@ describe('SailPoint internal tool handler', () => {
361361
})
362362

363363
it.each([
364-
['sailpoint_get_account_selections', 'accountSelections', { accountsSelections: [] }],
364+
['sailpoint_get_account_selections', 'accountSelections', { identities: [] }],
365365
['sailpoint_get_access_request_config', 'accessRequestConfig', { accessRequest: {} }],
366366
[
367367
'sailpoint_get_entitlement_request_config',
368368
'entitlementRequestConfig',
369-
{ grantRequestConfig: {} },
369+
{ accessRequestConfig: {} },
370370
],
371371
])('maps %s to its resource-named output', async (operation, outputKey, providerBody) => {
372372
clearSailPointTokenStateForTests()

apps/sim/tools/sailpoint/definitions.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,28 @@ describe('SailPoint exact input contracts', () => {
9595
).toThrow('REVOKE_ACCESS allows at most one entitlement item')
9696
})
9797

98+
it('allows SailPoint to auto-resolve a machine revoke account when nativeIdentity is omitted', () => {
99+
expect(
100+
sailpointRequestAccessTool.operation.input({
101+
...credentials,
102+
requestType: 'REVOKE_ACCESS',
103+
requestedForWithRequestedItems: [
104+
{
105+
identityId: 'machine',
106+
identityType: 'MACHINE',
107+
requestedItems: [{ type: 'ENTITLEMENT', id: 'entitlement', comment: 'remove' }],
108+
},
109+
],
110+
})
111+
).toMatchObject({
112+
requestedForWithRequestedItems: [
113+
{
114+
requestedItems: [{ type: 'ENTITLEMENT', id: 'entitlement', comment: 'remove' }],
115+
},
116+
],
117+
})
118+
})
119+
98120
it('supports account-selection discovery without a preselected account', () => {
99121
expect(
100122
sailpointGetAccountSelectionsTool.operation.input({

0 commit comments

Comments
 (0)