Skip to content

Simplify EntraConnect DirectorySync auth flow: provider-managed PSRemoting with provider-specific step inputs#286

Merged
ntt-matthias-fleschuetz merged 23 commits into
mainfrom
copilot/fix-psremoting-integration
May 16, 2026
Merged

Simplify EntraConnect DirectorySync auth flow: provider-managed PSRemoting with provider-specific step inputs#286
ntt-matthias-fleschuetz merged 23 commits into
mainfrom
copilot/fix-psremoting-integration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

This PR simplifies the TriggerDirectorySync contract and EntraConnect integration by keeping provider-specific sync inputs (ComputerName, PolicyType) as direct With.* keys while making step-level input requirements provider-agnostic.

What changed

  • Re-assessed TriggerDirectorySync contract usage and removed ProviderInput nesting for this step/provider path.
  • Refactored TriggerDirectorySync step + metadata so step-level WithSchema has no required keys.
  • Kept With.Provider, With.AuthSessionName, and With.AuthSessionOptions optional (default behavior applies when omitted).
  • Treated ComputerName and PolicyType as provider-specific inputs (validated by provider implementations, not enforced at step schema level).
  • Kept and documented With.AuthSessionOptions support (including provider docs).
  • Kept EntraConnect provider methods on direct ComputerName / PolicyType arguments.
  • Updated tests and regenerated step/provider documentation to match the finalized contract.

Follow-up review adjustments

  • Optimized the step reference generator output for steps with no required With.* keys (instead of manually editing generated docs), then regenerated references.
  • Re-added a workflow template example showing With.AuthSessionOptions usage for EntraConnect routing.
  • Refined TriggerDirectorySync step tests:
    • renamed misleading test wording around AuthSessionName
    • restored step-path coverage for PolicyType='Initial'
    • added/clarified negative coverage for invalid PolicyType via provider-side validation.

Validation

  • Ran targeted step/metadata regression tests.
  • Ran full Pester validation.
  • Addressed review feedback and revalidated.

Copilot AI and others added 2 commits May 16, 2026 14:34
Agent-Logs-Url: https://github.com/blindzero/IdentityLifecycleEngine/sessions/b70820fb-7961-4838-961b-84daf403564c

Co-authored-by: ntt-matthias-fleschuetz <55826276+ntt-matthias-fleschuetz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/blindzero/IdentityLifecycleEngine/sessions/b70820fb-7961-4838-961b-84daf403564c

Co-authored-by: ntt-matthias-fleschuetz <55826276+ntt-matthias-fleschuetz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix DirectorySync.EntraConnect PSRemoting integration Simplify EntraConnect DirectorySync auth flow: provider-managed PSRemoting with ComputerName + credential May 16, 2026
Copilot AI and others added 2 commits May 16, 2026 14:49
…put bag

Agent-Logs-Url: https://github.com/blindzero/IdentityLifecycleEngine/sessions/9b8fa8e3-45d0-45c6-abc2-984967098764

Co-authored-by: ntt-matthias-fleschuetz <55826276+ntt-matthias-fleschuetz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/blindzero/IdentityLifecycleEngine/sessions/9b8fa8e3-45d0-45c6-abc2-984967098764

Co-authored-by: ntt-matthias-fleschuetz <55826276+ntt-matthias-fleschuetz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/blindzero/IdentityLifecycleEngine/sessions/73833856-5f99-4ea9-92c2-88a8d0ab57ab

Co-authored-by: ntt-matthias-fleschuetz <55826276+ntt-matthias-fleschuetz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/blindzero/IdentityLifecycleEngine/sessions/b84c0287-8b71-4286-a986-5d9f19e324fe

Co-authored-by: ntt-matthias-fleschuetz <55826276+ntt-matthias-fleschuetz@users.noreply.github.com>
Comment thread docs/reference/steps/step-trigger-directory-sync.md Outdated
Comment thread docs/reference/providers/provider-directorysync-entraconnect.md
Copilot AI and others added 2 commits May 16, 2026 15:06
Agent-Logs-Url: https://github.com/blindzero/IdentityLifecycleEngine/sessions/635b8c6e-5ebf-4a09-9f40-8192625d5bae

Co-authored-by: ntt-matthias-fleschuetz <55826276+ntt-matthias-fleschuetz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/blindzero/IdentityLifecycleEngine/sessions/635b8c6e-5ebf-4a09-9f40-8192625d5bae

Co-authored-by: ntt-matthias-fleschuetz <55826276+ntt-matthias-fleschuetz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 16, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.powershellgallery.com
    • Triggering command: /usr/bin/pwsh pwsh -NoLogo -NoProfile -File ./tools/Invoke-IdleScriptAnalyzer.ps1 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Simplify EntraConnect DirectorySync auth flow: provider-managed PSRemoting with ComputerName + credential Simplify EntraConnect DirectorySync auth flow: provider-managed PSRemoting with optional AuthSessionName routing May 16, 2026
Comment thread docs/reference/steps/step-trigger-directory-sync.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 16, 2026 16:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

src/IdLE.Provider.DirectorySync.EntraConnect/Public/New-IdleEntraConnectDirectorySyncProvider.ps1:148

  • When $AuthSession is $null, the [ValidateNotNull()] attribute on the [object] parameter will throw first — good — but if it is a value type passed via the script-method invocation, $AuthSession.GetType().FullName after the -isnot [pscredential] check is safe. However, if $AuthSession were ever a hashtable or other non-credential reference type without GetType issues it's fine; consider also formatting the error to include the parameter name (e.g. "AuthSession parameter must be a [PSCredential]...") to keep parity with the more descriptive ComputerName binding error message. Minor wording suggestion only.
        if ($AuthSession -isnot [pscredential]) {
            $actualType = $AuthSession.GetType().FullName
            throw "AuthSession must be a [PSCredential] for PSRemoting session creation. Received: [$actualType]"
        }

Comment thread examples/workflows/templates/ad-joiner-entraconnect-entraid.psd1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 16, 2026 16:27
Comment thread examples/workflows/templates/ad-joiner-entraconnect-entraid.psd1
Comment thread src/IdLE.Steps.DirectorySync/Public/Invoke-IdleStepTriggerDirectorySync.ps1 Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/IdLE.Steps.DirectorySync/Public/Invoke-IdleStepTriggerDirectorySync.ps1:110

  • The DirectorySyncTriggered event data payload forwards $policyType and $computerName verbatim. The Message text is guarded via [string]$policyType, but the structured PolicyType/ComputerName data fields can still receive non-string objects (or $null) from With.*. Downstream event consumers/log sinks previously could rely on these being strings. Consider coercing the event-data fields to [string] as well for consistency. The same applies to the PolicyType payload at line 196 in the non-wait branch.
        $Context.EventSink.WriteEvent('DirectorySyncTriggered', $triggerMessage, $stepName, @{
                PolicyType = $policyType
                ComputerName = $computerName
            })

Comment thread src/IdLE.Steps.DirectorySync/Public/Invoke-IdleStepTriggerDirectorySync.ps1 Outdated
Comment thread examples/workflows/templates/ad-joiner-entraconnect-entraid.psd1
Comment thread docs/reference/providers/provider-directorysync-entraconnect.md Outdated
…tions example

Agent-Logs-Url: https://github.com/blindzero/IdentityLifecycleEngine/sessions/5633de42-e667-431e-b4db-be20d1cf8f2a

Co-authored-by: ntt-matthias-fleschuetz <55826276+ntt-matthias-fleschuetz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 16, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.powershellgallery.com
    • Triggering command: /usr/bin/pwsh pwsh -NoLogo -NoProfile -File ./tools/Invoke-IdleScriptAnalyzer.ps1 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 16, 2026 16:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

… provider methods

Agent-Logs-Url: https://github.com/blindzero/IdentityLifecycleEngine/sessions/82a977ca-af34-4190-81ce-0a03cc4327f8

Co-authored-by: ntt-matthias-fleschuetz <55826276+ntt-matthias-fleschuetz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 16, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.powershellgallery.com
    • Triggering command: /usr/bin/pwsh pwsh -NoLogo -NoProfile -File ./tools/Invoke-IdleScriptAnalyzer.ps1 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@ntt-matthias-fleschuetz ntt-matthias-fleschuetz merged commit 70915d2 into main May 16, 2026
8 checks passed
@ntt-matthias-fleschuetz ntt-matthias-fleschuetz deleted the copilot/fix-psremoting-integration branch May 16, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix DirectorySync.EntraConnect PSRemoting integration

3 participants