Conversation
… provider support Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
blindzero
left a comment
There was a problem hiding this comment.
@copilot did you make sure not to use ExchangeOnlineManagement as it seems to have issues with PowerShell Core which is our minimum? EXOM seems to be only available for PowerShell Desk?
How are other EXO Adapter Integration handling it?
Make sure also to include this in the documentations which are not generated automatically.
Code Coverage Report
|
…ADME for PowerShell 7+ compat Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
The new permission adapter methods ( Documentation has been updated in commit
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7dc3881441
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This pull request adds a new IdLE step type IdLE.Step.Mailbox.EnsurePermissions for idempotent mailbox delegate permissions management in Exchange Online. The implementation follows established IdLE patterns for provider-agnostic steps with adapter-based testability.
Changes:
- New step type for convergent mailbox permissions (FullAccess, SendAs, SendOnBehalf) with data-only validation and ScriptBlock rejection
- Exchange Online provider extended with
EnsureMailboxPermissionsmethod and 8 new adapter methods behind the testable boundary - New capability
IdLE.Mailbox.Permissions.Ensureadded to step metadata catalog and provider advertisements
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/IdLE.Steps.Mailbox/Public/Invoke-IdleStepMailboxPermissionsEnsure.ps1 | New step implementation with validation, security boundaries, and comprehensive comment-based help |
| src/IdLE.Steps.Mailbox/Public/Get-IdleStepMetadataCatalog.ps1 | Added EnsurePermissions step metadata with required capabilities |
| src/IdLE.Steps.Mailbox/IdLE.Steps.Mailbox.psm1 | Exported new step function |
| src/IdLE.Steps.Mailbox/IdLE.Steps.Mailbox.psd1 | Added step function to manifest FunctionsToExport |
| src/IdLE.Provider.ExchangeOnline/Public/New-IdleExchangeOnlineProvider.ps1 | Added EnsureMailboxPermissions ScriptMethod and new capability advertisement |
| src/IdLE.Provider.ExchangeOnline/Private/New-IdleExchangeOnlineAdapter.ps1 | Added 8 permission adapter methods (Get/Add/Remove for FullAccess, SendAs, SendOnBehalf) |
| tests/Steps/Invoke-IdleStepMailboxPermissionsEnsure.Tests.ps1 | Comprehensive step tests covering behavior, validation, idempotency, and security boundaries |
| tests/Providers/ExchangeOnlineProvider.Tests.ps1 | Provider contract tests with fake adapter for all three permission types |
src/IdLE.Steps.Mailbox/Public/Invoke-IdleStepMailboxPermissionsEnsure.ps1
Show resolved
Hide resolved
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
No capability existed to converge mailbox delegate permissions (FullAccess, SendAs, SendOnBehalf) within an IdLE workflow, forcing hosts to implement this outside the plan/execute boundary.
New step:
IdLE.Step.Mailbox.EnsurePermissionsProvider-agnostic, idempotent step that converges delegate permissions for a mailbox. Supports all three v1 rights; validates data-only input and rejects ScriptBlocks.
Capability
IdLE.Mailbox.Permissions.Ensureto the step metadata catalog and toGetCapabilitieson the ExchangeOnline provider.ExchangeOnline provider
EnsureMailboxPermissionsScriptMethod — reads current state per right type, computes delta, applies only necessary changes.GetMailboxPermissions,AddMailboxPermission,RemoveMailboxPermission→ wrapsGet/Add/Remove-MailboxPermissionGetRecipientPermissions,AddRecipientPermission,RemoveRecipientPermission→ wrapsGet/Add/Remove-RecipientPermissionGetMailboxSendOnBehalf,SetMailboxSendOnBehalf→ wrapsGet-Mailbox/Set-Mailbox -GrantSendOnBehalfToModule surface
Invoke-IdleStepMailboxPermissionsEnsureadded toFunctionsToExportin both the.psd1manifest and.psm1.IdLE.Step.Mailbox.EnsurePermissionsregistered insrc/IdLE.Core/Private/Get-IdleStepRegistry.ps1so the engine can dispatch the step in workflows.Documentation
docs/reference/steps.mdregenerated (viaGenerate-IdleStepReference.ps1) to include the new step type.docs/reference/steps/step-mailbox-ensure-permissions.mdgenerated with full step reference.docs/reference/providers/provider-exchangeonline.mdupdated with the new capability in the step types table, a delegate permissions workflow example snippet, a PowerShell 7+ / ExchangeOnlineManagement v3+ compatibility note, and a permissions-related troubleshooting entry.src/IdLE.Steps.Mailbox/README.mdupdated to list the new step type.website/sidebars.jsupdated to includestep-mailbox-ensure-permissionsin the Step Reference sidebar navigation, alongside the other mailbox step pages.Original prompt
This section details on the original issue you should resolve
<issue_title>ExchangeOnline - mailbox permissions</issue_title>
<issue_description>## Problem Statement
There is currently no capability or Step Type in IdLE to set mailbox delegate permissions (e.g. FullAccess, SendAs, SendOnBehalf) for Exchange Online mailboxes.
For real-world JML workflows this is a common requirement (shared mailboxes, assistants, team mailboxes, role mailboxes). Today, workflow authors must implement this outside IdLE, which breaks:
Proposed Solution
Add a provider-agnostic step and capability for mailbox permission convergence.
New Step Type
IdLE.Step.Mailbox.EnsurePermissionsIdLE.Steps.MailboxCapability
IdLE.Mailbox.Permissions.EnsureStep input contract (With)
Supported rights (v1)
Minimum viable scope (v1):
FullAccessSendAsSendOnBehalfNon-goals for v1 (nice-to-have later):
Provider contract extension
Extend the mailbox provider contract with a single, mockable method (name is a suggestion):
EnsureMailboxPermissions(MailboxIdentity, Permissions, AuthSession)Where
Permissionsis a data-only array (see above) and the provider returns a data-only result describing:Exchange Online provider implementation
In
IdLE.Provider.ExchangeOnline, implement the contract using an internal adapter layer so it is testable without calling EXO:Get-MailboxPermission,Add-MailboxPermission,Remove-MailboxPermissionGet-RecipientPermission,Add-RecipientPermission,Remove-RecipientPermissionGet-Mailbox(or existingGetMailbox) +Set-Mailbox -GrantSendOnBehalfToStep behavior
Changed = $false.Changed = $true.Tests
Documentation
docs/reference/steps.md) by updating step help and running the generator.Impact
Additional Context
Repository review indicates
IdLE.Steps.Mailboxcurrently exports only:IdLE.Step.Mailbox.GetInfoIdLE.Step.Mailbox.EnsureTypeIdLE.Step.Mailbox.EnsureOutOfOfficeand the Exchange Online provider advertises mailbox capabilities for info/type/OOO only.
This enhancement covers the missing mailbox delegate permissions use case.
Consider using pure Graph Access with Scope, not ExchangeOnlineManagement module, depending what is more likely already available or easier to integrate.
</issue_description>
<agent_instructions>- No interactive prompts.
AuthSessionBroker.</agent_instructions>
Comments on the Issue (you are @copilot in this section)
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.