Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/about/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ IdLE consists of the following elements and components:
A **LifecycleRequest** represents the business intent (for example: Joiner, Mover, Leaver). It is the input to planning.

```powershell
$Request = New-IdleLifecycleRequest -LifecycleEvent 'Joiner' -IdentityKeys @{
$Request = New-IdleRequest -LifecycleEvent 'Joiner' -IdentityKeys @{
key = 'first.last'
} -DesiredState @{
Firstname = 'First'
Expand Down Expand Up @@ -217,3 +217,4 @@ Hosts may optionally provide an external sink to stream events live:
- `Invoke-IdlePlan -EventSink <object>`
- The sink must implement `WriteEvent(event)`
- ScriptBlock sinks are rejected (secure default)

2 changes: 1 addition & 1 deletion docs/reference/cmdlets.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ This page links the generated per-cmdlet reference pages and includes their syno
| [Export-IdlePlan](cmdlets/Export-IdlePlan.md) | Exports an IdLE LifecyclePlan as a canonical JSON artifact. |
| [Invoke-IdlePlan](cmdlets/Invoke-IdlePlan.md) | Executes an IdLE plan. |
| [New-IdleAuthSession](cmdlets/New-IdleAuthSession.md) | Creates a simple AuthSessionBroker for use with IdLE providers. |
| [New-IdleLifecycleRequest](cmdlets/New-IdleLifecycleRequest.md) | Creates a lifecycle request object. |
| [New-IdlePlan](cmdlets/New-IdlePlan.md) | Creates a deterministic plan from a lifecycle request and a workflow definition. |
| [New-IdleRequest](cmdlets/New-IdleRequest.md) | Creates a lifecycle request object. |
| [Test-IdleWorkflow](cmdlets/Test-IdleWorkflow.md) | Validates an IdLE workflow definition file. |
2 changes: 1 addition & 1 deletion docs/reference/cmdlets/New-IdlePlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Accept wildcard characters: False
```

### -Request
The lifecycle request object created by New-IdleLifecycleRequest.
The lifecycle request object created by New-IdleRequest.

```yaml
Type: Object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ online version:
schema: 2.0.0
---

# New-IdleLifecycleRequest
# New-IdleRequest

## SYNOPSIS
Creates a lifecycle request object.

## SYNTAX

```
New-IdleLifecycleRequest [-LifecycleEvent] &lt;String&gt; [[-CorrelationId] &lt;String&gt;] [[-Actor] &lt;String&gt;]
New-IdleRequest [-LifecycleEvent] &lt;String&gt; [[-CorrelationId] &lt;String&gt;] [[-Actor] &lt;String&gt;]
[[-IdentityKeys] &lt;Hashtable&gt;] [[-DesiredState] &lt;Hashtable&gt;] [[-Changes] &lt;Hashtable&gt;]
[-ProgressAction &lt;ActionPreference&gt;] [&lt;CommonParameters&gt;]
```
Expand All @@ -30,7 +30,7 @@ Changes is optional and stays $null when omitted.

### EXAMPLE 1
```
New-IdleLifecycleRequest -LifecycleEvent Joiner -CorrelationId (New-Guid) -IdentityKeys @{ EmployeeId = '12345' }
New-IdleRequest -LifecycleEvent Joiner -CorrelationId (New-Guid) -IdentityKeys @{ EmployeeId = '12345' }
```

## PARAMETERS
Expand Down
7 changes: 4 additions & 3 deletions docs/reference/providers/provider-exchangeonline.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
title: Provider Reference - IdLE.Provider.ExchangeOnline
sidebar_label: ExchangeOnline
Expand Down Expand Up @@ -229,7 +229,7 @@
}

# 2. Build request with manager data in DesiredState
$req = New-IdleLifecycleRequest `
$req = New-IdleRequest `
-LifecycleEvent 'Leaver' `
-Actor $env:USERNAME `
-Input @{ UserPrincipalName = 'max.power@contoso.com' } `
Expand Down Expand Up @@ -283,7 +283,7 @@
}
}

$req = New-IdleLifecycleRequest `
$req = New-IdleRequest `
-LifecycleEvent 'Leaver' `
-Actor $env:USERNAME `
-Input @{ UserPrincipalName = 'max.power@contoso.com' } `
Expand Down Expand Up @@ -375,7 +375,7 @@
$externalMessageTemplate = Get-Content -Path './templates/oof-external.html' -Raw -Encoding UTF8

# Build request with template content
$req = New-IdleLifecycleRequest `
$req = New-IdleRequest `
-LifecycleEvent 'Leaver' `
-Actor $env:USERNAME `
-Input @{ UserPrincipalName = 'user@contoso.com' } `
Expand Down Expand Up @@ -433,3 +433,4 @@
- **Unit tests:** `tests/Providers/ExchangeOnlineProvider.Tests.ps1`
- **Contract tests:** Provider contract tests validate implementation compliance
- **Known CI constraints:** Tests use mock cmdlet layer; no live Exchange Online calls in CI

3 changes: 2 additions & 1 deletion docs/use/plan-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ For the exact format and normative rules, see [Plan Export Specification](../ref

```powershell
# Example only. Adjust parameters to your environment.
$request = New-IdleLifecycleRequest -LifecycleEvent 'Joiner' -IdentityKeys @{ EmployeeId = 'jdoe' }
$request = New-IdleRequest -LifecycleEvent 'Joiner' -IdentityKeys @{ EmployeeId = 'jdoe' }
$providers = @{ Identity = New-IdleMockIdentityProvider }
$plan = New-IdlePlan -WorkflowPath './workflows/joiner.psd1' -Request $request -Providers $providers
Export-IdlePlan -Plan $plan -Path './artifacts/joiner.plan.json'
Expand All @@ -72,3 +72,4 @@ Plan export can be used as a build artifact:
- Generate a plan export from a known input set.
- Validate the export with schema checks (if available).
- Compare against a known-good baseline (golden file) to detect unexpected drift.

3 changes: 2 additions & 1 deletion docs/use/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ $workflow = Join-Path 'C:\path\to\IdentityLifecycleEngine' 'examples\workflows\<
With the following command we create a simple 'Joiner' request.

```powershell
$request = New-IdleLifecycleRequest -LifecycleEvent 'Joiner'
$request = New-IdleRequest -LifecycleEvent 'Joiner'
```

### 4. Select providers
Expand Down Expand Up @@ -165,3 +165,4 @@ $result.Events | Select-Object Type, StepName, Message
- You can override providers at execution time by passing `-Providers` to `Invoke-IdlePlan`.

:::

3 changes: 2 additions & 1 deletion docs/use/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ When you create a lifecycle request, you provide data in the request object (via
**Creating a request with values:**

```powershell
$req = New-IdleLifecycleRequest -LifecycleEvent 'Joiner' -DesiredState @{
$req = New-IdleRequest -LifecycleEvent 'Joiner' -DesiredState @{
UserPrincipalName = 'jdoe@example.com'
DisplayName = 'John Doe'
GivenName = 'John'
Expand Down Expand Up @@ -306,3 +306,4 @@ Typical validation rules:
- required keys must exist
- condition schemas must be valid
- `*From` paths must reference allowed roots

3 changes: 2 additions & 1 deletion examples/Invoke-IdleDemo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ foreach ($wf in $selected) {
Write-Host ""
Write-DemoHeader "Plan"
$lifecycleEvent = Get-IdleLifecycleEventFromWorkflowName -Name $wf.Name
$request = New-IdleLifecycleRequest -LifecycleEvent $lifecycleEvent -Actor 'example-user'
$request = New-IdleRequest -LifecycleEvent $lifecycleEvent -Actor 'example-user'
$plan = New-IdlePlan -WorkflowPath $wf.Path -Request $request -Providers $providers
Write-Host ("Plan created: LifecycleEvent={0} | Steps={1}" -f $lifecycleEvent, ($plan.Steps | Measure-Object).Count)

Expand Down Expand Up @@ -305,3 +305,4 @@ if ($selected.Count -gt 1 -or $Repeat -gt 1) {
ForEach-Object { [pscustomobject]@{ Status = $_.Name; Count = $_.Count } } |
Format-Table -AutoSize
}

3 changes: 2 additions & 1 deletion examples/Invoke-LeaverWithManagerOOF.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ else {
}
}

$request = New-IdleLifecycleRequest `
$request = New-IdleRequest `
-LifecycleEvent 'Leaver' `
-Actor $env:USERNAME `
-Input @{
Expand Down Expand Up @@ -204,3 +204,4 @@ foreach ($step in $result.Steps) {

Write-Host ""
Write-Host "==> Done." -ForegroundColor Cyan

3 changes: 2 additions & 1 deletion src/IdLE.Core/IdLE.Core.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'Invoke-IdlePlanObject',
'Invoke-IdleProviderMethod',
'New-IdleAuthSessionBroker',
'New-IdleLifecycleRequestObject',
'New-IdleRequestObject',
'New-IdlePlanObject',
'Test-IdleProviderMethodParameter',
'Test-IdleWorkflowDefinitionObject'
Expand All @@ -34,3 +34,4 @@
}
}
}

3 changes: 2 additions & 1 deletion src/IdLE.Core/IdLE.Core.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ Export-ModuleMember -Function @(
'Invoke-IdlePlanObject',
'Invoke-IdleProviderMethod',
'New-IdleAuthSessionBroker',
'New-IdleLifecycleRequestObject',
'New-IdleRequestObject',
'New-IdlePlanObject',
'Test-IdleProviderMethodParameter',
'Test-IdleWorkflowDefinitionObject'
) -Alias @()

66 changes: 66 additions & 0 deletions src/IdLE.Core/Private/Assert-IdleExecutionOptions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,72 @@ $script:IDLE_RETRY_MAX_ATTEMPTS_LIMIT = 10
$script:IDLE_RETRY_INITIAL_DELAY_MS_LIMIT = 60000
$script:IDLE_RETRY_MAX_DELAY_MS_LIMIT = 300000

function Assert-IdleRetryParameters {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[int] $MaxAttempts,

[Parameter(Mandatory)]
[int] $InitialDelayMilliseconds,

[Parameter(Mandatory)]
[double] $BackoffFactor,

[Parameter(Mandatory)]
[int] $MaxDelayMilliseconds,

[Parameter(Mandatory)]
[double] $JitterRatio,

[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string] $SourceName
)

if ($MaxAttempts -lt 0 -or $MaxAttempts -gt $script:IDLE_RETRY_MAX_ATTEMPTS_LIMIT) {
throw [System.ArgumentException]::new(
"${SourceName}: MaxAttempts must be an integer between 0 and $script:IDLE_RETRY_MAX_ATTEMPTS_LIMIT (inclusive).",
'MaxAttempts'
)
}

if ($InitialDelayMilliseconds -lt 0 -or $InitialDelayMilliseconds -gt $script:IDLE_RETRY_INITIAL_DELAY_MS_LIMIT) {
throw [System.ArgumentException]::new(
"${SourceName}: InitialDelayMilliseconds must be an integer between 0 and $script:IDLE_RETRY_INITIAL_DELAY_MS_LIMIT (inclusive).",
'InitialDelayMilliseconds'
)
}

if ($BackoffFactor -lt 1.0) {
throw [System.ArgumentException]::new(
"${SourceName}: BackoffFactor must be a number >= 1.0.",
'BackoffFactor'
)
}

if ($MaxDelayMilliseconds -lt 0 -or $MaxDelayMilliseconds -gt $script:IDLE_RETRY_MAX_DELAY_MS_LIMIT) {
throw [System.ArgumentException]::new(
"${SourceName}: MaxDelayMilliseconds must be an integer between 0 and $script:IDLE_RETRY_MAX_DELAY_MS_LIMIT (inclusive).",
'MaxDelayMilliseconds'
)
}

if ($MaxDelayMilliseconds -lt $InitialDelayMilliseconds) {
throw [System.ArgumentException]::new(
"${SourceName}: MaxDelayMilliseconds ($MaxDelayMilliseconds) must be >= InitialDelayMilliseconds ($InitialDelayMilliseconds).",
'MaxDelayMilliseconds'
)
}

if ($JitterRatio -lt 0.0 -or $JitterRatio -gt 1.0) {
throw [System.ArgumentException]::new(
"${SourceName}: JitterRatio must be a number between 0.0 and 1.0 (inclusive).",
'JitterRatio'
)
}
}

function Assert-IdleExecutionOptions {
[CmdletBinding()]
param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ function Assert-IdlePlanCapabilitiesSatisfied {
continue
}

$stepName = Get-IdleOptionalPropertyValue -Object $s -Name 'Name'
$stepName = Get-IdlePropertyValue -Object $s -Name 'Name'
if ($null -eq $stepName -or [string]::IsNullOrWhiteSpace([string]$stepName)) {
$stepName = '<UnnamedStep>'
}

$capsRaw = Get-IdleOptionalPropertyValue -Object $s -Name 'RequiresCapabilities'
$capsRaw = Get-IdlePropertyValue -Object $s -Name 'RequiresCapabilities'
$caps = if ($null -eq $capsRaw) { @() } else { @($capsRaw) }

if (@($caps).Count -gt 0) {
Expand Down
21 changes: 21 additions & 0 deletions src/IdLE.Core/Private/ConvertTo-IdleCapabilityIdentifier.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Set-StrictMode -Version Latest

function ConvertTo-IdleCapabilityIdentifier {
[CmdletBinding()]
param(
[Parameter()]
[AllowNull()]
[object] $Value
)

if ($null -eq $Value) {
return $null
}

$cap = ($Value -as [string]).Trim()
if ([string]::IsNullOrWhiteSpace($cap)) {
return $null
}

return $cap
}
62 changes: 62 additions & 0 deletions src/IdLE.Core/Private/ConvertTo-IdleCapabilityList.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Set-StrictMode -Version Latest

function ConvertTo-IdleCapabilityList {
[CmdletBinding()]
param(
[Parameter()]
[AllowNull()]
[object[]] $Capabilities,

[Parameter()]
[switch] $Validate,

[Parameter()]
[switch] $Normalize,

[Parameter()]
[switch] $Unique,

[Parameter()]
[switch] $Sort,

[Parameter()]
[AllowEmptyString()]
[string] $ErrorPrefix = 'Capability'
)

$items = @()

foreach ($c in @($Capabilities)) {
if ($null -eq $c) {
continue
}

$s = ConvertTo-IdleCapabilityIdentifier -Value $c
if ($null -eq $s) {
continue
}

if ($Validate -and -not (Test-IdleCapabilityIdentifier -Capability $s)) {
throw [System.ArgumentException]::new(
"$ErrorPrefix '$s' is invalid. Expected dot-separated segments like 'IdLE.Identity.Read' or 'IdLE.Entitlement.Write'.",
'Capabilities'
)
}

if ($Normalize) {
$s = ConvertTo-IdleNormalizedCapability -Capability $s
}

$items += $s
}

if ($Unique) {
$items = @($items | Sort-Object -Unique)
}

if ($Sort) {
$items = @($items | Sort-Object)
}

return @($items)
}
18 changes: 0 additions & 18 deletions src/IdLE.Core/Private/ConvertTo-IdlePlanExportObject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,6 @@ function ConvertTo-IdlePlanExportObject {
return $null
}

function ConvertTo-NullIfEmptyString {
[CmdletBinding()]
param(
[Parameter()]
[object] $Value
)

if ($null -eq $Value) {
return $null
}

if ($Value -is [string] -and [string]::IsNullOrWhiteSpace($Value)) {
return $null
}

return $Value
}

# ---- Engine block --------------------------------------------------------
$engineMap = New-OrderedMap
$engineMap.name = 'IdLE'
Expand Down
Loading
Loading