diff --git a/AGENTS.md b/AGENTS.md index 9f815ec7..798fb430 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -96,11 +96,13 @@ The engine (`IdLE.Core`) must **not** depend on: - Hosts MUST provide an `AuthSessionBroker`, and steps/providers MUST acquire auth sessions via `Context.AcquireAuthSession(...)` rather than receiving raw credentials directly. - Do not pass secrets or credential objects via provider options or workflow configuration; provider options must remain data-only (no ScriptBlocks, no executable objects). -#### 4.2.1 Capability naming convention +#### 4.2.1 Identifier namespaces (step types, capabilities) -- New work MUST use the IdLE. capability namespace (e.g., IdLE.Identity.Read, IdLE.Identity.Attribute.Ensure, IdLE.Entitlement.Grant). -- Do not introduce new un-namespaced capabilities (e.g., Identity.Read) in new modules. -- If legacy capability names exist, treat them as deprecated aliases and document migration behavior explicitly in the relevant issue/PR. +- `IdLE.*` is reserved for first-party modules shipped in the `IdLE` bundle (e.g., `IdLE.Step.DisableIdentity`, `IdLE.Identity.Read`). +- Extensions (third-party or host modules, including tests) use `.IdLE.*` (e.g., `Contoso.IdLE.Step.Hr.SyncManager`, `Contoso.IdLE.Hr.Manager.Read`); tests use `Test.IdLE.*`. +- A new first-party capability MUST be added to `src/IdLE.Core/Data/ReservedNamespaces.psd1` and `docs/reference/capabilities.md` (kept in sync by tests). +- If legacy capability names exist, treat them as deprecated aliases (`Deprecated` in `ReservedNamespaces.psd1`) and document migration behavior explicitly in the relevant issue/PR. +- Rules and error codes: `docs/extend/steps.md` (Step type names) and `docs/reference/capabilities.md` (Naming rules). ### 4.3 Eventing diff --git a/docs/about/security.md b/docs/about/security.md index 50538bef..b9168887 100644 --- a/docs/about/security.md +++ b/docs/about/security.md @@ -44,6 +44,7 @@ The public `Assert-IdleNoScriptBlock` function is the single, authoritative vali These inputs are **provided by the host** and are **privileged** because they determine what code is executed: - **Step registry** (maps `Step.Type` to a handler function name) +- **Step packs** (modules marked with `PrivateData.IdLE.Kind = 'StepPack'` that declare step types and handlers) - **Provider modules** / provider objects (system-specific adapters) - **External event sinks** (streaming events) - **AuthSessionBroker** (host-provided authentication orchestration) @@ -52,6 +53,14 @@ These inputs are **provided by the host** and are **privileged** because they de **Rule:** Only trusted code should populate these extension points. ::: +Trust levels within these extension points: + +- **First-party:** modules shipped in the loaded `IdLE` bundle and loaded from its folders. Only these may + define `IdLE.*` step types. Module names alone never make a module first-party. +- **Host-trusted:** every other loaded step pack or provider, and the host's own `Providers.StepRegistry` / + `Providers.StepMetadata`. They use their own `.IdLE.*` namespace and can only add step types; they + cannot replace step types defined by another step pack. + These extension points may contain ScriptMethods (e.g., the `AcquireAuthSession` method on AuthSessionBroker objects) but should not contain ScriptBlock *properties* that could be confused with data. #### AuthSessionBroker Trust Model diff --git a/docs/extend/extensibility.md b/docs/extend/extensibility.md index aae7cfb2..e25026b7 100644 --- a/docs/extend/extensibility.md +++ b/docs/extend/extensibility.md @@ -20,6 +20,10 @@ A new step typically involves: See [Steps and Metadata](steps.md#step-metadata-contract) for the required metadata shape. +Extension step types and capabilities use your own owner prefix: `.IdLE.Step..` and +`.IdLE..` (e.g. `Contoso.IdLE.Step.Hr.SyncManager`, `Contoso.IdLE.Hr.Manager.Read`). +`IdLE.*` is reserved for the IdLE project; see [Step type names](steps.md#step-type-names). + Steps can emit structured events using the execution context contract: - `Context.EventSink.WriteEvent(Type, Message, StepName, Data)` @@ -73,7 +77,9 @@ during plan build to validate whether all required functionality is available. The full contract, naming rules, and validation behavior are described in -[Provider Capabilities](../reference/capabilities.md). +[Provider Capabilities](../reference/capabilities.md). Providers may advertise IdLE-defined capabilities +(`IdLE.*`, as listed in the catalog) and their own extension capabilities (`.IdLE.*`); anything else +fails planning. Providers should include the corresponding provider capability contract tests to ensure compliance. @@ -105,10 +111,13 @@ Those belong in a host application. ## Register step handlers -Steps are executed via a host-provided step registry. +Steps are executed via the step registry. - Workflows reference steps by `Type` (identifier). -- The host maps this identifier to a **function name** (string) in the step registry. +- Step packs register their handlers with the `Handler` key in their metadata catalog + (see [Step packs](steps.md#step-packs)). +- For host-defined step types only, the host maps the identifier to a **function name** (string) in + `Providers.StepRegistry`. Step types defined by a step pack cannot be replaced. ScriptBlock handlers are intentionally not supported as a secure default. diff --git a/docs/extend/steps.md b/docs/extend/steps.md index c9afffc0..f95af61b 100644 --- a/docs/extend/steps.md +++ b/docs/extend/steps.md @@ -140,12 +140,31 @@ so hosts do not need `Providers.StepRegistry` for step pack steps: - The module does not need to be imported globally; nested modules work. - `StepCatalog` must point to a file inside the module folder. - A step type may be defined by only one step pack. -- `Providers.StepRegistry` still takes precedence over catalog handlers (e.g. to replace a step in tests). +- Discovery uses the manifest marker only. Module names are never used for discovery or ownership. - `Providers.StepMetadata` must not declare `Handler`; host-defined steps register their handler via `Providers.StepRegistry`. +- Host extension points only supplement step packs: `Providers.StepMetadata` and `Providers.StepRegistry` + cannot redefine or replace a step type defined by a step pack (`DuplicateStepTypeMetadata`, + `DuplicateStepHandler`). -Modules named `IdLE.Steps.*` that export `Get-IdleStepMetadataCatalog` but carry no marker are still -discovered. This fallback is deprecated. +### Step type names + +Step type identifiers follow the namespace rules (owner first, then product): + +| Defined by | Format | Example | +| --- | --- | --- | +| IdLE (first-party step packs in the `IdLE` bundle) | `IdLE.Step..` | `IdLE.Step.Mailbox.GetInfo` | +| Extensions (third-party step packs, host steps) | `.IdLE.Step..` | `Contoso.IdLE.Step.Hr.SyncManager` | + +- `IdLE.*` is reserved. Only modules shipped in the loaded `IdLE` bundle (and loaded from its folders) may + define `IdLE.*` step types; anywhere else they are rejected with `ReservedNamespace`. +- First-party step types that do not match `IdLE.Step.` or `IdLE.Step..` are rejected with `InvalidFirstPartyStepType`. +- Extension step types that do not match `.IdLE.Step.<...>` are rejected with `InvalidExtensionNamespace`. +- The rules apply to step pack catalogs, `Providers.StepMetadata` and `Providers.StepRegistry`. +- Name extension modules `.IdLE.` (e.g. `Contoso.IdLE.Hr`); `IdLE.*` module names are reserved for the + IdLE project. + +Capability identifiers follow the same scheme; see [Capabilities](../reference/capabilities.md#naming-rules). ### Provenance diff --git a/docs/reference/capabilities.md b/docs/reference/capabilities.md index b9c7e426..e5e71f3b 100644 --- a/docs/reference/capabilities.md +++ b/docs/reference/capabilities.md @@ -19,9 +19,18 @@ For the conceptual model (why capabilities exist, how discovery/merging works, a A capability is a **stable string identifier** describing a feature a provider can perform. -Rules: +Namespaces (enforced during planning): + +- `IdLE.*` capabilities are defined by the IdLE project. Only the capabilities listed in the [catalog](#catalog) + are valid; any other `IdLE.*` capability is rejected with `UnknownCapability`. Providers (also third-party + providers) may advertise them, and steps may require them. +- Extensions define their own capabilities as `.IdLE..`, e.g. `Contoso.IdLE.Hr.Manager.Read`. + Anything else (e.g. `Contoso.Hr.Read`) is rejected with `InvalidExtensionNamespace`. +- The rules apply to capabilities advertised by providers (`GetCapabilities()`) and to capabilities required + by step metadata (`RequiredCapabilities`). + +Format rules: -- Must start with the `IdLE.` prefix. - Use **PascalCase** for each segment (e.g., `Identity`, `OutOfOffice`). - Use **verbs** for the last segment whenever possible (`Read`, `List`, `Create`, `Disable`, `Ensure`). - No provider names inside a capability ID. Capabilities describe *what* is possible, not *where* it is implemented. @@ -40,7 +49,8 @@ Examples: ## Catalog -The catalog below lists capabilities currently referenced by the documentation and expected by steps/providers. +The catalog below is the complete list of IdLE-defined capabilities. It matches the list in +`src/IdLE.Core/Data/ReservedNamespaces.psd1` (enforced by tests). ### Identity @@ -68,6 +78,9 @@ Delete an identity/account (hard deprovision). Typically irreversible; steps sho #### `IdLE.Identity.Attribute.Ensure` Ensure one or more attributes on an identity match desired state (set/clear/replace). Provider decides how to map logical attribute names to system fields. +#### `IdLE.Identity.RevokeSessions` +Revoke active sign-in sessions and refresh tokens of an identity (e.g., force sign-out during offboarding). + ### Entitlements #### `IdLE.Entitlement.List` @@ -93,8 +106,11 @@ Ensure mailbox type/config matches desired state (e.g., shared vs user mailbox, #### `IdLE.Mailbox.OutOfOffice.Ensure` Ensure out-of-office / automatic replies configuration matches desired state. +#### `IdLE.Mailbox.Permissions.Ensure` +Ensure mailbox delegate permissions (e.g., FullAccess, SendAs, SendOnBehalf) match desired state. -> Compatibility note: older docs or experiments may reference `IdLE.Mailbox.Read`. Prefer `IdLE.Mailbox.Info.Read` for metadata-only access, to avoid ambiguity with reading message contents. +> Compatibility note: `IdLE.Mailbox.Read` is a deprecated alias of `IdLE.Mailbox.Info.Read`. It is still accepted +> (with a warning) and mapped to `IdLE.Mailbox.Info.Read`. ### Directory synchronization diff --git a/src/IdLE.Core/Data/ReservedNamespaces.psd1 b/src/IdLE.Core/Data/ReservedNamespaces.psd1 new file mode 100644 index 00000000..5b716967 --- /dev/null +++ b/src/IdLE.Core/Data/ReservedNamespaces.psd1 @@ -0,0 +1,55 @@ +# ReservedNamespaces.psd1 - IdLE.Core +# +# Data-only single source of truth for identifier namespaces (no ScriptBlocks). +# +# Rules (owner first, then product): +# - 'IdLE.' is reserved for the IdLE project (first-party modules shipped in the IdLE bundle). +# - Extensions (every other module, host or organization) use '.IdLE.<...>', e.g. 'Contoso.IdLE.Step.Hr.SyncManager'. +# +# Each identifier kind declares: +# ExtensionPattern - regex an extension identifier must match +# Example - extension example used in error messages +@{ + ReservedPrefix = 'IdLE.' + + StepType = @{ + FirstPartyPattern = '^IdLE\.Step(\.[A-Za-z][A-Za-z0-9]*)+$' + ExtensionPattern = '^(?!IdLE\.)[A-Za-z][A-Za-z0-9]*\.IdLE\.Step(\.[A-Za-z][A-Za-z0-9]*)+$' + Example = 'Contoso.IdLE.Step.Hr.SyncManager' + } + + Capability = @{ + ExtensionPattern = '^(?!IdLE\.)[A-Za-z][A-Za-z0-9]*\.IdLE(\.[A-Za-z][A-Za-z0-9]*){2,}$' + Example = 'Contoso.IdLE.Hr.Manager.Read' + + # Capabilities defined by IdLE. 'IdLE.*' capabilities not listed here are rejected, + # whether advertised by a provider or required by step metadata. + # Keep in sync with docs/reference/capabilities.md (enforced by tests). + Defined = @( + 'IdLE.DirectorySync.Status' + 'IdLE.DirectorySync.Trigger' + 'IdLE.Entitlement.Grant' + 'IdLE.Entitlement.List' + 'IdLE.Entitlement.Prune' + 'IdLE.Entitlement.Revoke' + 'IdLE.Identity.Attribute.Ensure' + 'IdLE.Identity.Create' + 'IdLE.Identity.Delete' + 'IdLE.Identity.Disable' + 'IdLE.Identity.Enable' + 'IdLE.Identity.List' + 'IdLE.Identity.Move' + 'IdLE.Identity.Read' + 'IdLE.Identity.RevokeSessions' + 'IdLE.Mailbox.Info.Read' + 'IdLE.Mailbox.OutOfOffice.Ensure' + 'IdLE.Mailbox.Permissions.Ensure' + 'IdLE.Mailbox.Type.Ensure' + ) + + # Deprecated capability -> replacement. Accepted with a warning and mapped to the replacement. + Deprecated = @{ + 'IdLE.Mailbox.Read' = 'IdLE.Mailbox.Info.Read' + } + } +} diff --git a/src/IdLE.Core/Private/Assert-IdlePlanCapabilitiesSatisfied.ps1 b/src/IdLE.Core/Private/Assert-IdlePlanCapabilitiesSatisfied.ps1 index 622fc9a8..881354fb 100644 --- a/src/IdLE.Core/Private/Assert-IdlePlanCapabilitiesSatisfied.ps1 +++ b/src/IdLE.Core/Private/Assert-IdlePlanCapabilitiesSatisfied.ps1 @@ -9,6 +9,9 @@ function Assert-IdlePlanCapabilitiesSatisfied { Fail-fast validation executed during planning. If one or more capabilities are missing, an ArgumentException is thrown with a deterministic error message listing missing capabilities and affected steps. + + Advertised provider capabilities are validated on every planning run (namespace rules), even if no + step requires a capability. #> [CmdletBinding()] param( @@ -21,6 +24,9 @@ function Assert-IdlePlanCapabilitiesSatisfied { [object] $Providers ) + # Validates advertised capabilities (IdLE-defined or '.IdLE.*'); throws on invalid identifiers. + $available = @(Get-IdleAvailableCapabilities -Providers $Providers) + if ($null -eq $Steps -or @($Steps).Count -eq 0) { return } @@ -52,8 +58,6 @@ function Assert-IdlePlanCapabilitiesSatisfied { return } - $available = @(Get-IdleAvailableCapabilities -Providers $Providers) - $missing = @() foreach ($c in $required) { if ($available -notcontains $c) { diff --git a/src/IdLE.Core/Private/ConvertTo-IdleCapabilityList.ps1 b/src/IdLE.Core/Private/ConvertTo-IdleCapabilityList.ps1 index 12a3a9b2..2206a59f 100644 --- a/src/IdLE.Core/Private/ConvertTo-IdleCapabilityList.ps1 +++ b/src/IdLE.Core/Private/ConvertTo-IdleCapabilityList.ps1 @@ -38,11 +38,19 @@ function ConvertTo-IdleCapabilityList { 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'.", + "$ErrorPrefix '$s' is invalid. Expected dot-separated segments like 'IdLE.Identity.Read'.", 'Capabilities' ) } + if ($Validate) { + # IdLE-defined capabilities or extension capabilities ('.IdLE.*') only. + $namespaceError = Get-IdleIdentifierNamespaceError -Kind 'Capability' -Identifier $s + if ($null -ne $namespaceError) { + throw [System.ArgumentException]::new("$namespaceError ($ErrorPrefix)", 'Capabilities') + } + } + if ($Normalize) { $s = ConvertTo-IdleNormalizedCapability -Capability $s } diff --git a/src/IdLE.Core/Private/ConvertTo-IdleNormalizedCapability.ps1 b/src/IdLE.Core/Private/ConvertTo-IdleNormalizedCapability.ps1 index 1d6f9619..f6c7bdfa 100644 --- a/src/IdLE.Core/Private/ConvertTo-IdleNormalizedCapability.ps1 +++ b/src/IdLE.Core/Private/ConvertTo-IdleNormalizedCapability.ps1 @@ -22,11 +22,8 @@ function ConvertTo-IdleNormalizedCapability { [string] $Capability ) - # Deprecated capability ID mappings (pre-1.0) - # Format: @{ 'OldID' = 'NewID' } - $deprecatedMappings = @{ - 'IdLE.Mailbox.Read' = 'IdLE.Mailbox.Info.Read' - } + # Deprecated capability ID mappings (@{ 'OldID' = 'NewID' }) live in Data/ReservedNamespaces.psd1. + $deprecatedMappings = (Get-IdleReservedNamespaces).Capability.Deprecated $normalized = $Capability.Trim() diff --git a/src/IdLE.Core/Private/Get-IdleAvailableCapabilities.ps1 b/src/IdLE.Core/Private/Get-IdleAvailableCapabilities.ps1 index 3e3b6704..c066e7e7 100644 --- a/src/IdLE.Core/Private/Get-IdleAvailableCapabilities.ps1 +++ b/src/IdLE.Core/Private/Get-IdleAvailableCapabilities.ps1 @@ -43,7 +43,8 @@ function Get-IdleAvailableCapabilities { if ($null -eq $caps) { return @() } - return @(ConvertTo-IdleCapabilityList -Capabilities $caps -Normalize -Unique) + # Validate at planning time: providers may only advertise IdLE-defined or '.IdLE.*' capabilities. + return @(ConvertTo-IdleCapabilityList -Capabilities $caps -Validate -Normalize -Unique -ErrorPrefix 'Provider capability') } return @() diff --git a/src/IdLE.Core/Private/Get-IdleIdentifierNamespaceError.ps1 b/src/IdLE.Core/Private/Get-IdleIdentifierNamespaceError.ps1 new file mode 100644 index 00000000..d02bd391 --- /dev/null +++ b/src/IdLE.Core/Private/Get-IdleIdentifierNamespaceError.ps1 @@ -0,0 +1,72 @@ +function Get-IdleIdentifierNamespaceError { + <# + .SYNOPSIS + Checks an identifier against the namespace rules and returns an error message, or $null if valid. + + .DESCRIPTION + Rules (see Data/ReservedNamespaces.psd1): + - StepType: 'IdLE.*' only from first-party modules; extensions use '.IdLE.Step.<...>'. + - Capability: 'IdLE.*' only if defined by IdLE (or a deprecated alias); extensions use '.IdLE..'. + + Messages start with a stable error code (ReservedNamespace, InvalidExtensionNamespace, UnknownCapability). + + .PARAMETER Kind + Identifier kind: StepType or Capability. + + .PARAMETER Identifier + The identifier to check. + + .PARAMETER FirstParty + The identifier is defined by a first-party module (StepType only). + + .OUTPUTS + System.String (error message) or $null. + #> + [CmdletBinding()] + param( + [Parameter(Mandatory)] + [ValidateSet('StepType', 'Capability')] + [string] $Kind, + + [Parameter(Mandatory)] + [ValidateNotNullOrEmpty()] + [string] $Identifier, + + [Parameter()] + [switch] $FirstParty + ) + + $rules = Get-IdleReservedNamespaces + $kindRules = $rules[$Kind] + $label = if ($Kind -eq 'StepType') { 'Step type' } else { 'Capability' } + + if ($Identifier.StartsWith($rules.ReservedPrefix, [System.StringComparison]::OrdinalIgnoreCase)) { + if ($Kind -eq 'Capability') { + if ($kindRules.Defined -contains $Identifier -or $kindRules.Deprecated.ContainsKey($Identifier)) { + return $null + } + + $hint = "Extensions define their own capabilities as '.IdLE..', e.g. '$($kindRules.Example)'." + return "UnknownCapability: Capability '$Identifier' is not defined by IdLE (see docs/reference/capabilities.md). $hint" + } + + if ($FirstParty) { + # Catch catalog typos such as 'IdLE.Foo.Bar' before they become valid workflow step types. + if ($Identifier -notmatch $kindRules.FirstPartyPattern) { + return "InvalidFirstPartyStepType: $label '$Identifier' must follow 'IdLE.Step.' (e.g. 'IdLE.Step.EmitEvent' or 'IdLE.Step.Mailbox.GetInfo')." + } + + return $null + } + + $suffix = $Identifier.Substring($rules.ReservedPrefix.Length) + $hint = "Use '.IdLE.$suffix', e.g. 'Contoso.IdLE.$suffix'." + return "ReservedNamespace: $label '$Identifier' uses the reserved prefix '$($rules.ReservedPrefix)'. $hint" + } + + if ($Identifier -notmatch $kindRules.ExtensionPattern) { + return "InvalidExtensionNamespace: $label '$Identifier' must follow '.IdLE.<...>', e.g. '$($kindRules.Example)'." + } + + return $null +} diff --git a/src/IdLE.Core/Private/Get-IdleReservedNamespaces.ps1 b/src/IdLE.Core/Private/Get-IdleReservedNamespaces.ps1 new file mode 100644 index 00000000..c89f4f31 --- /dev/null +++ b/src/IdLE.Core/Private/Get-IdleReservedNamespaces.ps1 @@ -0,0 +1,23 @@ +function Get-IdleReservedNamespaces { + <# + .SYNOPSIS + Returns the identifier namespace rules (Data/ReservedNamespaces.psd1). + + .DESCRIPTION + The rules are data-only and loaded once per module session. + + .OUTPUTS + Hashtable with ReservedPrefix and one entry per identifier kind (StepType, Capability). + #> + [CmdletBinding()] + param() + + $rules = Get-Variable -Name 'IdleReservedNamespaces' -Scope Script -ValueOnly -ErrorAction SilentlyContinue + if ($null -eq $rules) { + $path = Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -ChildPath 'Data/ReservedNamespaces.psd1' + $rules = Import-PowerShellDataFile -LiteralPath $path + Set-Variable -Name 'IdleReservedNamespaces' -Scope Script -Value $rules + } + + return $rules +} diff --git a/src/IdLE.Core/Private/Get-IdleStepRegistry.ps1 b/src/IdLE.Core/Private/Get-IdleStepRegistry.ps1 index ade5de01..dacb5748 100644 --- a/src/IdLE.Core/Private/Get-IdleStepRegistry.ps1 +++ b/src/IdLE.Core/Private/Get-IdleStepRegistry.ps1 @@ -18,7 +18,21 @@ function Get-IdleStepRegistry { $registry = [hashtable]::new([System.StringComparer]::OrdinalIgnoreCase) - # 1) Copy host-provided StepRegistry (optional) + # 1) Register handlers declared by loaded step packs (StepMetadataCatalog 'Handler' key). + # + # First-party and third-party step packs declare their handlers the same way. Handler names are + # module-qualified, so step packs loaded as nested modules (e.g. by the IdLE meta module) work without + # exporting their commands globally. + $stepPackCatalog = Resolve-IdleStepMetadataCatalog -Providers $null + + foreach ($stepType in $stepPackCatalog.Keys) { + $metadata = $stepPackCatalog[$stepType] + if ($metadata.ContainsKey('Handler')) { + $registry[$stepType] = $metadata['Handler'] + } + } + + # 2) Add host-provided StepRegistry entries (optional) for host-defined step types. # We support two shapes for compatibility: # - Providers.StepRegistry (hashtable) # - Providers['StepRegistry'] (hashtable) @@ -59,25 +73,20 @@ function Get-IdleStepRegistry { ) } - $registry[[string]$key] = ([string]$value).Trim() - } - } - - # 2) Register handlers declared by loaded step packs (StepMetadataCatalog 'Handler' key). - # - # First-party and third-party step packs declare their handlers the same way. Handler names are - # module-qualified, so step packs loaded as nested modules (e.g. by the IdLE meta module) work without - # exporting their commands globally. Host-provided entries from (1) take precedence. - $stepPackCatalog = Resolve-IdleStepMetadataCatalog -Providers $null + # Host step types are extensions ('.IdLE.Step.*') and only supplement step packs: + # replacing the handler of a step pack step type would run other code than the plan declares. + $namespaceError = Get-IdleIdentifierNamespaceError -Kind 'StepType' -Identifier ([string]$key) + if ($null -ne $namespaceError) { + throw [System.ArgumentException]::new("$namespaceError Registered in Providers.StepRegistry.", 'Providers') + } - foreach ($stepType in $stepPackCatalog.Keys) { - if ($registry.ContainsKey($stepType)) { - continue - } + if ($stepPackCatalog.ContainsKey([string]$key)) { + throw [System.InvalidOperationException]::new( + "DuplicateStepHandler: Step type '$key' is defined by a step pack. Providers.StepRegistry can only register handlers for host-defined step types, not replace step pack handlers." + ) + } - $metadata = $stepPackCatalog[$stepType] - if ($metadata.ContainsKey('Handler')) { - $registry[$stepType] = $metadata['Handler'] + $registry[[string]$key] = ([string]$value).Trim() } } diff --git a/src/IdLE.Core/Private/Resolve-IdleStepMetadataCatalog.ps1 b/src/IdLE.Core/Private/Resolve-IdleStepMetadataCatalog.ps1 index 206bd435..64819bee 100644 --- a/src/IdLE.Core/Private/Resolve-IdleStepMetadataCatalog.ps1 +++ b/src/IdLE.Core/Private/Resolve-IdleStepMetadataCatalog.ps1 @@ -154,6 +154,19 @@ function Resolve-IdleStepMetadataCatalog { return } + # Helper: Enforce capability namespaces (IdLE-defined or '.IdLE.*'). + function Assert-IdleRequiredCapabilityNamespace { + param([string] $Capability) + + $namespaceError = Get-IdleIdentifierNamespaceError -Kind 'Capability' -Identifier $Capability + if ($null -ne $namespaceError) { + throw [System.ArgumentException]::new( + "$namespaceError Declared by $SourceName entry for step type '$StepType'.", + 'Providers' + ) + } + } + if ($Value -is [string]) { $cap = ConvertTo-IdleCapabilityIdentifier -Value $Value if ($null -ne $cap -and -not (Test-IdleCapabilityIdentifier -Capability $cap)) { @@ -162,6 +175,9 @@ function Resolve-IdleStepMetadataCatalog { 'Providers' ) } + if ($null -ne $cap) { + Assert-IdleRequiredCapabilityNamespace -Capability $cap + } return } @@ -197,6 +213,8 @@ function Resolve-IdleStepMetadataCatalog { 'Providers' ) } + + Assert-IdleRequiredCapabilityNamespace -Capability $cap } return } @@ -370,9 +388,8 @@ function Resolve-IdleStepMetadataCatalog { return $stepPackCatalog } - # Helper: Discover loaded step packs. - # - Manifest marker PrivateData.IdLE.Kind = 'StepPack' (preferred). - # - Legacy: modules named 'IdLE.Steps.*' exporting Get-IdleStepMetadataCatalog. + # Helper: Discover loaded step packs by manifest marker (PrivateData.IdLE.Kind = 'StepPack'). + # Module names are never used for discovery or ownership. function Get-IdleStepPackModules { [CmdletBinding()] param() @@ -381,11 +398,6 @@ function Resolve-IdleStepMetadataCatalog { foreach ($m in @(Get-Module -All)) { if ($null -ne (Get-IdleStepPackMarker -Module $m)) { $stepPackModules += $m - continue - } - - if ($m.Name -like 'IdLE.Steps.*' -and $null -ne $m.ExportedCommands -and $m.ExportedCommands.ContainsKey('Get-IdleStepMetadataCatalog')) { - $stepPackModules += $m } } @@ -408,7 +420,10 @@ function Resolve-IdleStepMetadataCatalog { [string] $SourceModuleName, [Parameter(Mandatory)] - [hashtable] $StepTypeOwners + [hashtable] $StepTypeOwners, + + [Parameter()] + [switch] $FirstParty ) foreach ($key in $Source.Keys) { @@ -416,6 +431,12 @@ function Resolve-IdleStepMetadataCatalog { throw [System.ArgumentException]::new("$SourceModuleName contains an empty step type key.", 'Providers') } + # Only first-party step packs may define 'IdLE.*' step types; extensions use '.IdLE.Step.*'. + $namespaceError = Get-IdleIdentifierNamespaceError -Kind 'StepType' -Identifier ([string]$key) -FirstParty:$FirstParty + if ($null -ne $namespaceError) { + throw [System.ArgumentException]::new("$namespaceError Defined by step pack '$SourceModuleName'.", 'Providers') + } + $value = $Source[$key] if ($value -isnot [hashtable]) { @@ -466,16 +487,10 @@ function Resolve-IdleStepMetadataCatalog { $stepPackModules = Get-IdleStepPackModules foreach ($module in $stepPackModules) { - $marker = Get-IdleStepPackMarker -Module $module - if ($null -ne $marker) { - $stepPackCatalog = Import-IdleStepPackCatalogFile -Module $module -Marker $marker - } - else { - $stepPackCatalog = & $module.ExportedCommands['Get-IdleStepMetadataCatalog'] - } + $stepPackCatalog = Import-IdleStepPackCatalogFile -Module $module -Marker (Get-IdleStepPackMarker -Module $module) if ($null -ne $stepPackCatalog -and $stepPackCatalog -is [hashtable]) { - Merge-IdleStepPackCatalog -Target $catalog -Source $stepPackCatalog -SourceModuleName $module.Name -StepTypeOwners $stepTypeOwners + Merge-IdleStepPackCatalog -Target $catalog -Source $stepPackCatalog -SourceModuleName $module.Name -StepTypeOwners $stepTypeOwners -FirstParty:(Test-IdleFirstPartyModule -Module $module) } } @@ -492,6 +507,12 @@ function Resolve-IdleStepMetadataCatalog { throw [System.ArgumentException]::new('Providers.StepMetadata contains an empty step type key.', 'Providers') } + # Host step types are extensions: '.IdLE.Step.*'. + $namespaceError = Get-IdleIdentifierNamespaceError -Kind 'StepType' -Identifier ([string]$key) + if ($null -ne $namespaceError) { + throw [System.ArgumentException]::new("$namespaceError Defined by Providers.StepMetadata.", 'Providers') + } + # Check if this step type already exists in step pack catalog (no override allowed) if ($catalog.ContainsKey([string]$key)) { $existingOwner = $stepTypeOwners[[string]$key] diff --git a/src/IdLE.Core/Private/Test-IdleFirstPartyModule.ps1 b/src/IdLE.Core/Private/Test-IdleFirstPartyModule.ps1 new file mode 100644 index 00000000..d03a2bd8 --- /dev/null +++ b/src/IdLE.Core/Private/Test-IdleFirstPartyModule.ps1 @@ -0,0 +1,63 @@ +function Test-IdleFirstPartyModule { + <# + .SYNOPSIS + Returns $true if a module is a first-party module of the loaded IdLE bundle. + + .DESCRIPTION + A module is first-party if it is the IdLE bundle module itself or one of its NestedModules, loaded + from the folder the bundle manifest points to. Ownership is never inferred from module names. + + The folders are derived from the bundle manifest (same rule as the mixed-version guard in + IdLE.Init.ps1), so this works for both the repository layout (src/IdLE.Core next to src/IdLE) + and the packaged layout (IdLE/Modules/IdLE.Core). + + Returns $false if no IdLE bundle is loaded. + + .PARAMETER Module + The module to check. + + .OUTPUTS + System.Boolean + #> + [CmdletBinding()] + param( + [Parameter(Mandatory)] + [System.Management.Automation.PSModuleInfo] $Module + ) + + $bundle = Get-Module -Name 'IdLE' -All | Select-Object -First 1 + if ($null -eq $bundle -or [string]::IsNullOrWhiteSpace($Module.ModuleBase)) { + return $false + } + + $comparison = if ($IsWindows) { [System.StringComparison]::OrdinalIgnoreCase } else { [System.StringComparison]::Ordinal } + $separators = [char[]]@([System.IO.Path]::DirectorySeparatorChar, [System.IO.Path]::AltDirectorySeparatorChar) + + $bundleBase = [System.IO.Path]::GetFullPath($bundle.ModuleBase).TrimEnd($separators) + $moduleBase = [System.IO.Path]::GetFullPath($Module.ModuleBase).TrimEnd($separators) + + if ($Module.Name -eq $bundle.Name) { + return [string]::Equals($moduleBase, $bundleBase, $comparison) + } + + $manifestPath = Join-Path -Path $bundleBase -ChildPath "$($bundle.Name).psd1" + if (-not (Test-Path -LiteralPath $manifestPath -PathType Leaf)) { + return $false + } + + $manifest = Import-PowerShellDataFile -LiteralPath $manifestPath + foreach ($entry in @($manifest.NestedModules)) { + # Manifest entries use '\'; normalize so the path also resolves on Linux/macOS. + $relative = ([string]$entry) -replace '[\\/]', [System.IO.Path]::DirectorySeparatorChar + $nestedManifest = [System.IO.Path]::GetFullPath((Join-Path -Path $bundleBase -ChildPath $relative)) + + if ([System.IO.Path]::GetFileNameWithoutExtension($nestedManifest) -ne $Module.Name) { + continue + } + + $expectedBase = (Split-Path -Path $nestedManifest -Parent).TrimEnd($separators) + return [string]::Equals($moduleBase, $expectedBase, $comparison) + } + + return $false +} diff --git a/src/IdLE.Core/Public/Invoke-IdlePlanObject.ps1 b/src/IdLE.Core/Public/Invoke-IdlePlanObject.ps1 index 7e8eb6e9..146b1276 100644 --- a/src/IdLE.Core/Public/Invoke-IdlePlanObject.ps1 +++ b/src/IdLE.Core/Public/Invoke-IdlePlanObject.ps1 @@ -82,31 +82,6 @@ function Invoke-IdlePlanObject { $engineEventSink = New-IdleEventSink -CorrelationId $corr -Actor $actor -ExternalEventSink $EventSink -EventBuffer $events # Enforce data-only boundary: reject ScriptBlocks in untrusted inputs. - # Special-case: for auth session acquisition options, throw a contextualized error message. - $planSteps = if ($planPropNames -contains 'Steps') { $Plan.Steps } else { $null } - if ($null -ne $planSteps -and ($planSteps -is [System.Collections.IEnumerable]) -and ($planSteps -isnot [string])) { - $i = 0 - foreach ($step in $planSteps) { - $stepType = [string](Get-IdlePropertyValue -Object $step -Name 'Type') - if ($stepType -eq 'IdLE.Step.AcquireAuthSession') { - $with = Get-IdlePropertyValue -Object $step -Name 'With' - $options = $null - if ($null -ne $with) { - if ($with -is [System.Collections.IDictionary]) { - if ($with.Contains('Options')) { $options = $with['Options'] } - } - else { - if ($with.PSObject.Properties.Name -contains 'Options') { $options = $with.Options } - } - } - - Assert-IdleNoScriptBlockInAuthSessionOptions -InputObject $options -Path "Plan.Steps[$i].With.Options" - } - - $i++ - } - } - Assert-IdleNoScriptBlock -InputObject $Plan -Path 'Plan' # Resolve effective providers: explicit -Providers parameter takes precedence, otherwise use Plan.Providers. @@ -207,56 +182,6 @@ function Invoke-IdlePlanObject { return $broker.AcquireAuthSession($Name, $optionsCopy) } -Force - # Fail-fast security validation: Check if AuthSessionBroker is required but missing. - # AcquireAuthSession steps require an AuthSessionBroker to be present in Providers. - # Skip NotApplicable steps, as they won't be executed and don't require the broker. - $requiresAuthBroker = $false - $steps = if ($planPropNames -contains 'Steps') { $Plan.Steps } else { @() } - foreach ($step in $steps) { - if ($null -eq $step) { continue } - - $stepType = $null - $stepStatus = $null - if ($step -is [System.Collections.IDictionary]) { - if ($step.Contains('Type')) { - $stepType = $step['Type'] - } - if ($step.Contains('Status')) { - $stepStatus = $step['Status'] - } - } - else { - $stepPropNames = @($step.PSObject.Properties.Name) - $stepType = if ($stepPropNames -contains 'Type') { $step.Type } else { $null } - $stepStatus = if ($stepPropNames -contains 'Status') { $step.Status } else { $null } - } - - if ($stepType -eq 'IdLE.Step.AcquireAuthSession' -and $stepStatus -ne 'NotApplicable') { - $requiresAuthBroker = $true - break - } - } - - if ($requiresAuthBroker) { - $broker = $null - if ($effectiveProviders -is [System.Collections.IDictionary]) { - if ($effectiveProviders.Contains('AuthSessionBroker')) { - $broker = $effectiveProviders['AuthSessionBroker'] - } - } - else { - if ($null -ne $effectiveProviders -and $effectiveProviders.PSObject.Properties.Name -contains 'AuthSessionBroker') { - $broker = $effectiveProviders.AuthSessionBroker - } - } - - if ($null -eq $broker) { - throw [System.InvalidOperationException]::new( - 'AuthSessionBroker is required but not configured. One or more steps require auth session acquisition. Provide Providers.AuthSessionBroker to proceed.' - ) - } - } - $context.EventSink.WriteEvent( 'RunStarted', 'Plan execution started.', diff --git a/tests/Core/Assert-IdleNoScriptBlock.Tests.ps1 b/tests/Core/Assert-IdleNoScriptBlock.Tests.ps1 index 6aeb5204..23c85d69 100644 --- a/tests/Core/Assert-IdleNoScriptBlock.Tests.ps1 +++ b/tests/Core/Assert-IdleNoScriptBlock.Tests.ps1 @@ -186,7 +186,7 @@ Describe 'Assert-IdleNoScriptBlock' { Steps = @( @{ Name = 'Step1' - Type = 'Test.Step' + Type = 'Test.IdLE.Step.Basic' With = @{ Action = { Invoke-MaliciousCode } } diff --git a/tests/Core/ConvertTo-IdleWorkflowStepPreconditionSettings.Tests.ps1 b/tests/Core/ConvertTo-IdleWorkflowStepPreconditionSettings.Tests.ps1 index 1b25097e..2efc2a3f 100644 --- a/tests/Core/ConvertTo-IdleWorkflowStepPreconditionSettings.Tests.ps1 +++ b/tests/Core/ConvertTo-IdleWorkflowStepPreconditionSettings.Tests.ps1 @@ -8,7 +8,7 @@ BeforeDiscovery { Describe 'ConvertTo-IdleWorkflowStepPreconditionSettings' { InModuleScope 'IdLE.Core' { It 'returns null values when the step does not define precondition settings' { - $step = @{ Name = 'Noop'; Type = 'IdLE.Step.Noop' } + $step = @{ Name = 'Noop'; Type = 'Test.IdLE.Step.Noop' } $planningContext = @{ Plan = @{ LifecycleEvent = 'Joiner' }; Request = @{ IdentityKeys = @{}; Intent = @{}; Context = @{} } } $result = ConvertTo-IdleWorkflowStepPreconditionSettings -Step $step -StepName 'Noop' -PlanningContext $planningContext @@ -21,7 +21,7 @@ Describe 'ConvertTo-IdleWorkflowStepPreconditionSettings' { It 'normalizes valid precondition settings and deep-copies the data' { $step = @{ Name = 'GuardedStep' - Type = 'IdLE.Step.Noop' + Type = 'Test.IdLE.Step.Noop' Precondition = @{ Equals = @{ Path = 'Plan.LifecycleEvent'; Value = 'Joiner' } } OnPreconditionFalse = 'Continue' PreconditionEvent = @{ @@ -47,7 +47,7 @@ Describe 'ConvertTo-IdleWorkflowStepPreconditionSettings' { It 'does not throw when precondition uses unresolved Request.Context path in planning context' { $step = @{ Name = 'MissingPath' - Type = 'IdLE.Step.Noop' + Type = 'Test.IdLE.Step.Noop' Precondition = @{ Exists = 'Request.Context.OffboardingDate' } } @@ -58,7 +58,7 @@ Describe 'ConvertTo-IdleWorkflowStepPreconditionSettings' { It 'throws when precondition uses unresolved non-context path in planning context' { $step = @{ Name = 'MissingIntentPath' - Type = 'IdLE.Step.Noop' + Type = 'Test.IdLE.Step.Noop' Precondition = @{ Exists = 'Request.Intent.OffboardingDate' } } @@ -69,7 +69,7 @@ Describe 'ConvertTo-IdleWorkflowStepPreconditionSettings' { It 'throws when OnPreconditionFalse has an invalid value' { $step = @{ Name = 'InvalidPolicy' - Type = 'IdLE.Step.Noop' + Type = 'Test.IdLE.Step.Noop' OnPreconditionFalse = 'StopAll' } diff --git a/tests/Core/Export-IdlePlan.Tests.ps1 b/tests/Core/Export-IdlePlan.Tests.ps1 index f9db7a34..e51ae65e 100644 --- a/tests/Core/Export-IdlePlan.Tests.ps1 +++ b/tests/Core/Export-IdlePlan.Tests.ps1 @@ -17,7 +17,7 @@ Describe 'Export-IdlePlan' { Steps = @( @{ Name = 'Ensure Mailbox' - Type = 'EnsureMailbox' + Type = 'Test.IdLE.Step.EnsureMailbox' With = @{ mailboxType = 'User' } @@ -34,8 +34,8 @@ Describe 'Export-IdlePlan' { $providers = @{ Dummy = $true - StepRegistry = @{ 'EnsureMailbox' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('EnsureMailbox') + StepRegistry = @{ 'Test.IdLE.Step.EnsureMailbox' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.EnsureMailbox') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -91,7 +91,7 @@ Describe 'Export-IdlePlan' { Steps = @( @{ Name = 'Check Context' - Type = 'EnsureMailbox' + Type = 'Test.IdLE.Step.EnsureMailbox' Precondition = @{ Exists = 'Request.Context.OffboardingDate' } With = @{ mailboxType = 'User' } } @@ -107,8 +107,8 @@ Describe 'Export-IdlePlan' { $providers = @{ Dummy = $true - StepRegistry = @{ 'EnsureMailbox' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('EnsureMailbox') + StepRegistry = @{ 'Test.IdLE.Step.EnsureMailbox' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.EnsureMailbox') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers diff --git a/tests/Core/IdentifierNamespaces.Tests.ps1 b/tests/Core/IdentifierNamespaces.Tests.ps1 new file mode 100644 index 00000000..b41126fa --- /dev/null +++ b/tests/Core/IdentifierNamespaces.Tests.ps1 @@ -0,0 +1,145 @@ +Set-StrictMode -Version Latest + +BeforeAll { + . (Join-Path (Split-Path -Path $PSScriptRoot -Parent) '_testHelpers.ps1') + Import-IdleTestModule + + function New-NamespaceTestProvider { + param( + [Parameter(Mandatory)] + [string[]] $Capabilities + ) + + $provider = [pscustomobject]@{ Name = 'NamespaceTestProvider' } + $provider | Add-Member -MemberType NoteProperty -Name Advertised -Value $Capabilities + $provider | Add-Member -MemberType ScriptMethod -Name GetCapabilities -Value { $this.Advertised } -Force + return $provider + } + + function New-NamespaceTestPlan { + param( + [Parameter(Mandatory)] + [hashtable] $Providers + ) + + $wfPath = New-IdleTestWorkflowFile -FileName 'namespaces.psd1' -Content @' +@{ + Name = 'Namespaces' + LifecycleEvent = 'Joiner' + Steps = @( + @{ Name = 'Emit'; Type = 'IdLE.Step.EmitEvent'; With = @{ Message = 'Hello' } } + ) +} +'@ + $req = New-IdleTestRequest -LifecycleEvent 'Joiner' + return New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $Providers + } +} + +Describe 'Identifier namespaces' { + Context 'Rules (Get-IdleIdentifierNamespaceError)' { + It ' (FirstParty: ) -> ' -ForEach @( + @{ Kind = 'StepType'; Identifier = 'IdLE.Step.EmitEvent'; FirstParty = $true; Expected = $null } + @{ Kind = 'StepType'; Identifier = 'IdLE.Step.Mailbox.GetInfo'; FirstParty = $true; Expected = $null } + @{ Kind = 'StepType'; Identifier = 'IdLE.Foo.Bar'; FirstParty = $true; Expected = 'InvalidFirstPartyStepType' } + @{ Kind = 'StepType'; Identifier = 'IdLE.Step'; FirstParty = $true; Expected = 'InvalidFirstPartyStepType' } + @{ Kind = 'StepType'; Identifier = 'IdLE.Step.Foo'; FirstParty = $false; Expected = 'ReservedNamespace' } + @{ Kind = 'StepType'; Identifier = 'idle.step.foo'; FirstParty = $false; Expected = 'ReservedNamespace' } + @{ Kind = 'StepType'; Identifier = 'Contoso.IdLE.Step.Hr.SyncManager'; FirstParty = $false; Expected = $null } + @{ Kind = 'StepType'; Identifier = 'Contoso.Step.Foo'; FirstParty = $false; Expected = 'InvalidExtensionNamespace' } + @{ Kind = 'StepType'; Identifier = 'Contoso.IdLE.Hr.SyncManager'; FirstParty = $false; Expected = 'InvalidExtensionNamespace' } + @{ Kind = 'StepType'; Identifier = 'EnsureMailbox'; FirstParty = $false; Expected = 'InvalidExtensionNamespace' } + @{ Kind = 'Capability'; Identifier = 'IdLE.Identity.Read'; FirstParty = $false; Expected = $null } + @{ Kind = 'Capability'; Identifier = 'IdLE.Mailbox.Read'; FirstParty = $false; Expected = $null } + @{ Kind = 'Capability'; Identifier = 'IdLE.Hr.Manager.Read'; FirstParty = $false; Expected = 'UnknownCapability' } + @{ Kind = 'Capability'; Identifier = 'Contoso.IdLE.Hr.Manager.Read'; FirstParty = $false; Expected = $null } + @{ Kind = 'Capability'; Identifier = 'Contoso.IdLE.Read'; FirstParty = $false; Expected = 'InvalidExtensionNamespace' } + @{ Kind = 'Capability'; Identifier = 'Contoso.Hr.Read'; FirstParty = $false; Expected = 'InvalidExtensionNamespace' } + ) { + InModuleScope 'IdLE.Core' -Parameters $_ { + param($Kind, $Identifier, $FirstParty, $Expected) + + $namespaceError = Get-IdleIdentifierNamespaceError -Kind $Kind -Identifier $Identifier -FirstParty:$FirstParty + + if ($null -eq $Expected) { + $namespaceError | Should -BeNullOrEmpty + } + else { + $namespaceError | Should -BeLike "${Expected}:*" + } + } + } + } + + Context 'Provider capabilities' { + It 'accepts IdLE-defined and extension capabilities' { + $providers = @{ Hr = New-NamespaceTestProvider -Capabilities @('IdLE.Identity.Read', 'Contoso.IdLE.Hr.Manager.Read') } + + { New-NamespaceTestPlan -Providers $providers } | Should -Not -Throw + } + + It 'rejects unknown IdLE.* capabilities (UnknownCapability)' { + $providers = @{ Hr = New-NamespaceTestProvider -Capabilities @('IdLE.Hr.Manager.Read') } + + { New-NamespaceTestPlan -Providers $providers } | Should -Throw "*UnknownCapability: Capability 'IdLE.Hr.Manager.Read'*" + } + + It 'rejects capabilities outside IdLE.* and Owner.IdLE.* (InvalidExtensionNamespace)' { + $providers = @{ Hr = New-NamespaceTestProvider -Capabilities @('Contoso.Hr.Read') } + + { New-NamespaceTestPlan -Providers $providers } | Should -Throw "*InvalidExtensionNamespace: Capability 'Contoso.Hr.Read'*'Contoso.IdLE.Hr.Manager.Read'*" + } + } + + Context 'Host extension points' { + It 'rejects IdLE.* step types in Providers.StepRegistry (ReservedNamespace)' { + $plan = New-NamespaceTestPlan -Providers @{} + + { Invoke-IdlePlan -Plan $plan -Providers @{ StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-HostEmit' } } } | + Should -Throw "*ReservedNamespace: Step type 'IdLE.Step.EmitEvent'*Providers.StepRegistry*" + } + + It 'rejects host step types that do not follow Owner.IdLE.Step.* (InvalidExtensionNamespace)' { + $providers = @{ + StepMetadata = @{ + 'Contoso.Step.Hr.Sync' = @{ WithSchema = @{ RequiredKeys = @(); OptionalKeys = @() } } + } + } + + { New-NamespaceTestPlan -Providers $providers } | Should -Throw "*InvalidExtensionNamespace: Step type 'Contoso.Step.Hr.Sync'*Providers.StepMetadata*" + } + } + + Context 'First-party detection' { + It 'treats the bundled step packs as first-party' { + InModuleScope 'IdLE.Core' { + foreach ($name in @('IdLE.Steps.Common', 'IdLE.Steps.DirectorySync')) { + $module = Get-Module -Name $name -All | Select-Object -First 1 + Test-IdleFirstPartyModule -Module $module | Should -BeTrue -Because $name + } + } + } + + It 'does not treat a same-named module from another folder as first-party' { + InModuleScope 'IdLE.Core' { + $impostor = New-Module -Name 'IdLE.Steps.Common' -ScriptBlock { } + Test-IdleFirstPartyModule -Module $impostor | Should -BeFalse + } + } + } + + Context 'Capability catalog' { + It 'documents exactly the IdLE-defined capabilities in docs/reference/capabilities.md' { + $docPath = Join-Path -Path (Get-RepoRootPath) -ChildPath 'docs/reference/capabilities.md' + $documented = @( + Select-String -Path $docPath -Pattern '^#### `(IdLE\.[A-Za-z.]+)`' | + ForEach-Object { $_.Matches[0].Groups[1].Value } | + Sort-Object + ) + + $defined = InModuleScope 'IdLE.Core' { @((Get-IdleReservedNamespaces).Capability.Defined | Sort-Object) } + + $documented | Should -Be $defined + } + } +} diff --git a/tests/Core/Invoke-IdlePlan.Condition.Tests.ps1 b/tests/Core/Invoke-IdlePlan.Condition.Tests.ps1 index 329ca9f2..2f22387b 100644 --- a/tests/Core/Invoke-IdlePlan.Condition.Tests.ps1 +++ b/tests/Core/Invoke-IdlePlan.Condition.Tests.ps1 @@ -3,33 +3,6 @@ Set-StrictMode -Version Latest BeforeDiscovery { . (Join-Path (Split-Path -Path $PSScriptRoot -Parent) '_testHelpers.ps1') Import-IdleTestModule - - function global:Invoke-IdleConditionTestEmitStep { - [CmdletBinding()] - param( - [Parameter(Mandatory)] - [ValidateNotNull()] - [object] $Context, - - [Parameter(Mandatory)] - [ValidateNotNull()] - [object] $Step - ) - - $Context.EventSink.WriteEvent('Custom', 'Hello', $Step.Name, @{ StepType = $Step.Type }) - - return [pscustomobject]@{ - PSTypeName = 'IdLE.StepResult' - Name = [string]$Step.Name - Type = [string]$Step.Type - Status = 'Completed' - Error = $null - } - } -} - -AfterAll { - Remove-Item -Path 'Function:\Invoke-IdleConditionTestEmitStep' -ErrorAction SilentlyContinue } InModuleScope 'IdLE.Core' { @@ -59,7 +32,7 @@ InModuleScope 'IdLE.Core' { $req = New-IdleRequest -LifecycleEvent 'Joiner' $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req - $providers = @{ StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleConditionTestEmitStep' } } + $providers = @{} $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -93,7 +66,7 @@ InModuleScope 'IdLE.Core' { $req = New-IdleRequest -LifecycleEvent 'Joiner' $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req - $providers = @{ StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleConditionTestEmitStep' } } + $providers = @{} $result = Invoke-IdlePlan -Plan $plan -Providers $providers diff --git a/tests/Core/Invoke-IdlePlan.ExecutionOptions.Tests.ps1 b/tests/Core/Invoke-IdlePlan.ExecutionOptions.Tests.ps1 index 6fc61d26..39ea82d4 100644 --- a/tests/Core/Invoke-IdlePlan.ExecutionOptions.Tests.ps1 +++ b/tests/Core/Invoke-IdlePlan.ExecutionOptions.Tests.ps1 @@ -211,7 +211,7 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { Name = 'Test Workflow' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Step1'; Type = 'Test.Step' } + @{ Name = 'Step1'; Type = 'Test.IdLE.Step.Basic' } ) } '@ @@ -219,8 +219,8 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $providers = @{ - StepRegistry = @{ 'Test.Step' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTestStep" } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.Step') + StepRegistry = @{ 'Test.IdLE.Step.Basic' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTestStep" } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Basic') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -238,7 +238,7 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { Name = 'Test Workflow' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Step1'; Type = 'Test.TransientStep'; RetryProfile = 'Custom' } + @{ Name = 'Step1'; Type = 'Test.IdLE.Step.Transient'; RetryProfile = 'Custom' } ) } '@ @@ -246,8 +246,8 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $providers = @{ - StepRegistry = @{ 'Test.TransientStep' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTransientStep" } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.TransientStep') + StepRegistry = @{ 'Test.IdLE.Step.Transient' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTransientStep" } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Transient') } $opts = @{ @@ -273,7 +273,7 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { Name = 'Test Workflow' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Step1'; Type = 'Test.TransientStep' } + @{ Name = 'Step1'; Type = 'Test.IdLE.Step.Transient' } ) } '@ @@ -281,8 +281,8 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $providers = @{ - StepRegistry = @{ 'Test.TransientStep' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTransientStep" } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.TransientStep') + StepRegistry = @{ 'Test.IdLE.Step.Transient' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTransientStep" } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Transient') } $opts = @{ @@ -303,7 +303,7 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { Name = 'Test Workflow' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Step1'; Type = 'Test.Step'; RetryProfile = 'Unknown' } + @{ Name = 'Step1'; Type = 'Test.IdLE.Step.Basic'; RetryProfile = 'Unknown' } ) } '@ @@ -311,8 +311,8 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $providers = @{ - StepRegistry = @{ 'Test.Step' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTestStep" } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.Step') + StepRegistry = @{ 'Test.IdLE.Step.Basic' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTestStep" } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Basic') } $opts = @{ RetryProfiles = @{ Default = @{ MaxAttempts = 3 } } } @@ -333,7 +333,7 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { Name = 'Test Workflow' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Step1'; Type = 'Test.TransientStep'; RetryProfile = 'NoRetry' } + @{ Name = 'Step1'; Type = 'Test.IdLE.Step.Transient'; RetryProfile = 'NoRetry' } ) } '@ @@ -341,8 +341,8 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $providers = @{ - StepRegistry = @{ 'Test.TransientStep' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTransientStep" } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.TransientStep') + StepRegistry = @{ 'Test.IdLE.Step.Transient' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTransientStep" } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Transient') } $opts = @{ RetryProfiles = @{ NoRetry = @{ MaxAttempts = 0 } } } @@ -386,10 +386,10 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { Name = 'Test Workflow' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'FailingStep'; Type = 'Test.Failing' } + @{ Name = 'FailingStep'; Type = 'Test.IdLE.Step.Failing' } ) OnFailureSteps = @( - @{ Name = 'CleanupStep'; Type = 'Test.TransientStep'; RetryProfile = 'Cleanup' } + @{ Name = 'CleanupStep'; Type = 'Test.IdLE.Step.Transient'; RetryProfile = 'Cleanup' } ) } '@ @@ -398,10 +398,10 @@ Describe 'Invoke-IdlePlan - ExecutionOptions' { $providers = @{ StepRegistry = @{ - 'Test.Failing' = "$failingModuleName\Invoke-IdleFailingStep" - 'Test.TransientStep' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTransientStep" + 'Test.IdLE.Step.Failing' = "$failingModuleName\Invoke-IdleFailingStep" + 'Test.IdLE.Step.Transient' = "$script:RetryProfileTestModuleName\Invoke-IdleRetryProfileTransientStep" } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.Failing', 'Test.TransientStep') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Failing', 'Test.IdLE.Step.Transient') } $opts = @{ diff --git a/tests/Core/Invoke-IdlePlan.Preconditions.Tests.ps1 b/tests/Core/Invoke-IdlePlan.Preconditions.Tests.ps1 index c739ef0d..fdb57d9d 100644 --- a/tests/Core/Invoke-IdlePlan.Preconditions.Tests.ps1 +++ b/tests/Core/Invoke-IdlePlan.Preconditions.Tests.ps1 @@ -85,10 +85,10 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'behaves exactly as before (no preconditions = no change)' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'no-preconditions.psd1' $req = New-IdleRequest -LifecycleEvent 'Joiner' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.NoPrecondition') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.NoPrecondition') } $providers = @{ - StepRegistry = @{ 'IdLE.Step.NoPrecondition' = 'Invoke-IdlePreconditionTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.NoPrecondition') + StepRegistry = @{ 'Test.IdLE.Step.NoPrecondition' = 'Invoke-IdlePreconditionTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.NoPrecondition') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -103,10 +103,10 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'executes the step when all preconditions pass' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'passing.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.PassingPrecondition') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.PassingPrecondition') } $providers = @{ - StepRegistry = @{ 'IdLE.Step.PassingPrecondition' = 'Invoke-IdlePreconditionTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.PassingPrecondition') + StepRegistry = @{ 'Test.IdLE.Step.PassingPrecondition' = 'Invoke-IdlePreconditionTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.PassingPrecondition') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -121,13 +121,13 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'produces Blocked step result and stops execution when precondition fails' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'blocked.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.BlockedPrecondition', 'IdLE.Step.SecondStep') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.BlockedPrecondition', 'Test.IdLE.Step.SecondStep') } $providers = @{ StepRegistry = @{ - 'IdLE.Step.BlockedPrecondition' = 'Invoke-IdlePreconditionTestNoopStep' - 'IdLE.Step.SecondStep' = 'Invoke-IdlePreconditionTestSecondStep' + 'Test.IdLE.Step.BlockedPrecondition' = 'Invoke-IdlePreconditionTestNoopStep' + 'Test.IdLE.Step.SecondStep' = 'Invoke-IdlePreconditionTestSecondStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.BlockedPrecondition', 'IdLE.Step.SecondStep') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.BlockedPrecondition', 'Test.IdLE.Step.SecondStep') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -144,10 +144,10 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'uses Blocked as the default when OnPreconditionFalse is omitted' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'blocked-default.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.BlockedDefault') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.BlockedDefault') } $providers = @{ - StepRegistry = @{ 'IdLE.Step.BlockedDefault' = 'Invoke-IdlePreconditionTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.BlockedDefault') + StepRegistry = @{ 'Test.IdLE.Step.BlockedDefault' = 'Invoke-IdlePreconditionTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.BlockedDefault') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -161,13 +161,13 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'produces Failed step result and stops execution when OnPreconditionFalse=Fail' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'fail.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.FailPrecondition', 'IdLE.Step.SecondStep') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.FailPrecondition', 'Test.IdLE.Step.SecondStep') } $providers = @{ StepRegistry = @{ - 'IdLE.Step.FailPrecondition' = 'Invoke-IdlePreconditionTestNoopStep' - 'IdLE.Step.SecondStep' = 'Invoke-IdlePreconditionTestSecondStep' + 'Test.IdLE.Step.FailPrecondition' = 'Invoke-IdlePreconditionTestNoopStep' + 'Test.IdLE.Step.SecondStep' = 'Invoke-IdlePreconditionTestSecondStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.FailPrecondition', 'IdLE.Step.SecondStep') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.FailPrecondition', 'Test.IdLE.Step.SecondStep') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -186,13 +186,13 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'emits events, marks step as PreconditionSkipped, and continues execution of subsequent steps' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'continue.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ContinuePrecondition', 'IdLE.Step.SecondStep') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ContinuePrecondition', 'Test.IdLE.Step.SecondStep') } $providers = @{ StepRegistry = @{ - 'IdLE.Step.ContinuePrecondition' = 'Invoke-IdlePreconditionTestNoopStep' - 'IdLE.Step.SecondStep' = 'Invoke-IdlePreconditionTestSecondStep' + 'Test.IdLE.Step.ContinuePrecondition' = 'Invoke-IdlePreconditionTestNoopStep' + 'Test.IdLE.Step.SecondStep' = 'Invoke-IdlePreconditionTestSecondStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ContinuePrecondition', 'IdLE.Step.SecondStep') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ContinuePrecondition', 'Test.IdLE.Step.SecondStep') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -214,10 +214,10 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'emits PreconditionEvent when Continue mode is used' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'continue-event.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ContinuePreconditionEvent') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ContinuePreconditionEvent') } $providers = @{ - StepRegistry = @{ 'IdLE.Step.ContinuePreconditionEvent' = 'Invoke-IdlePreconditionTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ContinuePreconditionEvent') + StepRegistry = @{ 'Test.IdLE.Step.ContinuePreconditionEvent' = 'Invoke-IdlePreconditionTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ContinuePreconditionEvent') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -232,13 +232,13 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'does not run OnFailureSteps when a step is Blocked' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'blocked-no-onfailure.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.BlockedNoOnFailure', 'IdLE.Step.OnFailureCleanup') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.BlockedNoOnFailure', 'Test.IdLE.Step.OnFailureCleanup') } $providers = @{ StepRegistry = @{ - 'IdLE.Step.BlockedNoOnFailure' = 'Invoke-IdlePreconditionTestNoopStep' - 'IdLE.Step.OnFailureCleanup' = 'Invoke-IdlePreconditionTestOnFailureStep' + 'Test.IdLE.Step.BlockedNoOnFailure' = 'Invoke-IdlePreconditionTestNoopStep' + 'Test.IdLE.Step.OnFailureCleanup' = 'Invoke-IdlePreconditionTestOnFailureStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.BlockedNoOnFailure', 'IdLE.Step.OnFailureCleanup') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.BlockedNoOnFailure', 'Test.IdLE.Step.OnFailureCleanup') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -252,13 +252,13 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'does run OnFailureSteps when OnPreconditionFalse=Fail' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'fail-runs-onfailure.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.FailRunsOnFailure', 'IdLE.Step.OnFailureCleanup') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.FailRunsOnFailure', 'Test.IdLE.Step.OnFailureCleanup') } $providers = @{ StepRegistry = @{ - 'IdLE.Step.FailRunsOnFailure' = 'Invoke-IdlePreconditionTestNoopStep' - 'IdLE.Step.OnFailureCleanup' = 'Invoke-IdlePreconditionTestOnFailureStep' + 'Test.IdLE.Step.FailRunsOnFailure' = 'Invoke-IdlePreconditionTestNoopStep' + 'Test.IdLE.Step.OnFailureCleanup' = 'Invoke-IdlePreconditionTestOnFailureStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.FailRunsOnFailure', 'IdLE.Step.OnFailureCleanup') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.FailRunsOnFailure', 'Test.IdLE.Step.OnFailureCleanup') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -273,10 +273,10 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'emits configured PreconditionEvent when precondition fails' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'event.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.PreconditionEvent') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.PreconditionEvent') } $providers = @{ - StepRegistry = @{ 'IdLE.Step.PreconditionEvent' = 'Invoke-IdlePreconditionTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.PreconditionEvent') + StepRegistry = @{ 'Test.IdLE.Step.PreconditionEvent' = 'Invoke-IdlePreconditionTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.PreconditionEvent') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -299,7 +299,7 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'throws when a precondition node has an invalid schema' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'invalid-schema.psd1' $req = New-IdleRequest -LifecycleEvent 'Joiner' - $providers = @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.InvalidPreconditionSchema') } + $providers = @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.InvalidPreconditionSchema') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | Should -Throw } @@ -307,7 +307,7 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'throws when OnPreconditionFalse has an invalid value' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'invalid-onpreconditionfalse.psd1' $req = New-IdleRequest -LifecycleEvent 'Joiner' - $providers = @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.InvalidOPF') } + $providers = @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.InvalidOPF') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | Should -Throw } @@ -315,7 +315,7 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'throws when PreconditionEvent is missing required Type' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'invalid-event-type.psd1' $req = New-IdleRequest -LifecycleEvent 'Joiner' - $providers = @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.InvalidPCEvt') } + $providers = @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.InvalidPCEvt') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | Should -Throw } @@ -323,7 +323,7 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'accepts Precondition as a single condition object' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'invalid-single-hashtable.psd1' $req = New-IdleRequest -LifecycleEvent 'Joiner' - $providers = @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.InvalidPCSingleHt') } + $providers = @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.InvalidPCSingleHt') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | Should -Not -Throw } @@ -333,13 +333,13 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'evaluates preconditions on OnFailureSteps: Blocked skips the step but continues remaining OnFailure steps' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'onfailure-blocked-precondition.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.FailRunsOnFailure', 'IdLE.Step.OnFailureCleanup') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.FailRunsOnFailure', 'Test.IdLE.Step.OnFailureCleanup') } $providers = @{ StepRegistry = @{ - 'IdLE.Step.FailRunsOnFailure' = 'Invoke-IdlePreconditionTestNoopStep' - 'IdLE.Step.OnFailureCleanup' = 'Invoke-IdlePreconditionTestOnFailureStep' + 'Test.IdLE.Step.FailRunsOnFailure' = 'Invoke-IdlePreconditionTestNoopStep' + 'Test.IdLE.Step.OnFailureCleanup' = 'Invoke-IdlePreconditionTestOnFailureStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.FailRunsOnFailure', 'IdLE.Step.OnFailureCleanup') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.FailRunsOnFailure', 'Test.IdLE.Step.OnFailureCleanup') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -355,13 +355,13 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { It 'evaluates preconditions on OnFailureSteps: Continue skips the step but continues remaining OnFailure steps' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'onfailure-continue-precondition.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.FailRunsOnFailure', 'IdLE.Step.OnFailureCleanup') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers @{ StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.FailRunsOnFailure', 'Test.IdLE.Step.OnFailureCleanup') } $providers = @{ StepRegistry = @{ - 'IdLE.Step.FailRunsOnFailure' = 'Invoke-IdlePreconditionTestNoopStep' - 'IdLE.Step.OnFailureCleanup' = 'Invoke-IdlePreconditionTestOnFailureStep' + 'Test.IdLE.Step.FailRunsOnFailure' = 'Invoke-IdlePreconditionTestNoopStep' + 'Test.IdLE.Step.OnFailureCleanup' = 'Invoke-IdlePreconditionTestOnFailureStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.FailRunsOnFailure', 'IdLE.Step.OnFailureCleanup') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.FailRunsOnFailure', 'Test.IdLE.Step.OnFailureCleanup') } $result = Invoke-IdlePlan -Plan $plan -Providers $providers @@ -380,8 +380,8 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'missing-context-at-invoke.psd1' $req = New-IdleRequest -LifecycleEvent 'Leaver' $providers = @{ - StepRegistry = @{ 'IdLE.Step.MissingContextAtInvoke' = 'Invoke-IdlePreconditionTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.MissingContextAtInvoke') + StepRegistry = @{ 'Test.IdLE.Step.MissingContextAtInvoke' = 'Invoke-IdlePreconditionTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.MissingContextAtInvoke') } # Planning succeeds with a soft warning for the missing Request.Context path. @@ -411,8 +411,8 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.CurrentCleanupTest' = 'Invoke-IdlePreconditionTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.CurrentCleanupTest') + StepRegistry = @{ 'Test.IdLE.Step.CurrentCleanupTest' = 'Invoke-IdlePreconditionTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.CurrentCleanupTest') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -440,8 +440,8 @@ Describe 'Invoke-IdlePlan - Runtime Preconditions' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.CurrentCleanupTest' = 'Invoke-IdlePreconditionTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.CurrentCleanupTest') + StepRegistry = @{ 'Test.IdLE.Step.CurrentCleanupTest' = 'Invoke-IdlePreconditionTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.CurrentCleanupTest') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers diff --git a/tests/Core/Invoke-IdlePlan.ProviderFallback.Tests.ps1 b/tests/Core/Invoke-IdlePlan.ProviderFallback.Tests.ps1 index 9759af47..3ee8bf76 100644 --- a/tests/Core/Invoke-IdlePlan.ProviderFallback.Tests.ps1 +++ b/tests/Core/Invoke-IdlePlan.ProviderFallback.Tests.ps1 @@ -41,7 +41,7 @@ Describe 'Invoke-IdlePlan Provider Fallback' { Name = 'Joiner - Standard' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'TestStep'; Type = 'IdLE.Step.Test' } + @{ Name = 'TestStep'; Type = 'Test.IdLE.Step.Test' } ) } '@ @@ -50,9 +50,9 @@ Describe 'Invoke-IdlePlan Provider Fallback' { $script:BaseProviders = @{ StepRegistry = @{ - 'IdLE.Step.Test' = 'Invoke-IdleTestProviderFallbackStep' + 'Test.IdLE.Step.Test' = 'Invoke-IdleTestProviderFallbackStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } } diff --git a/tests/Core/Invoke-IdlePlan.Retry.Tests.ps1 b/tests/Core/Invoke-IdlePlan.Retry.Tests.ps1 index 85e954df..9b6eaafa 100644 --- a/tests/Core/Invoke-IdlePlan.Retry.Tests.ps1 +++ b/tests/Core/Invoke-IdlePlan.Retry.Tests.ps1 @@ -101,7 +101,7 @@ Describe 'Invoke-IdlePlan - safe retries for transient failures (fail-fast)' { Name = 'Retry Transient Demo' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'TransientStep'; Type = 'IdLE.Step.Transient' } + @{ Name = 'TransientStep'; Type = 'Test.IdLE.Step.Transient' } ) } '@ @@ -110,9 +110,9 @@ Describe 'Invoke-IdlePlan - safe retries for transient failures (fail-fast)' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.Transient' = "$script:RetryTestModuleName\Invoke-IdleRetryTestTransientStep" + 'Test.IdLE.Step.Transient' = "$script:RetryTestModuleName\Invoke-IdleRetryTestTransientStep" } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Transient') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Transient') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -142,7 +142,7 @@ Describe 'Invoke-IdlePlan - safe retries for transient failures (fail-fast)' { Name = 'Retry Non-Transient Demo' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'NonTransientStep'; Type = 'IdLE.Step.NonTransient' } + @{ Name = 'NonTransientStep'; Type = 'Test.IdLE.Step.NonTransient' } ) } '@ @@ -151,9 +151,9 @@ Describe 'Invoke-IdlePlan - safe retries for transient failures (fail-fast)' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.NonTransient' = "$script:RetryTestModuleName\Invoke-IdleRetryTestNonTransientStep" + 'Test.IdLE.Step.NonTransient' = "$script:RetryTestModuleName\Invoke-IdleRetryTestNonTransientStep" } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.NonTransient') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.NonTransient') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers diff --git a/tests/Core/Invoke-IdlePlan.Tests.ps1 b/tests/Core/Invoke-IdlePlan.Tests.ps1 index fa61aad0..18380566 100644 --- a/tests/Core/Invoke-IdlePlan.Tests.ps1 +++ b/tests/Core/Invoke-IdlePlan.Tests.ps1 @@ -159,8 +159,9 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.EmitEvent' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Emit' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Emit') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -200,7 +201,7 @@ Describe 'Invoke-IdlePlan' { Name = 'Joiner - Standard' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'ResolveIdentity'; Type = 'IdLE.Step.ResolveIdentity' } + @{ Name = 'ResolveIdentity'; Type = 'Test.IdLE.Step.ResolveIdentity' } ) } '@ @@ -209,9 +210,9 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.ResolveIdentity' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.ResolveIdentity' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ResolveIdentity') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ResolveIdentity') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -239,21 +240,22 @@ Describe 'Invoke-IdlePlan' { Name = 'Demo' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Emit'; Type = 'IdLE.Step.EmitEvent'; With = @{ Message = 'Hello' } } + @{ Name = 'Emit'; Type = 'Test.IdLE.Step.Emit'; With = @{ Message = 'Hello' } } ) } '@ $req = New-IdleTestRequest -LifecycleEvent 'Joiner' - $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req $providers = @{ StepRegistry = @{ - 'IdLE.Step.EmitEvent' = 'Invoke-IdleTestEmitStep' + 'Test.IdLE.Step.Emit' = 'Invoke-IdleTestEmitStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.EmitEvent') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Emit') } + $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers + $result = Invoke-IdlePlan -Plan $plan -Providers $providers $result.Status | Should -Be 'Completed' @@ -269,11 +271,11 @@ Describe 'Invoke-IdlePlan' { Name = 'Demo - OnFailure' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'FailPrimary'; Type = 'IdLE.Step.FailPrimary' } - @{ Name = 'NeverRuns'; Type = 'IdLE.Step.NeverRuns' } + @{ Name = 'FailPrimary'; Type = 'Test.IdLE.Step.FailPrimary' } + @{ Name = 'NeverRuns'; Type = 'Test.IdLE.Step.NeverRuns' } ) OnFailureSteps = @( - @{ Name = 'OnFailure1'; Type = 'IdLE.Step.OnFailure1' } + @{ Name = 'OnFailure1'; Type = 'Test.IdLE.Step.OnFailure1' } ) } '@ @@ -282,11 +284,11 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.FailPrimary' = 'Invoke-IdleTestFailStep' - 'IdLE.Step.NeverRuns' = 'Invoke-IdleTestNoopStep' - 'IdLE.Step.OnFailure1' = 'Invoke-IdleTestEmitStep' + 'Test.IdLE.Step.FailPrimary' = 'Invoke-IdleTestFailStep' + 'Test.IdLE.Step.NeverRuns' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.OnFailure1' = 'Invoke-IdleTestEmitStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.FailPrimary', 'IdLE.Step.NeverRuns', 'IdLE.Step.OnFailure1') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.FailPrimary', 'Test.IdLE.Step.NeverRuns', 'Test.IdLE.Step.OnFailure1') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -318,11 +320,11 @@ Describe 'Invoke-IdlePlan' { Name = 'Demo - OnFailure Partial' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'FailPrimary'; Type = 'IdLE.Step.FailPrimary' } + @{ Name = 'FailPrimary'; Type = 'Test.IdLE.Step.FailPrimary' } ) OnFailureSteps = @( - @{ Name = 'OnFailureFail'; Type = 'IdLE.Step.OnFailureFail' } - @{ Name = 'OnFailureOk'; Type = 'IdLE.Step.OnFailureOk' } + @{ Name = 'OnFailureFail'; Type = 'Test.IdLE.Step.OnFailureFail' } + @{ Name = 'OnFailureOk'; Type = 'Test.IdLE.Step.OnFailureOk' } ) } '@ @@ -331,11 +333,11 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.FailPrimary' = 'Invoke-IdleTestFailStep' - 'IdLE.Step.OnFailureFail' = 'Invoke-IdleTestFailStep' - 'IdLE.Step.OnFailureOk' = 'Invoke-IdleTestEmitStep' + 'Test.IdLE.Step.FailPrimary' = 'Invoke-IdleTestFailStep' + 'Test.IdLE.Step.OnFailureFail' = 'Invoke-IdleTestFailStep' + 'Test.IdLE.Step.OnFailureOk' = 'Invoke-IdleTestEmitStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.FailPrimary', 'IdLE.Step.OnFailureFail', 'IdLE.Step.OnFailureOk') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.FailPrimary', 'Test.IdLE.Step.OnFailureFail', 'Test.IdLE.Step.OnFailureOk') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -359,10 +361,10 @@ Describe 'Invoke-IdlePlan' { Name = 'Demo - OnFailure NotRun' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Ok'; Type = 'IdLE.Step.Ok' } + @{ Name = 'Ok'; Type = 'Test.IdLE.Step.Ok' } ) OnFailureSteps = @( - @{ Name = 'OnFailure1'; Type = 'IdLE.Step.OnFailure1' } + @{ Name = 'OnFailure1'; Type = 'Test.IdLE.Step.OnFailure1' } ) } '@ @@ -371,10 +373,10 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.Ok' = 'Invoke-IdleTestNoopStep' - 'IdLE.Step.OnFailure1' = 'Invoke-IdleTestEmitStep' + 'Test.IdLE.Step.Ok' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.OnFailure1' = 'Invoke-IdleTestEmitStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Ok', 'IdLE.Step.OnFailure1') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Ok', 'Test.IdLE.Step.OnFailure1') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -434,7 +436,7 @@ Describe 'Invoke-IdlePlan' { Name = 'Joiner - Standard' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'ResolveIdentity'; Type = 'IdLE.Step.ResolveIdentity' } + @{ Name = 'ResolveIdentity'; Type = 'Test.IdLE.Step.ResolveIdentity' } ) } '@ @@ -443,9 +445,9 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.ResolveIdentity' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.ResolveIdentity' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ResolveIdentity') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ResolveIdentity') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -460,7 +462,7 @@ Describe 'Invoke-IdlePlan' { Name = 'Joiner - Standard' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'ResolveIdentity'; Type = 'IdLE.Step.ResolveIdentity' } + @{ Name = 'ResolveIdentity'; Type = 'Test.IdLE.Step.ResolveIdentity' } ) } '@ @@ -469,9 +471,9 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.ResolveIdentity' = { param($Context, $Step) } + 'Test.IdLE.Step.ResolveIdentity' = { param($Context, $Step) } } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ResolveIdentity') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ResolveIdentity') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -515,65 +517,6 @@ Describe 'Invoke-IdlePlan' { } Context 'Auth session acquisition' { - It 'throws when AuthSessionBroker is missing (AuthSession acquisition)' { - $plan = [pscustomobject]@{ - PSTypeName = 'IdLE.Plan' - CorrelationId = 'test-corr' - Steps = @( - @{ - Name = 'Acquire' - Type = 'IdLE.Step.AcquireAuthSession' - With = @{ - Name = 'Demo' - Options = @{} - } - } - ) - } - - $providers = @{ - StepRegistry = @{ - 'IdLE.Step.AcquireAuthSession' = 'Invoke-IdleTestAcquireAuthSessionStep' - } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.AcquireAuthSession') - } - - { Invoke-IdlePlan -Plan $plan -Providers $providers } | Should -Throw '*AuthSessionBroker*' - } - - It 'does not require AuthSessionBroker when AcquireAuthSession steps are NotApplicable' { - $plan = [pscustomobject]@{ - PSTypeName = 'IdLE.Plan' - CorrelationId = 'test-corr' - Steps = @( - @{ - Name = 'ConditionalAcquire' - Type = 'IdLE.Step.AcquireAuthSession' - Status = 'NotApplicable' - With = @{ - Name = 'Demo' - Options = @{} - } - } - @{ - Name = 'SomeOtherStep' - Type = 'IdLE.Step.Noop' - With = @{} - } - ) - } - - $providers = @{ - StepRegistry = @{ - 'IdLE.Step.AcquireAuthSession' = 'Invoke-IdleTestAcquireAuthSessionStep' - 'IdLE.Step.Noop' = 'Invoke-IdleTestNoopStep' - } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.AcquireAuthSession', 'IdLE.Step.Noop') - } - - { Invoke-IdlePlan -Plan $plan -Providers $providers } | Should -Not -Throw - } - It 'normalizes null options and enriches CorrelationId when acquiring an auth session' { $plan = [pscustomobject]@{ PSTypeName = 'IdLE.Plan' @@ -582,7 +525,7 @@ Describe 'Invoke-IdlePlan' { Steps = @( @{ Name = 'Acquire' - Type = 'IdLE.Step.AcquireAuthSession' + Type = 'Test.IdLE.Step.AcquireAuthSession' With = @{ Name = 'Demo' Options = $null @@ -613,9 +556,9 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.AcquireAuthSession' = 'Invoke-IdleTestAcquireAuthSessionStep' + 'Test.IdLE.Step.AcquireAuthSession' = 'Invoke-IdleTestAcquireAuthSessionStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.AcquireAuthSession') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.AcquireAuthSession') AuthSessionBroker = $broker } @@ -639,7 +582,7 @@ Describe 'Invoke-IdlePlan' { Steps = @( @{ Name = 'Acquire' - Type = 'IdLE.Step.AcquireAuthSession' + Type = 'Test.IdLE.Step.AcquireAuthSession' With = @{ Name = 'Demo' Options = @{ @@ -664,13 +607,14 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.AcquireAuthSession' = 'Invoke-IdleTestAcquireAuthSessionStep' + 'Test.IdLE.Step.AcquireAuthSession' = 'Invoke-IdleTestAcquireAuthSessionStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.AcquireAuthSession') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.AcquireAuthSession') AuthSessionBroker = $broker } - { Invoke-IdlePlan -Plan $plan -Providers $providers } | Should -Throw '*auth session options*' + # Rejected by the generic data-only boundary on the plan before any step runs. + { Invoke-IdlePlan -Plan $plan -Providers $providers } | Should -Throw '*ScriptBlocks are not allowed*With.Options.Nested.Bad*' } It 'calls the AuthSessionBroker and returns a completed step result (AuthSession acquisition)' { @@ -680,7 +624,7 @@ Describe 'Invoke-IdlePlan' { Steps = @( @{ Name = 'Acquire' - Type = 'IdLE.Step.AcquireAuthSession' + Type = 'Test.IdLE.Step.AcquireAuthSession' With = @{ Name = 'Demo' Options = @{ @@ -714,9 +658,9 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.AcquireAuthSession' = 'Invoke-IdleTestAcquireAuthSessionStep' + 'Test.IdLE.Step.AcquireAuthSession' = 'Invoke-IdleTestAcquireAuthSessionStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.AcquireAuthSession') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.AcquireAuthSession') AuthSessionBroker = $broker } @@ -737,7 +681,7 @@ Describe 'Invoke-IdlePlan' { Name = 'Legacy' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'LegacyStep'; Type = 'IdLE.Step.Legacy' } + @{ Name = 'LegacyStep'; Type = 'Test.IdLE.Step.Legacy' } ) } '@ @@ -746,9 +690,9 @@ Describe 'Invoke-IdlePlan' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.Legacy' = 'Invoke-IdleTestLegacyStep' + 'Test.IdLE.Step.Legacy' = 'Invoke-IdleTestLegacyStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Legacy') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Legacy') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers diff --git a/tests/Core/New-IdlePlan.Capabilities.Tests.ps1 b/tests/Core/New-IdlePlan.Capabilities.Tests.ps1 index 02e944ee..50183bc1 100644 --- a/tests/Core/New-IdlePlan.Capabilities.Tests.ps1 +++ b/tests/Core/New-IdlePlan.Capabilities.Tests.ps1 @@ -15,7 +15,7 @@ Describe 'New-IdlePlan - required provider capabilities' { $providers = @{ StepRegistry = @{ - 'Custom.Step.Unknown' = 'Invoke-CustomStepUnknown' + 'Custom.IdLE.Step.Unknown' = 'Invoke-CustomStepUnknown' } } @@ -25,7 +25,7 @@ Describe 'New-IdlePlan - required provider capabilities' { } catch { $_.Exception.Message | Should -Match 'MissingStepTypeMetadata' - $_.Exception.Message | Should -Match 'Custom.Step.Unknown' + $_.Exception.Message | Should -Match 'Custom.IdLE.Step.Unknown' } } } @@ -123,21 +123,21 @@ Describe 'New-IdlePlan - required provider capabilities' { } Context 'Metadata validation' { - It 'rejects host override attempt of step pack metadata (DuplicateStepTypeMetadata)' { + It 'rejects host metadata for a first-party step type (ReservedNamespace)' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'joiner-override.psd1' $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $provider = [pscustomobject]@{ Name = 'IdentityProvider' } $provider | Add-Member -MemberType ScriptMethod -Name GetCapabilities -Value { - return @('Custom.Capability.Override') + return @('Custom.IdLE.Capability.Override') } -Force $providers = @{ IdentityProvider = $provider StepMetadata = @{ 'IdLE.Step.DisableIdentity' = @{ - RequiredCapabilities = @('Custom.Capability.Override') + RequiredCapabilities = @('Custom.IdLE.Capability.Override') } } } @@ -147,7 +147,7 @@ Describe 'New-IdlePlan - required provider capabilities' { throw 'Expected an exception but none was thrown.' } catch { - $_.Exception.Message | Should -Match 'DuplicateStepTypeMetadata' + $_.Exception.Message | Should -Match 'ReservedNamespace' $_.Exception.Message | Should -Match 'IdLE.Step.DisableIdentity' } } @@ -159,10 +159,10 @@ Describe 'New-IdlePlan - required provider capabilities' { $providers = @{ StepRegistry = @{ - 'Custom.Step.Test' = 'Invoke-CustomStep' + 'Custom.IdLE.Step.Test' = 'Invoke-CustomStep' } StepMetadata = @{ - 'Custom.Step.Test' = @{ + 'Custom.IdLE.Step.Test' = @{ RequiredCapabilities = { 'Dynamic.Capability' } } } @@ -184,10 +184,10 @@ Describe 'New-IdlePlan - required provider capabilities' { $providers = @{ StepRegistry = @{ - 'Custom.Step.Test' = 'Invoke-CustomStep' + 'Custom.IdLE.Step.Test' = 'Invoke-CustomStep' } StepMetadata = @{ - 'Custom.Step.Test' = 'not-a-hashtable' + 'Custom.IdLE.Step.Test' = 'not-a-hashtable' } } @@ -207,10 +207,10 @@ Describe 'New-IdlePlan - required provider capabilities' { $providers = @{ StepRegistry = @{ - 'Custom.Step.Test' = 'Invoke-CustomStep' + 'Custom.IdLE.Step.Test' = 'Invoke-CustomStep' } StepMetadata = @{ - 'Custom.Step.Test' = @{ + 'Custom.IdLE.Step.Test' = @{ RequiredCapabilities = @('Invalid Capability With Spaces') } } diff --git a/tests/Core/New-IdlePlan.ContextResolvers.Tests.ps1 b/tests/Core/New-IdlePlan.ContextResolvers.Tests.ps1 index f7568be7..14848835 100644 --- a/tests/Core/New-IdlePlan.ContextResolvers.Tests.ps1 +++ b/tests/Core/New-IdlePlan.ContextResolvers.Tests.ps1 @@ -5,31 +5,6 @@ BeforeAll { Import-IdleTestModule $script:FixturesPath = Join-Path $PSScriptRoot '..' 'fixtures/workflows' - - function global:Invoke-IdleContextResolverTestNoopStep { - [CmdletBinding()] - param( - [Parameter(Mandatory)] - [ValidateNotNull()] - [object] $Context, - - [Parameter(Mandatory)] - [ValidateNotNull()] - [object] $Step - ) - - return [pscustomobject]@{ - PSTypeName = 'IdLE.StepResult' - Name = [string]$Step.Name - Type = [string]$Step.Type - Status = 'Completed' - Error = $null - } - } -} - -AfterAll { - Remove-Item -Path 'Function:\Invoke-IdleContextResolverTestNoopStep' -ErrorAction SilentlyContinue } Describe 'New-IdlePlan - ContextResolvers' { @@ -53,7 +28,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -90,7 +64,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -118,7 +91,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -172,7 +144,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -214,7 +185,6 @@ Describe 'New-IdlePlan - ContextResolvers' { # Provider is registered without an explicit alias in the resolver $providers = @{ IdentityProvider = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -242,7 +212,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Dummy = $dummyProvider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -289,7 +258,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -322,7 +290,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider AuthSessionBroker = $broker - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -359,7 +326,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Provider1 = & $makeProvider Provider2 = & $makeProvider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -387,7 +353,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -417,7 +382,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } # Should not throw even though request has no Context property @@ -449,7 +413,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Entra = & $makeProvider -GroupId 'entra-grp' AD = & $makeProvider -GroupId 'ad-grp' - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -489,7 +452,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider AuthSessionBroker = $broker - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -527,7 +489,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Entra = & $makeProvider -GroupId 'entra-grp' AD = & $makeProvider -GroupId 'ad-grp' - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -562,7 +523,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Entra = & $makeProvider -GroupId 'entra-grp' AD = & $makeProvider -GroupId 'ad-grp' - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -595,7 +555,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider AuthSessionBroker = $broker - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -622,7 +581,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -656,7 +614,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider AuthSessionBroker = $broker - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -695,7 +652,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider AuthSessionBroker = $broker - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -729,7 +685,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -758,7 +713,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Entra = & $makeProvider -Dept 'Entra-IT' HR = & $makeProvider -Dept 'HR-IT' - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -789,7 +743,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Entra = & $makeProvider -Dept 'Entra-IT' HR = & $makeProvider -Dept 'HR-IT' - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -826,7 +779,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider AuthSessionBroker = $broker - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -863,7 +815,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider AuthSessionBroker = $broker - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -892,7 +843,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ 'Invalid.Alias' = $p - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -916,7 +866,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider AuthSessionBroker = $broker - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -938,7 +887,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } # Should fail immediately with a clear message (not silently continue with null context) @@ -964,7 +912,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -1001,7 +948,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Entra = $entraProvider AD = $adProvider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -1038,7 +984,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Entra = & $makeProvider -ProfileToReturn @{ IdentityKey = 'user1'; Source = 'Entra' } HR = & $makeProvider -ProfileToReturn $null # HR finds no profile - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -1078,7 +1023,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -1124,7 +1068,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -1153,7 +1096,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -1189,7 +1131,6 @@ Describe 'New-IdlePlan - ContextResolvers' { $providers = @{ Identity = $provider - StepRegistry = @{ 'IdLE.Step.EmitEvent' = 'Invoke-IdleContextResolverTestNoopStep' } } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers diff --git a/tests/Core/New-IdlePlan.Tests.ps1 b/tests/Core/New-IdlePlan.Tests.ps1 index 60391abb..fb74bcbd 100644 --- a/tests/Core/New-IdlePlan.Tests.ps1 +++ b/tests/Core/New-IdlePlan.Tests.ps1 @@ -47,10 +47,10 @@ Describe 'New-IdlePlan' { Dummy = $true Identity = $dummyProvider StepRegistry = @{ - 'IdLE.Step.ResolveIdentity' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.ResolveIdentity' = 'Invoke-IdleTestNoopStep' 'IdLE.Step.EnsureAttributes' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ResolveIdentity') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ResolveIdentity') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -64,7 +64,7 @@ Describe 'New-IdlePlan' { @($plan.Steps).Count | Should -Be 2 $plan.Steps[0].PSTypeNames | Should -Contain 'IdLE.PlanStep' $plan.Steps[0].Name | Should -Be 'ResolveIdentity' - $plan.Steps[0].Type | Should -Be 'IdLE.Step.ResolveIdentity' + $plan.Steps[0].Type | Should -Be 'Test.IdLE.Step.ResolveIdentity' @($plan.Actions).Count | Should -Be 0 @($plan.Warnings).Count | Should -Be 0 @@ -83,18 +83,18 @@ Describe 'New-IdlePlan' { Name = 'Joiner - OnFailureSteps' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'ResolveIdentity'; Type = 'IdLE.Step.ResolveIdentity' } + @{ Name = 'ResolveIdentity'; Type = 'Test.IdLE.Step.ResolveIdentity' } ) OnFailureSteps = @( @{ Name = 'Containment' - Type = 'IdLE.Step.Containment' + Type = 'Test.IdLE.Step.Containment' Condition = @{ Equals = @{ Path = 'Plan.LifecycleEvent'; Value = 'Joiner' } } With = @{ Mode = 'Quarantine' } } @{ Name = 'NeverApplicable' - Type = 'IdLE.Step.NeverApplicable' + Type = 'Test.IdLE.Step.NeverApplicable' Condition = @{ Equals = @{ Path = 'Plan.LifecycleEvent'; Value = 'Mover' } } } ) @@ -105,14 +105,14 @@ Describe 'New-IdlePlan' { $providers = @{ Dummy = $true StepRegistry = @{ - 'IdLE.Step.ResolveIdentity' = 'Invoke-IdleTestNoopStep' - 'IdLE.Step.Containment' = 'Invoke-IdleTestNoopStep' - 'IdLE.Step.NeverApplicable' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.ResolveIdentity' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Containment' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.NeverApplicable' = 'Invoke-IdleTestNoopStep' } StepMetadata = New-IdleTestStepMetadata -StepTypes @( - 'IdLE.Step.ResolveIdentity', - 'IdLE.Step.Containment', - 'IdLE.Step.NeverApplicable' + 'Test.IdLE.Step.ResolveIdentity', + 'Test.IdLE.Step.Containment', + 'Test.IdLE.Step.NeverApplicable' ) } @@ -124,13 +124,13 @@ Describe 'New-IdlePlan' { $plan.OnFailureSteps[0].PSTypeNames | Should -Contain 'IdLE.PlanStep' $plan.OnFailureSteps[0].Name | Should -Be 'Containment' - $plan.OnFailureSteps[0].Type | Should -Be 'IdLE.Step.Containment' + $plan.OnFailureSteps[0].Type | Should -Be 'Test.IdLE.Step.Containment' $plan.OnFailureSteps[0].Status | Should -Be 'Planned' $plan.OnFailureSteps[0].With.Mode | Should -Be 'Quarantine' $plan.OnFailureSteps[1].PSTypeNames | Should -Contain 'IdLE.PlanStep' $plan.OnFailureSteps[1].Name | Should -Be 'NeverApplicable' - $plan.OnFailureSteps[1].Type | Should -Be 'IdLE.Step.NeverApplicable' + $plan.OnFailureSteps[1].Type | Should -Be 'Test.IdLE.Step.NeverApplicable' $plan.OnFailureSteps[1].Status | Should -Be 'NotApplicable' } @@ -142,14 +142,14 @@ Describe 'New-IdlePlan' { Steps = @( @{ Name = 'SharedName' - Type = 'IdLE.Step.ResolveIdentity' + Type = 'Test.IdLE.Step.ResolveIdentity' Precondition = @{ Exists = 'Request.Context.MissingAtPlan' } } ) OnFailureSteps = @( @{ Name = 'SharedName' - Type = 'IdLE.Step.Containment' + Type = 'Test.IdLE.Step.Containment' With = @{ Mode = 'Quarantine' } } ) @@ -160,12 +160,12 @@ Describe 'New-IdlePlan' { $providers = @{ Dummy = $true StepRegistry = @{ - 'IdLE.Step.ResolveIdentity' = 'Invoke-IdleTestNoopStep' - 'IdLE.Step.Containment' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.ResolveIdentity' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Containment' = 'Invoke-IdleTestNoopStep' } StepMetadata = New-IdleTestStepMetadata -StepTypes @( - 'IdLE.Step.ResolveIdentity', - 'IdLE.Step.Containment' + 'Test.IdLE.Step.ResolveIdentity', + 'Test.IdLE.Step.Containment' ) } @@ -184,8 +184,8 @@ Describe 'New-IdlePlan' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $providers = @{ - StepRegistry = @{ 'IdLE.Step.ExistsConditionTest' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ExistsConditionTest') + StepRegistry = @{ 'Test.IdLE.Step.ExistsConditionTest' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ExistsConditionTest') } # Must not throw: Exists on absent path evaluates to false without a path-resolvability error @@ -201,8 +201,8 @@ Describe 'New-IdlePlan' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $providers = @{ - StepRegistry = @{ 'IdLE.Step.ConditionalSkipTest' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ConditionalSkipTest') + StepRegistry = @{ 'Test.IdLE.Step.ConditionalSkipTest' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ConditionalSkipTest') } # Must not throw despite template referencing absent Request.Intent.MissingKey @@ -218,9 +218,9 @@ Describe 'New-IdlePlan' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $providers = @{ - StepRegistry = @{ 'IdLE.Step.StrictSchemaTest' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.StrictSchemaTest') -WithSchemas @{ - 'IdLE.Step.StrictSchemaTest' = @{ RequiredKeys = @('IdentityKey'); OptionalKeys = @() } + StepRegistry = @{ 'Test.IdLE.Step.StrictSchemaTest' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.StrictSchemaTest') -WithSchemas @{ + 'Test.IdLE.Step.StrictSchemaTest' = @{ RequiredKeys = @('IdentityKey'); OptionalKeys = @() } } } @@ -237,9 +237,9 @@ Describe 'New-IdlePlan' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $providers = @{ - StepRegistry = @{ 'IdLE.Step.StrictApplicableTest' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.StrictApplicableTest') -WithSchemas @{ - 'IdLE.Step.StrictApplicableTest' = @{ RequiredKeys = @('IdentityKey'); OptionalKeys = @() } + StepRegistry = @{ 'Test.IdLE.Step.StrictApplicableTest' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.StrictApplicableTest') -WithSchemas @{ + 'Test.IdLE.Step.StrictApplicableTest' = @{ RequiredKeys = @('IdentityKey'); OptionalKeys = @() } } } @@ -254,12 +254,12 @@ Describe 'New-IdlePlan' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $providers = @{ StepRegistry = @{ - 'IdLE.Step.PrimarySkipTest' = 'Invoke-IdleTestNoopStep' - 'IdLE.Step.OnFailureSkipTest' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.PrimarySkipTest' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.OnFailureSkipTest' = 'Invoke-IdleTestNoopStep' } StepMetadata = New-IdleTestStepMetadata -StepTypes @( - 'IdLE.Step.PrimarySkipTest', - 'IdLE.Step.OnFailureSkipTest' + 'Test.IdLE.Step.PrimarySkipTest', + 'Test.IdLE.Step.OnFailureSkipTest' ) } @@ -279,7 +279,7 @@ Describe 'New-IdlePlan' { Name = 'Joiner - Standard' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'ResolveIdentity'; Type = 'IdLE.Step.ResolveIdentity' } + @{ Name = 'ResolveIdentity'; Type = 'Test.IdLE.Step.ResolveIdentity' } ) } '@ diff --git a/tests/Core/New-IdleRequest.Tests.ps1 b/tests/Core/New-IdleRequest.Tests.ps1 index ad42751c..fa80dd2c 100644 --- a/tests/Core/New-IdleRequest.Tests.ps1 +++ b/tests/Core/New-IdleRequest.Tests.ps1 @@ -137,8 +137,8 @@ Describe 'New-IdlePlan - Request.Identity rejection' { $wfPath = Join-Path $PSScriptRoot '..' 'fixtures/workflows/template-tests/template-simple.psd1' $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $badRequest -Providers $providers } | diff --git a/tests/Core/Resolve-IdleStepMetadataCatalog.Tests.ps1 b/tests/Core/Resolve-IdleStepMetadataCatalog.Tests.ps1 index d36c9593..77e8a0da 100644 --- a/tests/Core/Resolve-IdleStepMetadataCatalog.Tests.ps1 +++ b/tests/Core/Resolve-IdleStepMetadataCatalog.Tests.ps1 @@ -62,16 +62,16 @@ Describe 'Resolve-IdleStepMetadataCatalog - step pack catalog ownership' { $provider = [pscustomobject]@{ Name = 'CustomProvider' } $provider | Add-Member -MemberType ScriptMethod -Name GetCapabilities -Value { - return @('Custom.Capability.Test') + return @('Custom.IdLE.Capability.Test') } -Force $providers = @{ StepRegistry = @{ - 'Custom.Step.Unknown' = 'Invoke-CustomStepUnknown' + 'Custom.IdLE.Step.Unknown' = 'Invoke-CustomStepUnknown' } StepMetadata = @{ - 'Custom.Step.Unknown' = @{ - RequiredCapabilities = @('Custom.Capability.Test') + 'Custom.IdLE.Step.Unknown' = @{ + RequiredCapabilities = @('Custom.IdLE.Capability.Test') WithSchema = @{ RequiredKeys = @() OptionalKeys = @() @@ -83,23 +83,23 @@ Describe 'Resolve-IdleStepMetadataCatalog - step pack catalog ownership' { $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers - $plan.Steps[0].RequiresCapabilities | Should -Contain 'Custom.Capability.Test' + $plan.Steps[0].RequiresCapabilities | Should -Contain 'Custom.IdLE.Capability.Test' } - It 'rejects host override attempt of step pack metadata (DuplicateStepTypeMetadata)' { + It 'rejects host metadata for a first-party step type (ReservedNamespace)' { $wfPath = Join-Path -Path $script:FixturesPath -ChildPath 'joiner-builtin.psd1' $req = New-IdleTestRequest -LifecycleEvent 'Joiner' $provider = [pscustomobject]@{ Name = 'IdentityProvider' } $provider | Add-Member -MemberType ScriptMethod -Name GetCapabilities -Value { - return @('Custom.Capability.Override') + return @('Custom.IdLE.Capability.Override') } -Force $providers = @{ IdentityProvider = $provider StepMetadata = @{ 'IdLE.Step.DisableIdentity' = @{ - RequiredCapabilities = @('Custom.Capability.Override') + RequiredCapabilities = @('Custom.IdLE.Capability.Override') } } } @@ -109,10 +109,9 @@ Describe 'Resolve-IdleStepMetadataCatalog - step pack catalog ownership' { throw 'Expected an exception but none was thrown.' } catch { - $_.Exception.Message | Should -Match 'DuplicateStepTypeMetadata' + $_.Exception.Message | Should -Match 'ReservedNamespace' $_.Exception.Message | Should -Match 'IdLE.Step.DisableIdentity' - $_.Exception.Message | Should -Match 'IdLE.Steps.Common' - $_.Exception.Message | Should -Match 'supplement' + $_.Exception.Message | Should -Match 'Providers.StepMetadata' } } @@ -122,10 +121,10 @@ Describe 'Resolve-IdleStepMetadataCatalog - step pack catalog ownership' { $providers = @{ StepRegistry = @{ - 'Custom.Step.Unknown' = 'Invoke-CustomStepUnknown' + 'Custom.IdLE.Step.Unknown' = 'Invoke-CustomStepUnknown' } StepMetadata = @{ - 'Custom.Step.Unknown' = @{ + 'Custom.IdLE.Step.Unknown' = @{ RequiredCapabilities = { 'Dynamic.Cap' } } } @@ -146,10 +145,10 @@ Describe 'Resolve-IdleStepMetadataCatalog - step pack catalog ownership' { $providers = @{ StepRegistry = @{ - 'Custom.Step.NoSchema' = 'Invoke-CustomStep' + 'Custom.IdLE.Step.NoSchema' = 'Invoke-CustomStep' } StepMetadata = @{ - 'Custom.Step.NoSchema' = @{ + 'Custom.IdLE.Step.NoSchema' = @{ RequiredCapabilities = @() } } @@ -161,7 +160,7 @@ Describe 'Resolve-IdleStepMetadataCatalog - step pack catalog ownership' { } catch { $_.Exception.Message | Should -Match 'WithSchema' - $_.Exception.Message | Should -Match 'Custom.Step.NoSchema' + $_.Exception.Message | Should -Match 'Custom.IdLE.Step.NoSchema' } } @@ -171,10 +170,10 @@ Describe 'Resolve-IdleStepMetadataCatalog - step pack catalog ownership' { $providers = @{ StepRegistry = @{ - 'Custom.Step.BadSchema' = 'Invoke-CustomStep' + 'Custom.IdLE.Step.BadSchema' = 'Invoke-CustomStep' } StepMetadata = @{ - 'Custom.Step.BadSchema' = @{ + 'Custom.IdLE.Step.BadSchema' = @{ RequiredCapabilities = @() WithSchema = @{ OptionalKeys = @('Message') @@ -189,7 +188,7 @@ Describe 'Resolve-IdleStepMetadataCatalog - step pack catalog ownership' { } catch { $_.Exception.Message | Should -Match 'RequiredKeys' - $_.Exception.Message | Should -Match 'Custom.Step.BadSchema' + $_.Exception.Message | Should -Match 'Custom.IdLE.Step.BadSchema' } } @@ -199,10 +198,10 @@ Describe 'Resolve-IdleStepMetadataCatalog - step pack catalog ownership' { $providers = @{ StepRegistry = @{ - 'Custom.Step.DupSchema' = 'Invoke-CustomStep' + 'Custom.IdLE.Step.DupSchema' = 'Invoke-CustomStep' } StepMetadata = @{ - 'Custom.Step.DupSchema' = @{ + 'Custom.IdLE.Step.DupSchema' = @{ RequiredCapabilities = @() WithSchema = @{ RequiredKeys = @('IdentityKey') @@ -310,7 +309,7 @@ Describe 'New-IdlePlan - step metadata catalog integration' { $providers = @{ StepRegistry = @{ - 'Custom.Step.Unknown' = 'Invoke-CustomStepUnknown' + 'Custom.IdLE.Step.Unknown' = 'Invoke-CustomStepUnknown' } } @@ -320,7 +319,7 @@ Describe 'New-IdlePlan - step metadata catalog integration' { } catch { $_.Exception.Message | Should -Match 'MissingStepTypeMetadata' - $_.Exception.Message | Should -Match 'Custom.Step.Unknown' + $_.Exception.Message | Should -Match 'Custom.IdLE.Step.Unknown' $_.Exception.Message | Should -Match 'Import/load the step pack' $_.Exception.Message | Should -Match 'Providers.StepMetadata' } diff --git a/tests/Core/Resolve-IdleWorkflowTemplates.Tests.ps1 b/tests/Core/Resolve-IdleWorkflowTemplates.Tests.ps1 index 160ba5a5..048bce0b 100644 --- a/tests/Core/Resolve-IdleWorkflowTemplates.Tests.ps1 +++ b/tests/Core/Resolve-IdleWorkflowTemplates.Tests.ps1 @@ -47,9 +47,9 @@ Describe 'Template Substitution' { } $providers = @{ StepRegistry = @{ - 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -65,9 +65,9 @@ Describe 'Template Substitution' { } $providers = @{ StepRegistry = @{ - 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -83,9 +83,9 @@ Describe 'Template Substitution' { } $providers = @{ StepRegistry = @{ - 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -104,9 +104,9 @@ Describe 'Template Substitution' { } $providers = @{ StepRegistry = @{ - 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -125,9 +125,9 @@ Describe 'Template Substitution' { } $providers = @{ StepRegistry = @{ - 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -146,9 +146,9 @@ Describe 'Template Substitution' { } $providers = @{ StepRegistry = @{ - 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -168,9 +168,9 @@ Describe 'Template Substitution' { } $providers = @{ StepRegistry = @{ - 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -188,9 +188,9 @@ Describe 'Template Substitution' { } $providers = @{ StepRegistry = @{ - 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -206,8 +206,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -219,8 +219,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -234,8 +234,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -Intent @{ UserName = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -247,8 +247,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -Intent @{ UserName = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -262,8 +262,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -275,8 +275,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -Context @{ Identity = @{ ObjectId = 'abc' } } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -290,8 +290,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -Intent @{ NullField = $null } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -305,8 +305,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -318,8 +318,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -331,8 +331,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -346,8 +346,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -360,8 +360,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'TestName' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -374,8 +374,8 @@ Describe 'Template Substitution' { $req = New-IdleTestRequest -LifecycleEvent 'Joiner' -IdentityKeys @{ sAMAccountName = 'jdoe' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -391,8 +391,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -410,9 +410,9 @@ Describe 'Template Substitution' { } $providers = @{ StepRegistry = @{ - 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' + 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -428,8 +428,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -442,8 +442,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -456,8 +456,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ Name = 'Test' } -Actor 'admin@example.com' $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -472,8 +472,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ UserId = 12345 } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -486,8 +486,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ IsEnabled = $true } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -502,8 +502,8 @@ Describe 'Template Substitution' { UserData = @{ Name = 'John'; Age = 30 } } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -517,8 +517,8 @@ Describe 'Template Substitution' { Tags = @('tag1', 'tag2') } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } { New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers } | @@ -532,8 +532,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ Enabled = $false } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -549,8 +549,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ IsActive = $true } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -564,8 +564,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ UserId = 12345 } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -580,8 +580,8 @@ Describe 'Template Substitution' { $testDate = Get-Date '2026-01-15T10:00:00' $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ StartDate = $testDate } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -596,8 +596,8 @@ Describe 'Template Substitution' { $testGuid = [guid]::NewGuid() $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ ObjectId = $testGuid } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers @@ -611,8 +611,8 @@ Describe 'Template Substitution' { $req = New-IdleRequest -LifecycleEvent 'Joiner' -Intent @{ Enabled = $false } $providers = @{ - StepRegistry = @{ 'IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Test') + StepRegistry = @{ 'Test.IdLE.Step.Test' = 'Invoke-IdleTestNoopStep' } + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Test') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers diff --git a/tests/Core/StepPackHandlerRegistration.Tests.ps1 b/tests/Core/StepPackHandlerRegistration.Tests.ps1 index 902e406d..1db78632 100644 --- a/tests/Core/StepPackHandlerRegistration.Tests.ps1 +++ b/tests/Core/StepPackHandlerRegistration.Tests.ps1 @@ -8,21 +8,30 @@ BeforeAll { $script:PackName = 'Contoso.IdLE.Steps.Hr' $script:StepType = 'Contoso.IdLE.Step.Hr.Hello' - # Creates a step pack module on disk that is discovered via the manifest marker only - # (its name does not match 'IdLE.Steps.*' and it exports no Get-IdleStepMetadataCatalog). + # Creates a step pack module on disk. With -NoMarker the module has no PrivateData.IdLE marker and instead + # exports Get-IdleStepMetadataCatalog (the removed name-based discovery shape). function New-TestStepPack { param( [Parameter(Mandatory)] [string] $CatalogContent, [Parameter()] - [string] $StepCatalog = 'StepMetadataCatalog.psd1' + [string] $StepCatalog = 'StepMetadataCatalog.psd1', + + [Parameter()] + [string] $PackName = $script:PackName, + + [Parameter()] + [switch] $NoMarker ) - $moduleDir = Join-Path -Path $TestDrive -ChildPath ([guid]::NewGuid().ToString('N')) | Join-Path -ChildPath $script:PackName + $marker = if ($NoMarker) { '' } else { "IdLE = @{ Kind = 'StepPack'; StepCatalog = '$StepCatalog' }" } + $exports = if ($NoMarker) { "'Invoke-ContosoStepHello', 'Get-IdleStepMetadataCatalog'" } else { "'Invoke-ContosoStepHello'" } + + $moduleDir = Join-Path -Path $TestDrive -ChildPath ([guid]::NewGuid().ToString('N')) | Join-Path -ChildPath $PackName $null = New-Item -Path $moduleDir -ItemType Directory -Force - Set-Content -Path (Join-Path $moduleDir "$($script:PackName).psm1") -Encoding UTF8 -Value @' + Set-Content -Path (Join-Path $moduleDir "$($PackName).psm1") -Encoding UTF8 -Value @' function Invoke-ContosoStepHello { [CmdletBinding()] param( @@ -41,38 +50,40 @@ function Invoke-ContosoStepHello { } } -Export-ModuleMember -Function 'Invoke-ContosoStepHello' +function Get-IdleStepMetadataCatalog { + return Import-PowerShellDataFile -Path (Join-Path $PSScriptRoot 'StepMetadataCatalog.psd1') +} + +Export-ModuleMember -Function 'Invoke-ContosoStepHello', 'Get-IdleStepMetadataCatalog' '@ - Set-Content -Path (Join-Path $moduleDir "$($script:PackName).psd1") -Encoding UTF8 -Value @" + Set-Content -Path (Join-Path $moduleDir "$PackName.psd1") -Encoding UTF8 -Value @" @{ - RootModule = '$($script:PackName).psm1' + RootModule = '$PackName.psm1' ModuleVersion = '1.0.0' GUID = '$([guid]::NewGuid())' - FunctionsToExport = @('Invoke-ContosoStepHello') - PrivateData = @{ - IdLE = @{ - Kind = 'StepPack' - StepCatalog = '$StepCatalog' - } - } + FunctionsToExport = @($exports) + PrivateData = @{ $marker } } "@ Set-Content -Path (Join-Path $moduleDir 'StepMetadataCatalog.psd1') -Encoding UTF8 -Value $CatalogContent - Import-Module -Name (Join-Path $moduleDir "$($script:PackName).psd1") -Force -ErrorAction Stop + Import-Module -Name (Join-Path $moduleDir "$PackName.psd1") -Force -ErrorAction Stop } function New-TestCatalogContent { param( [Parameter(Mandatory)] - [string] $HandlerLiteral + [string] $HandlerLiteral, + + [Parameter()] + [string] $StepType = $script:StepType ) return @" @{ - '$($script:StepType)' = @{ + '$StepType' = @{ Handler = $HandlerLiteral RequiredCapabilities = @() WithSchema = @{ @@ -101,7 +112,7 @@ Export-ModuleMember -Function 'Invoke-ContosoStepHello' Describe 'Step pack handler registration (StepMetadataCatalog Handler)' { AfterEach { - Remove-Module -Name $script:PackName -Force -ErrorAction SilentlyContinue + Remove-Module -Name $script:PackName, 'IdLE.Steps.Impostor', 'IdLE.Steps.Legacy' -Force -ErrorAction SilentlyContinue } Context 'Third-party step pack with manifest marker' { @@ -125,13 +136,13 @@ Describe 'Step pack handler registration (StepMetadataCatalog Handler)' { } } - It 'lets Providers.StepRegistry override the catalog handler' { + It 'rejects Providers.StepRegistry entries for step pack step types (DuplicateStepHandler)' { New-TestStepPack -CatalogContent (New-TestCatalogContent -HandlerLiteral "'Invoke-ContosoStepHello'") InModuleScope 'IdLE.Core' -Parameters @{ StepType = $script:StepType } { param($StepType) - $registry = Get-IdleStepRegistry -Providers @{ StepRegistry = @{ $StepType = 'Invoke-HostHello' } } - $registry[$StepType] | Should -Be 'Invoke-HostHello' + { Get-IdleStepRegistry -Providers @{ StepRegistry = @{ $StepType = 'Invoke-HostHello' } } } | + Should -Throw '*DuplicateStepHandler*' } } } @@ -186,6 +197,62 @@ Describe 'Step pack handler registration (StepMetadataCatalog Handler)' { } } + Context 'Identifier namespaces and discovery' { + It 'rejects IdLE.* step types from a third-party step pack (ReservedNamespace)' { + New-TestStepPack -CatalogContent (New-TestCatalogContent -HandlerLiteral "'Invoke-ContosoStepHello'" -StepType 'IdLE.Step.Hr.Hello') + + { New-TestPlan } | Should -Throw "*ReservedNamespace: Step type 'IdLE.Step.Hr.Hello'*'.IdLE.Step.Hr.Hello'*" + } + + It 'rejects step types that do not follow Owner.IdLE.Step.* (InvalidExtensionNamespace)' { + New-TestStepPack -CatalogContent (New-TestCatalogContent -HandlerLiteral "'Invoke-ContosoStepHello'" -StepType 'Contoso.Step.Hr.Hello') + + { New-TestPlan } | Should -Throw "*InvalidExtensionNamespace: Step type 'Contoso.Step.Hr.Hello'*" + } + + It 'does not treat a module as first-party because of its IdLE.* name' { + New-TestStepPack -PackName 'IdLE.Steps.Impostor' -CatalogContent (New-TestCatalogContent -HandlerLiteral "'Invoke-ContosoStepHello'" -StepType 'IdLE.Step.Impostor.Hello') + + { New-TestPlan } | Should -Throw "*ReservedNamespace*Defined by step pack 'IdLE.Steps.Impostor'*" + } + + It 'does not discover IdLE.Steps.* modules without the manifest marker' { + New-TestStepPack -PackName 'IdLE.Steps.Legacy' -NoMarker -CatalogContent (New-TestCatalogContent -HandlerLiteral "'Invoke-ContosoStepHello'") + + { New-TestPlan } | Should -Throw "*MissingStepTypeMetadata*" + } + + It 'rejects host metadata for a third-party step pack step type (DuplicateStepTypeMetadata)' { + New-TestStepPack -CatalogContent (New-TestCatalogContent -HandlerLiteral "'Invoke-ContosoStepHello'") + + InModuleScope 'IdLE.Core' -Parameters @{ StepType = $script:StepType } { + param($StepType) + $providers = @{ StepMetadata = @{ $StepType = @{ WithSchema = @{ RequiredKeys = @(); OptionalKeys = @() } } } } + { Resolve-IdleStepMetadataCatalog -Providers $providers } | Should -Throw "*DuplicateStepTypeMetadata*Contoso.IdLE.Steps.Hr*" + } + } + + It 'accepts extension capabilities and rejects unknown IdLE.* capabilities in step pack metadata' { + $catalog = @" +@{ + '$($script:StepType)' = @{ + Handler = 'Invoke-ContosoStepHello' + RequiredCapabilities = @('IdLE.Identity.Read', 'Contoso.IdLE.Hr.Manager.Read') + WithSchema = @{ RequiredKeys = @(); OptionalKeys = @() } + } + 'Contoso.IdLE.Step.Hr.Unknown' = @{ + Handler = 'Invoke-ContosoStepHello' + RequiredCapabilities = @('IdLE.Hr.Manager.Read') + WithSchema = @{ RequiredKeys = @(); OptionalKeys = @() } + } +} +"@ + New-TestStepPack -CatalogContent $catalog + + { New-TestPlan } | Should -Throw "*UnknownCapability: Capability 'IdLE.Hr.Manager.Read'*Contoso.IdLE.Step.Hr.Unknown*" + } + } + Context 'First-party step packs' { It 'declares a resolvable handler for every built-in step type' { InModuleScope 'IdLE.Core' { diff --git a/tests/Core/Test-IdleWorkflow.Tests.ps1 b/tests/Core/Test-IdleWorkflow.Tests.ps1 index 10a34ad5..8b8faeee 100644 --- a/tests/Core/Test-IdleWorkflow.Tests.ps1 +++ b/tests/Core/Test-IdleWorkflow.Tests.ps1 @@ -13,7 +13,7 @@ Describe 'Test-IdleWorkflow' { Name = 'Joiner - Standard' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'ResolveIdentity'; Type = 'IdLE.Step.ResolveIdentity' } + @{ Name = 'ResolveIdentity'; Type = 'Test.IdLE.Step.ResolveIdentity' } ) } '@ @@ -33,7 +33,7 @@ Describe 'Test-IdleWorkflow' { Name = 'Joiner - OnFailure' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'ResolveIdentity'; Type = 'IdLE.Step.ResolveIdentity' } + @{ Name = 'ResolveIdentity'; Type = 'Test.IdLE.Step.ResolveIdentity' } ) OnFailureSteps = @( @{ Name = 'Containment'; Type = 'IdLE.Step.DisableIdentity' } @@ -58,7 +58,7 @@ Describe 'Test-IdleWorkflow' { Name = 'Joiner - Invalid' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'ResolveIdentity'; Type = 'IdLE.Step.ResolveIdentity' } + @{ Name = 'ResolveIdentity'; Type = 'Test.IdLE.Step.ResolveIdentity' } ) CleanupSteps = @( @{ Name = 'Nope'; Type = 'IdLE.Step.DisableIdentity' } @@ -82,7 +82,7 @@ Describe 'Test-IdleWorkflow' { Name = 'Joiner - Standard' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'ResolveIdentity'; Type = 'IdLE.Step.ResolveIdentity' } + @{ Name = 'ResolveIdentity'; Type = 'Test.IdLE.Step.ResolveIdentity' } ) } '@ diff --git a/tests/Core/Test-IdleWorkflowSchema.Tests.ps1 b/tests/Core/Test-IdleWorkflowSchema.Tests.ps1 index 7cc7ea82..b3ee8b8f 100644 --- a/tests/Core/Test-IdleWorkflowSchema.Tests.ps1 +++ b/tests/Core/Test-IdleWorkflowSchema.Tests.ps1 @@ -14,7 +14,7 @@ Describe 'Workflow schema validation - Condition/Precondition DSL parity' { Steps = @( @{ Name = 'InvalidCondition' - Type = 'IdLE.Step.Noop' + Type = 'Test.IdLE.Step.Noop' Condition = @{ Foo = @{ Path = 'Plan.LifecycleEvent'; Value = 'Joiner' } } } ) @@ -29,12 +29,12 @@ Describe 'Workflow schema validation - Condition/Precondition DSL parity' { Name = 'Condition Validation' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Primary'; Type = 'IdLE.Step.Noop' } + @{ Name = 'Primary'; Type = 'Test.IdLE.Step.Noop' } ) OnFailureSteps = @( @{ Name = 'InvalidOnFailureCondition' - Type = 'IdLE.Step.Noop' + Type = 'Test.IdLE.Step.Noop' Condition = @{ Foo = @{ Path = 'Plan.LifecycleEvent'; Value = 'Joiner' } } } ) @@ -51,7 +51,7 @@ Describe 'Workflow schema validation - Condition/Precondition DSL parity' { Steps = @( @{ Name = 'InvalidPrecondition' - Type = 'IdLE.Step.Noop' + Type = 'Test.IdLE.Step.Noop' Precondition = @{ Foo = @{ Path = 'Plan.LifecycleEvent'; Value = 'Joiner' } } } ) @@ -68,7 +68,7 @@ Describe 'Workflow schema validation - Condition/Precondition DSL parity' { Steps = @( @{ Name = 'ValidPrecondition' - Type = 'IdLE.Step.Noop' + Type = 'Test.IdLE.Step.Noop' Condition = @{ Equals = @{ Path = 'Plan.LifecycleEvent'; Value = 'Joiner' } } Precondition = @{ All = @( @@ -100,7 +100,7 @@ Describe 'Workflow schema validation - ContextResolvers' { } ) Steps = @( - @{ Name = 'Step1'; Type = 'IdLE.Step.Noop' } + @{ Name = 'Step1'; Type = 'Test.IdLE.Step.Noop' } ) } @@ -119,7 +119,7 @@ Describe 'Workflow schema validation - ContextResolvers' { } ) Steps = @( - @{ Name = 'Step1'; Type = 'IdLE.Step.Noop' } + @{ Name = 'Step1'; Type = 'Test.IdLE.Step.Noop' } ) } @@ -138,7 +138,7 @@ Describe 'Workflow schema validation - ContextResolvers' { } ) Steps = @( - @{ Name = 'Step1'; Type = 'IdLE.Step.Noop' } + @{ Name = 'Step1'; Type = 'Test.IdLE.Step.Noop' } ) } @@ -162,7 +162,7 @@ Describe 'Workflow schema validation - ContextResolvers' { } ) Steps = @( - @{ Name = 'Step1'; Type = 'IdLE.Step.Noop' } + @{ Name = 'Step1'; Type = 'Test.IdLE.Step.Noop' } ) } diff --git a/tests/Packaging/ModuleSurface.Tests.ps1 b/tests/Packaging/ModuleSurface.Tests.ps1 index 00d731b4..ca469ec0 100644 --- a/tests/Packaging/ModuleSurface.Tests.ps1 +++ b/tests/Packaging/ModuleSurface.Tests.ps1 @@ -85,10 +85,10 @@ Describe 'Module manifests and public surface' { Name = 'Surface - OnFailure Contract' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Primary'; Type = 'IdLE.Step.Primary' } + @{ Name = 'Primary'; Type = 'Test.IdLE.Step.Primary' } ) OnFailureSteps = @( - @{ Name = 'Containment'; Type = 'IdLE.Step.Containment' } + @{ Name = 'Containment'; Type = 'Test.IdLE.Step.Containment' } ) } '@ @@ -96,10 +96,10 @@ Describe 'Module manifests and public surface' { $providers = @{ StepRegistry = @{ - 'IdLE.Step.Primary' = 'Invoke-IdleSurfaceTestNoopStep' - 'IdLE.Step.Containment' = 'Invoke-IdleSurfaceTestNoopStep' + 'Test.IdLE.Step.Primary' = 'Invoke-IdleSurfaceTestNoopStep' + 'Test.IdLE.Step.Containment' = 'Invoke-IdleSurfaceTestNoopStep' } - StepMetadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Primary', 'IdLE.Step.Containment') + StepMetadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Primary', 'Test.IdLE.Step.Containment') } $plan = New-IdlePlan -WorkflowPath $wfPath -Request $req -Providers $providers diff --git a/tests/Steps/_testHelpers.Steps.ps1 b/tests/Steps/_testHelpers.Steps.ps1 index 7ca89022..4bde7b4f 100644 --- a/tests/Steps/_testHelpers.Steps.ps1 +++ b/tests/Steps/_testHelpers.Steps.ps1 @@ -34,16 +34,16 @@ function New-IdleTestStepMetadata { hashtable receive the default permissive schema: @{ RequiredKeys = @(); OptionalKeys = @('*') }. .EXAMPLE - $metadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.ResolveIdentity', 'IdLE.Step.Primary') + $metadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.ResolveIdentity', 'Test.IdLE.Step.Primary') .EXAMPLE - $metadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Custom') -RequiredCapabilities @{ - 'IdLE.Step.Custom' = @('Custom.Capability') + $metadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Custom') -RequiredCapabilities @{ + 'Test.IdLE.Step.Custom' = @('Custom.IdLE.Capability.Test') } .EXAMPLE - $metadata = New-IdleTestStepMetadata -StepTypes @('IdLE.Step.Strict') -WithSchemas @{ - 'IdLE.Step.Strict' = @{ RequiredKeys = @('IdentityKey'); OptionalKeys = @('Provider') } + $metadata = New-IdleTestStepMetadata -StepTypes @('Test.IdLE.Step.Strict') -WithSchemas @{ + 'Test.IdLE.Step.Strict' = @{ RequiredKeys = @('IdentityKey'); OptionalKeys = @('Provider') } } #> [CmdletBinding()] diff --git a/tests/fixtures/plan-export/expected/plan-export.json b/tests/fixtures/plan-export/expected/plan-export.json index 1dde597d..d118dc8f 100644 --- a/tests/fixtures/plan-export/expected/plan-export.json +++ b/tests/fixtures/plan-export/expected/plan-export.json @@ -24,7 +24,7 @@ { "id": "step-01", "name": "Ensure Mailbox", - "stepType": "EnsureMailbox", + "stepType": "Test.IdLE.Step.EnsureMailbox", "provider": null, "condition": { "type": "always", diff --git a/tests/fixtures/workflows/condition-applicable-schema.psd1 b/tests/fixtures/workflows/condition-applicable-schema.psd1 index 746eb9d5..7afe5845 100644 --- a/tests/fixtures/workflows/condition-applicable-schema.psd1 +++ b/tests/fixtures/workflows/condition-applicable-schema.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'StrictStep' - Type = 'IdLE.Step.StrictApplicableTest' + Type = 'Test.IdLE.Step.StrictApplicableTest' Condition = @{ Equals = @{ Path = 'Plan.LifecycleEvent'; Value = 'Joiner' } } } ) diff --git a/tests/fixtures/workflows/condition-exists-absent.psd1 b/tests/fixtures/workflows/condition-exists-absent.psd1 index 43ebdcc7..ec0506bb 100644 --- a/tests/fixtures/workflows/condition-exists-absent.psd1 +++ b/tests/fixtures/workflows/condition-exists-absent.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'ConditionalExistsStep' - Type = 'IdLE.Step.ExistsConditionTest' + Type = 'Test.IdLE.Step.ExistsConditionTest' Condition = @{ Exists = 'Request.Context.Views.Identity.Profile.Attributes.Region' } With = @{ Value = '{{Request.Context.Views.Identity.Profile.Attributes.Region}}' diff --git a/tests/fixtures/workflows/condition-skip-onfailure.psd1 b/tests/fixtures/workflows/condition-skip-onfailure.psd1 index d7013930..e6461e98 100644 --- a/tests/fixtures/workflows/condition-skip-onfailure.psd1 +++ b/tests/fixtures/workflows/condition-skip-onfailure.psd1 @@ -2,12 +2,12 @@ Name = 'Condition Skip OnFailureStep' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Primary'; Type = 'IdLE.Step.PrimarySkipTest' } + @{ Name = 'Primary'; Type = 'Test.IdLE.Step.PrimarySkipTest' } ) OnFailureSteps = @( @{ Name = 'SkippedOnFailure' - Type = 'IdLE.Step.OnFailureSkipTest' + Type = 'Test.IdLE.Step.OnFailureSkipTest' Condition = @{ Equals = @{ Path = 'Plan.LifecycleEvent'; Value = 'Leaver' } } With = @{ Value = '{{Request.Intent.MissingKey}}' diff --git a/tests/fixtures/workflows/condition-skip-schema.psd1 b/tests/fixtures/workflows/condition-skip-schema.psd1 index a62f5a2e..4515e795 100644 --- a/tests/fixtures/workflows/condition-skip-schema.psd1 +++ b/tests/fixtures/workflows/condition-skip-schema.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'StrictStep' - Type = 'IdLE.Step.StrictSchemaTest' + Type = 'Test.IdLE.Step.StrictSchemaTest' Condition = @{ Equals = @{ Path = 'Plan.LifecycleEvent'; Value = 'Leaver' } } } ) diff --git a/tests/fixtures/workflows/condition-skip-template.psd1 b/tests/fixtures/workflows/condition-skip-template.psd1 index eec3b3d7..8fce310b 100644 --- a/tests/fixtures/workflows/condition-skip-template.psd1 +++ b/tests/fixtures/workflows/condition-skip-template.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'ConditionalStep' - Type = 'IdLE.Step.ConditionalSkipTest' + Type = 'Test.IdLE.Step.ConditionalSkipTest' Condition = @{ Equals = @{ Path = 'Plan.LifecycleEvent'; Value = 'Leaver' } } With = @{ Value = '{{Request.Intent.MissingKey}}' diff --git a/tests/fixtures/workflows/invoke-two-emitevent-steps.psd1 b/tests/fixtures/workflows/invoke-two-emitevent-steps.psd1 index 6885742e..2d8858ff 100644 --- a/tests/fixtures/workflows/invoke-two-emitevent-steps.psd1 +++ b/tests/fixtures/workflows/invoke-two-emitevent-steps.psd1 @@ -2,7 +2,7 @@ Name = 'Joiner - Standard' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'Step1'; Type = 'IdLE.Step.EmitEvent'; With = @{ Message = 'Step 1' } } - @{ Name = 'Step2'; Type = 'IdLE.Step.EmitEvent'; With = @{ Message = 'Step 2' } } + @{ Name = 'Step1'; Type = 'Test.IdLE.Step.Emit'; With = @{ Message = 'Step 1' } } + @{ Name = 'Step2'; Type = 'Test.IdLE.Step.Emit'; With = @{ Message = 'Step 2' } } ) } diff --git a/tests/fixtures/workflows/joiner-invalid-cap.psd1 b/tests/fixtures/workflows/joiner-invalid-cap.psd1 index cc353561..22d23d86 100644 --- a/tests/fixtures/workflows/joiner-invalid-cap.psd1 +++ b/tests/fixtures/workflows/joiner-invalid-cap.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Test step' - Type = 'Custom.Step.Test' + Type = 'Custom.IdLE.Step.Test' } ) } diff --git a/tests/fixtures/workflows/joiner-invalid.psd1 b/tests/fixtures/workflows/joiner-invalid.psd1 index fefeefaf..3bab2601 100644 --- a/tests/fixtures/workflows/joiner-invalid.psd1 +++ b/tests/fixtures/workflows/joiner-invalid.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Test step' - Type = 'Custom.Step.Test' + Type = 'Custom.IdLE.Step.Test' } ) } diff --git a/tests/fixtures/workflows/joiner-no-metadata.psd1 b/tests/fixtures/workflows/joiner-no-metadata.psd1 index c80faa7f..ef282ebe 100644 --- a/tests/fixtures/workflows/joiner-no-metadata.psd1 +++ b/tests/fixtures/workflows/joiner-no-metadata.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Unknown step' - Type = 'Custom.Step.Unknown' + Type = 'Custom.IdLE.Step.Unknown' } ) } diff --git a/tests/fixtures/workflows/joiner-normalized.psd1 b/tests/fixtures/workflows/joiner-normalized.psd1 index 4cd78ed7..63ba3e96 100644 --- a/tests/fixtures/workflows/joiner-normalized.psd1 +++ b/tests/fixtures/workflows/joiner-normalized.psd1 @@ -2,7 +2,7 @@ Name = 'Joiner - Standard' LifecycleEvent = 'Joiner' Steps = @( - @{ Name = 'ResolveIdentity'; Type = 'IdLE.Step.ResolveIdentity' } + @{ Name = 'ResolveIdentity'; Type = 'Test.IdLE.Step.ResolveIdentity' } @{ Name = 'EnsureAttributes'; Type = 'IdLE.Step.EnsureAttributes'; With = @{ IdentityKey = 'test-user'; Attributes = @{} } } ) } diff --git a/tests/fixtures/workflows/joiner-scriptblock.psd1 b/tests/fixtures/workflows/joiner-scriptblock.psd1 index 2373222e..81528235 100644 --- a/tests/fixtures/workflows/joiner-scriptblock.psd1 +++ b/tests/fixtures/workflows/joiner-scriptblock.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Test step' - Type = 'Custom.Step.Test' + Type = 'Custom.IdLE.Step.Test' } ) } diff --git a/tests/fixtures/workflows/preconditions/blocked-default.psd1 b/tests/fixtures/workflows/preconditions/blocked-default.psd1 index 0bf4cdb1..b5c40d51 100644 --- a/tests/fixtures/workflows/preconditions/blocked-default.psd1 +++ b/tests/fixtures/workflows/preconditions/blocked-default.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.BlockedDefault' + Type = 'Test.IdLE.Step.BlockedDefault' Precondition = @{ All = @( @{ diff --git a/tests/fixtures/workflows/preconditions/blocked-no-onfailure.psd1 b/tests/fixtures/workflows/preconditions/blocked-no-onfailure.psd1 index e0ef8ab7..238c4616 100644 --- a/tests/fixtures/workflows/preconditions/blocked-no-onfailure.psd1 +++ b/tests/fixtures/workflows/preconditions/blocked-no-onfailure.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.BlockedNoOnFailure' + Type = 'Test.IdLE.Step.BlockedNoOnFailure' Precondition = @{ All = @( @{ @@ -20,7 +20,7 @@ OnFailureSteps = @( @{ Name = 'Cleanup' - Type = 'IdLE.Step.OnFailureCleanup' + Type = 'Test.IdLE.Step.OnFailureCleanup' } ) } diff --git a/tests/fixtures/workflows/preconditions/blocked.psd1 b/tests/fixtures/workflows/preconditions/blocked.psd1 index 2faa473b..da94e2cb 100644 --- a/tests/fixtures/workflows/preconditions/blocked.psd1 +++ b/tests/fixtures/workflows/preconditions/blocked.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.BlockedPrecondition' + Type = 'Test.IdLE.Step.BlockedPrecondition' Precondition = @{ All = @( @{ @@ -19,7 +19,7 @@ } @{ Name = 'Step2' - Type = 'IdLE.Step.SecondStep' + Type = 'Test.IdLE.Step.SecondStep' } ) } diff --git a/tests/fixtures/workflows/preconditions/continue-event.psd1 b/tests/fixtures/workflows/preconditions/continue-event.psd1 index 5f10bcc7..9c55644e 100644 --- a/tests/fixtures/workflows/preconditions/continue-event.psd1 +++ b/tests/fixtures/workflows/preconditions/continue-event.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.ContinuePreconditionEvent' + Type = 'Test.IdLE.Step.ContinuePreconditionEvent' Precondition = @{ All = @( @{ diff --git a/tests/fixtures/workflows/preconditions/continue.psd1 b/tests/fixtures/workflows/preconditions/continue.psd1 index 960f5f1b..bddd201a 100644 --- a/tests/fixtures/workflows/preconditions/continue.psd1 +++ b/tests/fixtures/workflows/preconditions/continue.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.ContinuePrecondition' + Type = 'Test.IdLE.Step.ContinuePrecondition' Precondition = @{ All = @( @{ @@ -19,7 +19,7 @@ } @{ Name = 'Step2' - Type = 'IdLE.Step.SecondStep' + Type = 'Test.IdLE.Step.SecondStep' } ) } diff --git a/tests/fixtures/workflows/preconditions/current-cleanup-blocked.psd1 b/tests/fixtures/workflows/preconditions/current-cleanup-blocked.psd1 index f88f86ba..ce24ee32 100644 --- a/tests/fixtures/workflows/preconditions/current-cleanup-blocked.psd1 +++ b/tests/fixtures/workflows/preconditions/current-cleanup-blocked.psd1 @@ -13,7 +13,7 @@ Steps = @( @{ Name = 'CurrentBlockedStep' - Type = 'IdLE.Step.CurrentCleanupTest' + Type = 'Test.IdLE.Step.CurrentCleanupTest' With = @{ Provider = 'Identity' } # Precondition always fails: LifecycleEvent is Joiner, not Leaver. Precondition = @{ diff --git a/tests/fixtures/workflows/preconditions/current-cleanup-fail.psd1 b/tests/fixtures/workflows/preconditions/current-cleanup-fail.psd1 index f601a45e..47b5e885 100644 --- a/tests/fixtures/workflows/preconditions/current-cleanup-fail.psd1 +++ b/tests/fixtures/workflows/preconditions/current-cleanup-fail.psd1 @@ -13,7 +13,7 @@ Steps = @( @{ Name = 'CurrentFailStep' - Type = 'IdLE.Step.CurrentCleanupTest' + Type = 'Test.IdLE.Step.CurrentCleanupTest' With = @{ Provider = 'Identity' } # Precondition always fails: LifecycleEvent is Joiner, not Leaver. Precondition = @{ diff --git a/tests/fixtures/workflows/preconditions/event.psd1 b/tests/fixtures/workflows/preconditions/event.psd1 index 1c4956a3..5d1f02c0 100644 --- a/tests/fixtures/workflows/preconditions/event.psd1 +++ b/tests/fixtures/workflows/preconditions/event.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.PreconditionEvent' + Type = 'Test.IdLE.Step.PreconditionEvent' Precondition = @{ All = @( @{ diff --git a/tests/fixtures/workflows/preconditions/fail-runs-onfailure.psd1 b/tests/fixtures/workflows/preconditions/fail-runs-onfailure.psd1 index c25b05a0..735a4dd1 100644 --- a/tests/fixtures/workflows/preconditions/fail-runs-onfailure.psd1 +++ b/tests/fixtures/workflows/preconditions/fail-runs-onfailure.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.FailRunsOnFailure' + Type = 'Test.IdLE.Step.FailRunsOnFailure' Precondition = @{ All = @( @{ @@ -21,7 +21,7 @@ OnFailureSteps = @( @{ Name = 'Cleanup' - Type = 'IdLE.Step.OnFailureCleanup' + Type = 'Test.IdLE.Step.OnFailureCleanup' } ) } diff --git a/tests/fixtures/workflows/preconditions/fail.psd1 b/tests/fixtures/workflows/preconditions/fail.psd1 index 3f10d445..6b704009 100644 --- a/tests/fixtures/workflows/preconditions/fail.psd1 +++ b/tests/fixtures/workflows/preconditions/fail.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.FailPrecondition' + Type = 'Test.IdLE.Step.FailPrecondition' Precondition = @{ All = @( @{ @@ -19,7 +19,7 @@ } @{ Name = 'Step2' - Type = 'IdLE.Step.SecondStep' + Type = 'Test.IdLE.Step.SecondStep' } ) } diff --git a/tests/fixtures/workflows/preconditions/invalid-event-type.psd1 b/tests/fixtures/workflows/preconditions/invalid-event-type.psd1 index c1a640cb..18c35607 100644 --- a/tests/fixtures/workflows/preconditions/invalid-event-type.psd1 +++ b/tests/fixtures/workflows/preconditions/invalid-event-type.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.InvalidPCEvt' + Type = 'Test.IdLE.Step.InvalidPCEvt' Precondition = @{ All = @( @{ diff --git a/tests/fixtures/workflows/preconditions/invalid-onpreconditionfalse.psd1 b/tests/fixtures/workflows/preconditions/invalid-onpreconditionfalse.psd1 index 55206a77..42b3145b 100644 --- a/tests/fixtures/workflows/preconditions/invalid-onpreconditionfalse.psd1 +++ b/tests/fixtures/workflows/preconditions/invalid-onpreconditionfalse.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.InvalidOPF' + Type = 'Test.IdLE.Step.InvalidOPF' Precondition = @{ All = @( @{ diff --git a/tests/fixtures/workflows/preconditions/invalid-schema.psd1 b/tests/fixtures/workflows/preconditions/invalid-schema.psd1 index 7206bf35..004958d4 100644 --- a/tests/fixtures/workflows/preconditions/invalid-schema.psd1 +++ b/tests/fixtures/workflows/preconditions/invalid-schema.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.InvalidPreconditionSchema' + Type = 'Test.IdLE.Step.InvalidPreconditionSchema' Precondition = @{ All = @( @{ diff --git a/tests/fixtures/workflows/preconditions/invalid-single-hashtable.psd1 b/tests/fixtures/workflows/preconditions/invalid-single-hashtable.psd1 index 964b1642..3d66c7cf 100644 --- a/tests/fixtures/workflows/preconditions/invalid-single-hashtable.psd1 +++ b/tests/fixtures/workflows/preconditions/invalid-single-hashtable.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.InvalidPCSingleHt' + Type = 'Test.IdLE.Step.InvalidPCSingleHt' Precondition = @{ Equals = @{ Path = 'Plan.LifecycleEvent' diff --git a/tests/fixtures/workflows/preconditions/missing-context-at-invoke.psd1 b/tests/fixtures/workflows/preconditions/missing-context-at-invoke.psd1 index 8737d0a3..1ff9e9ba 100644 --- a/tests/fixtures/workflows/preconditions/missing-context-at-invoke.psd1 +++ b/tests/fixtures/workflows/preconditions/missing-context-at-invoke.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.MissingContextAtInvoke' + Type = 'Test.IdLE.Step.MissingContextAtInvoke' Precondition = @{ All = @( @{ In = @{ Path = 'Request.Context.NA'; Values = @('EU', 'DE') } } diff --git a/tests/fixtures/workflows/preconditions/no-preconditions.psd1 b/tests/fixtures/workflows/preconditions/no-preconditions.psd1 index a39e9d2a..5ca00f35 100644 --- a/tests/fixtures/workflows/preconditions/no-preconditions.psd1 +++ b/tests/fixtures/workflows/preconditions/no-preconditions.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.NoPrecondition' + Type = 'Test.IdLE.Step.NoPrecondition' } ) } diff --git a/tests/fixtures/workflows/preconditions/onfailure-blocked-precondition.psd1 b/tests/fixtures/workflows/preconditions/onfailure-blocked-precondition.psd1 index cc339c16..e961293b 100644 --- a/tests/fixtures/workflows/preconditions/onfailure-blocked-precondition.psd1 +++ b/tests/fixtures/workflows/preconditions/onfailure-blocked-precondition.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.FailRunsOnFailure' + Type = 'Test.IdLE.Step.FailRunsOnFailure' Precondition = @{ All = @( @{ @@ -21,7 +21,7 @@ OnFailureSteps = @( @{ Name = 'Cleanup' - Type = 'IdLE.Step.OnFailureCleanup' + Type = 'Test.IdLE.Step.OnFailureCleanup' Precondition = @{ All = @( @{ diff --git a/tests/fixtures/workflows/preconditions/onfailure-continue-precondition.psd1 b/tests/fixtures/workflows/preconditions/onfailure-continue-precondition.psd1 index 3062c8ef..43465e41 100644 --- a/tests/fixtures/workflows/preconditions/onfailure-continue-precondition.psd1 +++ b/tests/fixtures/workflows/preconditions/onfailure-continue-precondition.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.FailRunsOnFailure' + Type = 'Test.IdLE.Step.FailRunsOnFailure' Precondition = @{ All = @( @{ @@ -21,7 +21,7 @@ OnFailureSteps = @( @{ Name = 'Cleanup' - Type = 'IdLE.Step.OnFailureCleanup' + Type = 'Test.IdLE.Step.OnFailureCleanup' Precondition = @{ All = @( @{ diff --git a/tests/fixtures/workflows/preconditions/passing.psd1 b/tests/fixtures/workflows/preconditions/passing.psd1 index dcb17e4a..ca058720 100644 --- a/tests/fixtures/workflows/preconditions/passing.psd1 +++ b/tests/fixtures/workflows/preconditions/passing.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'Step1' - Type = 'IdLE.Step.PassingPrecondition' + Type = 'Test.IdLE.Step.PassingPrecondition' Precondition = @{ All = @( @{ diff --git a/tests/fixtures/workflows/template-tests/template-actor.psd1 b/tests/fixtures/workflows/template-tests/template-actor.psd1 index 3287d620..64a13b4e 100644 --- a/tests/fixtures/workflows/template-tests/template-actor.psd1 +++ b/tests/fixtures/workflows/template-tests/template-actor.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ ActorName = '{{Request.Actor}}' } diff --git a/tests/fixtures/workflows/template-tests/template-array-value.psd1 b/tests/fixtures/workflows/template-tests/template-array-value.psd1 index 08787e22..d9f0376f 100644 --- a/tests/fixtures/workflows/template-tests/template-array-value.psd1 +++ b/tests/fixtures/workflows/template-tests/template-array-value.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Intent.Tags}}' } diff --git a/tests/fixtures/workflows/template-tests/template-array.psd1 b/tests/fixtures/workflows/template-tests/template-array.psd1 index 39daca96..ee2d8f31 100644 --- a/tests/fixtures/workflows/template-tests/template-array.psd1 +++ b/tests/fixtures/workflows/template-tests/template-array.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Emails = @( '{{Request.Intent.PrimaryEmail}}' diff --git a/tests/fixtures/workflows/template-tests/template-backslash.psd1 b/tests/fixtures/workflows/template-tests/template-backslash.psd1 index 5a124ab2..cd105902 100644 --- a/tests/fixtures/workflows/template-tests/template-backslash.psd1 +++ b/tests/fixtures/workflows/template-tests/template-backslash.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ IdentityKey = 'DOMAIN\{{Request.IdentityKeys.sAMAccountName}}' } diff --git a/tests/fixtures/workflows/template-tests/template-boolean.psd1 b/tests/fixtures/workflows/template-tests/template-boolean.psd1 index 76467092..b92e8f37 100644 --- a/tests/fixtures/workflows/template-tests/template-boolean.psd1 +++ b/tests/fixtures/workflows/template-tests/template-boolean.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = 'Enabled: {{Request.Intent.IsEnabled}}' } diff --git a/tests/fixtures/workflows/template-tests/template-context-missing-path.psd1 b/tests/fixtures/workflows/template-tests/template-context-missing-path.psd1 index e370e1d0..e9abcd0d 100644 --- a/tests/fixtures/workflows/template-tests/template-context-missing-path.psd1 +++ b/tests/fixtures/workflows/template-tests/template-context-missing-path.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Context.NonExistent}}' } diff --git a/tests/fixtures/workflows/template-tests/template-context-multiple.psd1 b/tests/fixtures/workflows/template-tests/template-context-multiple.psd1 index a7d6a241..883b2b86 100644 --- a/tests/fixtures/workflows/template-tests/template-context-multiple.psd1 +++ b/tests/fixtures/workflows/template-tests/template-context-multiple.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Message = 'Identity {{Request.Context.Identity.DisplayName}} ({{Request.Context.Identity.ObjectId}}) loaded.' } diff --git a/tests/fixtures/workflows/template-tests/template-context-nested-hash.psd1 b/tests/fixtures/workflows/template-tests/template-context-nested-hash.psd1 index db2c4dfd..7e4935d7 100644 --- a/tests/fixtures/workflows/template-tests/template-context-nested-hash.psd1 +++ b/tests/fixtures/workflows/template-tests/template-context-nested-hash.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Identity = @{ Name = '{{Request.Context.Identity.DisplayName}}' diff --git a/tests/fixtures/workflows/template-tests/template-context.psd1 b/tests/fixtures/workflows/template-tests/template-context.psd1 index 93b7e423..56627365 100644 --- a/tests/fixtures/workflows/template-tests/template-context.psd1 +++ b/tests/fixtures/workflows/template-tests/template-context.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ ObjectId = '{{Request.Context.Identity.ObjectId}}' } diff --git a/tests/fixtures/workflows/template-tests/template-correlation-id.psd1 b/tests/fixtures/workflows/template-tests/template-correlation-id.psd1 index f29c455c..353e170e 100644 --- a/tests/fixtures/workflows/template-tests/template-correlation-id.psd1 +++ b/tests/fixtures/workflows/template-tests/template-correlation-id.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Id = '{{Request.CorrelationId}}' } diff --git a/tests/fixtures/workflows/template-tests/template-desiredstate.psd1 b/tests/fixtures/workflows/template-tests/template-desiredstate.psd1 index 7145a15f..ad97cc5f 100644 --- a/tests/fixtures/workflows/template-tests/template-desiredstate.psd1 +++ b/tests/fixtures/workflows/template-tests/template-desiredstate.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Department = '{{Request.Intent.Department}}' } diff --git a/tests/fixtures/workflows/template-tests/template-escaped-invalid-root.psd1 b/tests/fixtures/workflows/template-tests/template-escaped-invalid-root.psd1 index f1c2b57c..d516f724 100644 --- a/tests/fixtures/workflows/template-tests/template-escaped-invalid-root.psd1 +++ b/tests/fixtures/workflows/template-tests/template-escaped-invalid-root.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '\{{Request.InvalidRoot}}' } diff --git a/tests/fixtures/workflows/template-tests/template-escaped-mixed.psd1 b/tests/fixtures/workflows/template-tests/template-escaped-mixed.psd1 index e61e3416..04e84080 100644 --- a/tests/fixtures/workflows/template-tests/template-escaped-mixed.psd1 +++ b/tests/fixtures/workflows/template-tests/template-escaped-mixed.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = 'Literal \{{ and template {{Request.Intent.Name}}' } diff --git a/tests/fixtures/workflows/template-tests/template-escaped.psd1 b/tests/fixtures/workflows/template-tests/template-escaped.psd1 index ceca8fd5..7654b784 100644 --- a/tests/fixtures/workflows/template-tests/template-escaped.psd1 +++ b/tests/fixtures/workflows/template-tests/template-escaped.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = 'Literal \{{ braces here' } diff --git a/tests/fixtures/workflows/template-tests/template-hashtable.psd1 b/tests/fixtures/workflows/template-tests/template-hashtable.psd1 index fb5219aa..adb2e3f3 100644 --- a/tests/fixtures/workflows/template-tests/template-hashtable.psd1 +++ b/tests/fixtures/workflows/template-tests/template-hashtable.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Intent.UserData}}' } diff --git a/tests/fixtures/workflows/template-tests/template-input-alias.psd1 b/tests/fixtures/workflows/template-tests/template-input-alias.psd1 index f6ac18fa..ac917abd 100644 --- a/tests/fixtures/workflows/template-tests/template-input-alias.psd1 +++ b/tests/fixtures/workflows/template-tests/template-input-alias.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Intent.Name}}' } diff --git a/tests/fixtures/workflows/template-tests/template-input-exists.psd1 b/tests/fixtures/workflows/template-tests/template-input-exists.psd1 index c9cd0159..1bd3fc48 100644 --- a/tests/fixtures/workflows/template-tests/template-input-exists.psd1 +++ b/tests/fixtures/workflows/template-tests/template-input-exists.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Intent.Name}}' } diff --git a/tests/fixtures/workflows/template-tests/template-intent.psd1 b/tests/fixtures/workflows/template-tests/template-intent.psd1 index fb8f9128..9c6644e0 100644 --- a/tests/fixtures/workflows/template-tests/template-intent.psd1 +++ b/tests/fixtures/workflows/template-tests/template-intent.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Department = '{{Request.Intent.Department}}' } diff --git a/tests/fixtures/workflows/template-tests/template-lifecycle-event.psd1 b/tests/fixtures/workflows/template-tests/template-lifecycle-event.psd1 index 6d98eeac..a4d8abe5 100644 --- a/tests/fixtures/workflows/template-tests/template-lifecycle-event.psd1 +++ b/tests/fixtures/workflows/template-tests/template-lifecycle-event.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Event = '{{Request.LifecycleEvent}}' } diff --git a/tests/fixtures/workflows/template-tests/template-missing-path.psd1 b/tests/fixtures/workflows/template-tests/template-missing-path.psd1 index d9bc6788..da45caea 100644 --- a/tests/fixtures/workflows/template-tests/template-missing-path.psd1 +++ b/tests/fixtures/workflows/template-tests/template-missing-path.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Intent.NonExistent}}' } diff --git a/tests/fixtures/workflows/template-tests/template-mixed-boolean.psd1 b/tests/fixtures/workflows/template-tests/template-mixed-boolean.psd1 index 21c57c37..12a83eab 100644 --- a/tests/fixtures/workflows/template-tests/template-mixed-boolean.psd1 +++ b/tests/fixtures/workflows/template-tests/template-mixed-boolean.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Message = 'Account enabled: {{Request.Intent.Enabled}}' } diff --git a/tests/fixtures/workflows/template-tests/template-multiple.psd1 b/tests/fixtures/workflows/template-tests/template-multiple.psd1 index 652395d2..d67c33db 100644 --- a/tests/fixtures/workflows/template-tests/template-multiple.psd1 +++ b/tests/fixtures/workflows/template-tests/template-multiple.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Message = 'User {{Request.Intent.DisplayName}} ({{Request.Intent.UserPrincipalName}}) is joining.' } diff --git a/tests/fixtures/workflows/template-tests/template-nested-hash.psd1 b/tests/fixtures/workflows/template-tests/template-nested-hash.psd1 index b6c4de47..798c0fa1 100644 --- a/tests/fixtures/workflows/template-tests/template-nested-hash.psd1 +++ b/tests/fixtures/workflows/template-tests/template-nested-hash.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ User = @{ Name = '{{Request.Intent.DisplayName}}' diff --git a/tests/fixtures/workflows/template-tests/template-null-value.psd1 b/tests/fixtures/workflows/template-tests/template-null-value.psd1 index 64813312..dba020c8 100644 --- a/tests/fixtures/workflows/template-tests/template-null-value.psd1 +++ b/tests/fixtures/workflows/template-tests/template-null-value.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Intent.NullField}}' } diff --git a/tests/fixtures/workflows/template-tests/template-numeric.psd1 b/tests/fixtures/workflows/template-tests/template-numeric.psd1 index f323824b..aa04711f 100644 --- a/tests/fixtures/workflows/template-tests/template-numeric.psd1 +++ b/tests/fixtures/workflows/template-tests/template-numeric.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = 'ID: {{Request.Intent.UserId}}' } diff --git a/tests/fixtures/workflows/template-tests/template-onfailure.psd1 b/tests/fixtures/workflows/template-tests/template-onfailure.psd1 index 584d1088..17564a9f 100644 --- a/tests/fixtures/workflows/template-tests/template-onfailure.psd1 +++ b/tests/fixtures/workflows/template-tests/template-onfailure.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'MainStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Intent.Name}}' } @@ -13,7 +13,7 @@ OnFailureSteps = @( @{ Name = 'FailureHandler' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ ErrorMessage = 'Failed for user {{Request.Intent.UserPrincipalName}}' } diff --git a/tests/fixtures/workflows/template-tests/template-path-spaces.psd1 b/tests/fixtures/workflows/template-tests/template-path-spaces.psd1 index 8e5c702c..f3d87ee7 100644 --- a/tests/fixtures/workflows/template-tests/template-path-spaces.psd1 +++ b/tests/fixtures/workflows/template-tests/template-path-spaces.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Intent.User Name}}' } diff --git a/tests/fixtures/workflows/template-tests/template-path-special.psd1 b/tests/fixtures/workflows/template-tests/template-path-special.psd1 index 84fc0b4d..961d5bc7 100644 --- a/tests/fixtures/workflows/template-tests/template-path-special.psd1 +++ b/tests/fixtures/workflows/template-tests/template-path-special.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Intent.User@Name}}' } diff --git a/tests/fixtures/workflows/template-tests/template-plan-root.psd1 b/tests/fixtures/workflows/template-tests/template-plan-root.psd1 index bca84a57..06b0a178 100644 --- a/tests/fixtures/workflows/template-tests/template-plan-root.psd1 +++ b/tests/fixtures/workflows/template-tests/template-plan-root.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Plan.WorkflowName}}' } diff --git a/tests/fixtures/workflows/template-tests/template-providers-root.psd1 b/tests/fixtures/workflows/template-tests/template-providers-root.psd1 index 91465500..5deb4903 100644 --- a/tests/fixtures/workflows/template-tests/template-providers-root.psd1 +++ b/tests/fixtures/workflows/template-tests/template-providers-root.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Providers.AuthSessionBroker}}' } diff --git a/tests/fixtures/workflows/template-tests/template-pure-boolean-false.psd1 b/tests/fixtures/workflows/template-tests/template-pure-boolean-false.psd1 index 32e31193..8fbcfb88 100644 --- a/tests/fixtures/workflows/template-tests/template-pure-boolean-false.psd1 +++ b/tests/fixtures/workflows/template-tests/template-pure-boolean-false.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Enabled = '{{Request.Intent.Enabled}}' } diff --git a/tests/fixtures/workflows/template-tests/template-pure-boolean-true.psd1 b/tests/fixtures/workflows/template-tests/template-pure-boolean-true.psd1 index 3d933d7c..e917f8f5 100644 --- a/tests/fixtures/workflows/template-tests/template-pure-boolean-true.psd1 +++ b/tests/fixtures/workflows/template-tests/template-pure-boolean-true.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ IsActive = '{{Request.Intent.IsActive}}' } diff --git a/tests/fixtures/workflows/template-tests/template-pure-datetime.psd1 b/tests/fixtures/workflows/template-tests/template-pure-datetime.psd1 index 844a5b1d..638e5874 100644 --- a/tests/fixtures/workflows/template-tests/template-pure-datetime.psd1 +++ b/tests/fixtures/workflows/template-tests/template-pure-datetime.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ StartDate = '{{Request.Intent.StartDate}}' } diff --git a/tests/fixtures/workflows/template-tests/template-pure-guid.psd1 b/tests/fixtures/workflows/template-tests/template-pure-guid.psd1 index 3a2f4176..bfa4cc23 100644 --- a/tests/fixtures/workflows/template-tests/template-pure-guid.psd1 +++ b/tests/fixtures/workflows/template-tests/template-pure-guid.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ ObjectId = '{{Request.Intent.ObjectId}}' } diff --git a/tests/fixtures/workflows/template-tests/template-pure-integer.psd1 b/tests/fixtures/workflows/template-tests/template-pure-integer.psd1 index 65705f6b..ded7efad 100644 --- a/tests/fixtures/workflows/template-tests/template-pure-integer.psd1 +++ b/tests/fixtures/workflows/template-tests/template-pure-integer.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ UserId = '{{Request.Intent.UserId}}' } diff --git a/tests/fixtures/workflows/template-tests/template-simple.psd1 b/tests/fixtures/workflows/template-tests/template-simple.psd1 index 7cdfbdf8..5a8cd2c6 100644 --- a/tests/fixtures/workflows/template-tests/template-simple.psd1 +++ b/tests/fixtures/workflows/template-tests/template-simple.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ UserName = '{{Request.Intent.UserPrincipalName}}' } diff --git a/tests/fixtures/workflows/template-tests/template-unbalanced-close.psd1 b/tests/fixtures/workflows/template-tests/template-unbalanced-close.psd1 index f9f4ae40..4c468bc7 100644 --- a/tests/fixtures/workflows/template-tests/template-unbalanced-close.psd1 +++ b/tests/fixtures/workflows/template-tests/template-unbalanced-close.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = 'Request.Intent.Name}}' } diff --git a/tests/fixtures/workflows/template-tests/template-unbalanced-open.psd1 b/tests/fixtures/workflows/template-tests/template-unbalanced-open.psd1 index e6e3e6db..ab2d6bd7 100644 --- a/tests/fixtures/workflows/template-tests/template-unbalanced-open.psd1 +++ b/tests/fixtures/workflows/template-tests/template-unbalanced-open.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Request.Intent.Name' } diff --git a/tests/fixtures/workflows/template-tests/template-workflow-root.psd1 b/tests/fixtures/workflows/template-tests/template-workflow-root.psd1 index 93c69933..e442db91 100644 --- a/tests/fixtures/workflows/template-tests/template-workflow-root.psd1 +++ b/tests/fixtures/workflows/template-tests/template-workflow-root.psd1 @@ -4,7 +4,7 @@ Steps = @( @{ Name = 'TestStep' - Type = 'IdLE.Step.Test' + Type = 'Test.IdLE.Step.Test' With = @{ Value = '{{Workflow.Name}}' }