@@ -96,11 +96,11 @@ export class CredentialGroupBlockHandler implements BlockHandler {
9696 _block : SerializedBlock ,
9797 inputs : Record < string , unknown >
9898 ) : Promise < BlockOutput > {
99- if ( ! ctx . workspaceId ) throw new Error ( 'workspaceId is required for Credential Group operations' )
10099 const operation = parseOperation ( inputs . operation )
101100 if ( ! ctx . principal ?. executionMetadata ) {
102101 throw new Error ( 'Credential Group operations require an authenticated workflow execution' )
103102 }
103+ const executionWorkspaceId = requireExecutorWorkspaceId ( ctx )
104104 const credentialGroupId =
105105 operation === 'list_groups'
106106 ? undefined
@@ -119,6 +119,7 @@ export class CredentialGroupBlockHandler implements BlockHandler {
119119 principal,
120120 input : {
121121 credentialGroupId : credentialGroupId ! ,
122+ assertedWorkspaceId : executionWorkspaceId ,
122123 limit : parseLimit ( inputs . limit ) ,
123124 cursor : parseOptionalString ( inputs . cursor , 'Cursor' ) ,
124125 email : parseOptionalString ( inputs . email , 'Email' ) ,
@@ -133,11 +134,12 @@ export class CredentialGroupBlockHandler implements BlockHandler {
133134 return result
134135 }
135136 case 'send_invite' : {
136- await enforceCredentialGroupInvitationExecutionRateLimit ( requireExecutorWorkspaceId ( ctx ) )
137+ await enforceCredentialGroupInvitationExecutionRateLimit ( executionWorkspaceId )
137138 const result = await sendCredentialGroupInvite . execute ( {
138139 principal,
139140 input : {
140141 credentialGroupId : credentialGroupId ! ,
142+ assertedWorkspaceId : executionWorkspaceId ,
141143 email : requireString ( inputs . email , 'Email' ) ,
142144 } ,
143145 } )
@@ -154,11 +156,12 @@ export class CredentialGroupBlockHandler implements BlockHandler {
154156 }
155157 }
156158 case 'get_invite_link' : {
157- await enforceCredentialGroupInvitationExecutionRateLimit ( requireExecutorWorkspaceId ( ctx ) )
159+ await enforceCredentialGroupInvitationExecutionRateLimit ( executionWorkspaceId )
158160 const result = await createCredentialGroupInviteLink . execute ( {
159161 principal,
160162 input : {
161163 credentialGroupId : credentialGroupId ! ,
164+ assertedWorkspaceId : executionWorkspaceId ,
162165 email : requireString ( inputs . email , 'Email' ) ,
163166 } ,
164167 } )
@@ -185,6 +188,7 @@ export class CredentialGroupBlockHandler implements BlockHandler {
185188 principal,
186189 input : {
187190 credentialGroupId : credentialGroupId ! ,
191+ assertedWorkspaceId : executionWorkspaceId ,
188192 limit : parseLimit ( inputs . limit ) ,
189193 cursor : parseOptionalString ( inputs . cursor , 'Cursor' ) ,
190194 email : parseOptionalString ( inputs . email , 'Email' ) ,
@@ -202,13 +206,13 @@ export class CredentialGroupBlockHandler implements BlockHandler {
202206 const result = await listCredentialGroupsForWorkflow . execute ( {
203207 principal,
204208 input : {
205- workspaceId : ctx . workspaceId ,
209+ workspaceId : executionWorkspaceId ,
206210 limit : parseLimit ( inputs . limit ) ,
207211 cursor : parseOptionalString ( inputs . cursor , 'Cursor' ) ,
208212 } ,
209213 } )
210214 logger . info ( 'Listed Credential Groups' , {
211- workspaceId : ctx . workspaceId ,
215+ workspaceId : executionWorkspaceId ,
212216 count : result . count ,
213217 hasMore : result . hasMore ,
214218 } )
0 commit comments