Skip to content

Commit f83165b

Browse files
committed
fix(microsoft_ad): require the service principal ID only on the first page
Every other single-resource ID field pairs its condition with a matching required rule; servicePrincipalId had none, so a first-page run could pass block validation with an empty ID and fail inside the tool instead. Require it unless a continuation URL is supplied, matching the paged per-user operations.
1 parent 5a3568a commit f83165b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

apps/sim/blocks/blocks/microsoft_ad.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,15 @@ export const MicrosoftAdBlock: BlockConfig<MicrosoftAdResponse> = {
688688
field: 'operation',
689689
value: 'list_service_principal_app_role_assignments',
690690
},
691+
/**
692+
* The continuation URL already addresses the service principal, so the ID is only
693+
* required for the first page. An empty operation list matches nothing, which is how
694+
* the function form of `required` expresses "not required".
695+
*/
696+
required: (values) =>
697+
values?.nextLink
698+
? { field: 'operation', value: [] }
699+
: { field: 'operation', value: 'list_service_principal_app_role_assignments' },
691700
},
692701
{
693702
id: 'servicePrincipalSearch',

0 commit comments

Comments
 (0)