| title | Providers |
|---|---|
| sidebar_label | Providers |
Providers in IdLE are responsible for interacting with external systems such as identity stores, directories, or resource systems. They form the boundary between the IdLE core engine and the outside world.
This document explains the conceptual role of providers, what is meant by "contracts" in IdLE, and how responsibilities are intentionally separated to keep the engine portable, testable, and host-agnostic.
A provider is an adapter to an external system.
Examples include:
- identity directories (Active Directory, Entra ID)
- account stores
- entitlement systems
- mock or file-based systems used for testing
The IdLE core engine does not know how a provider works. It only knows what it expects from it.
This allows the same workflow and plan to run:
- locally with mock providers
- in CI pipelines
- in production environments
without modification.
In IdLE, a contract is not a formal interface or class.
A contract is a shared expectation between:
- the engine
- steps
- providers
It defines:
- which capabilities are required
- which inputs are expected
- which outputs are returned
- how errors are represented
Contracts are intentionally implicit and lightweight, following PowerShell conventions rather than strict type systems.
IdLE favors implicit contracts because they:
- align with PowerShell's object-based pipeline model
- avoid rigid inheritance hierarchies
- keep providers easy to mock and test
- allow gradual evolution without breaking existing implementations
The contract is expressed through:
- documented behavior
- expected object shapes
- consistent naming and semantics
While IdLE does not enforce provider categories, common conceptual groupings exist:
-
Identity providers
- Manage identities, attributes, and lifecycle state
-
Resource or entitlement providers
- Manage group membership, permissions, or access rights
-
Mock and test providers
- Used for unit tests and demos
- Provide deterministic, side-effect-free behavior
These categories are descriptive, not prescriptive.
Providers are supplied by the host at execution time.
This enables:
- swapping implementations without changing workflows
- testing workflows with mock providers
- running the same plan in different environments
The engine treats providers as opaque objects and does not validate their implementation beyond contract usage.
An entitlement is identified by Kind (e.g. Group, AdministrativeUnit) and Id. The entitlement steps
(IdLE.Step.EnsureEntitlement, IdLE.Step.PruneEntitlements, IdLE.Step.PruneEntitlementsEnsureKeep) and the
IdLE.Entitlement.List context resolver call these methods:
| Method | Contract |
|---|---|
ListEntitlements(IdentityKey[, AuthSession][, Kind]) |
Returns entitlement objects with Kind and Id. The optional Kind parameter filters the result; callers pass it when the method declares it. |
GrantEntitlement(IdentityKey, Entitlement[, AuthSession]) |
Idempotent; returns a result with Changed, IdentityKey, Entitlement. |
RevokeEntitlement(IdentityKey, Entitlement[, AuthSession]) |
Idempotent; same result shape. |
ResolveEntitlement(Entitlement[, AuthSession]) (optional) |
Returns the entitlement with its canonical Id (e.g. a group DN for a sAMAccountName), so that prune Keep entries match ListEntitlements output. The Kind comes from Entitlement.Kind. |
BulkGrantEntitlements / BulkRevokeEntitlements(IdentityKey, Entitlements[, AuthSession]) (optional) |
Per-item results with Changed, Error, Entitlement. |
Kinds: a provider supports a fixed set of Kinds and rejects every other Kind (including misspellings) with an
error before changing anything, in ListEntitlements(Kind) as well as in Grant, Revoke, Resolve and the bulk methods.
Kinds compare case-insensitively; providers return the canonical casing.
| Provider | Supported Kinds |
|---|---|
| AD | Group |
| Entra ID | Group, AdministrativeUnit |
| Mock | any non-empty Kind |
This keeps workflow mistakes visible: without the check, an AdministrativeUnit entitlement on AD would be resolved as
a group with the same name, and a prune with an unsupported Kind would silently find nothing to remove.
Migration from earlier versions: ResolveEntitlement($Kind, $Entitlement, $AuthSession) is now
ResolveEntitlement($Entitlement, $AuthSession).
Many providers require authenticated connections (tokens, API clients, remote sessions). IdLE keeps authentication out of the engine and out of individual providers by using a host-supplied broker.
The host injects an AuthSessionBroker into the providers map:
Providers.AuthSessionBroker
During execution, steps and providers may acquire sessions via the execution context:
Context.AcquireAuthSession(Name, Options)
Where:
Nameidentifies the requested session (e.g.Graph,ExchangeOnline,Ldap, ...).Optionsis an optional data-only hashtable.$nullis treated as an empty hashtable.- ScriptBlocks are rejected, including nested values.
The broker must expose a method:
AcquireAuthSession(Name, Options)
-
Engine
- Provides
Context.AcquireAuthSession()as a stable API. - Enforces the data-only boundary for
Options. - Does not implement authentication.
- Provides
-
Host
- Implements and configures the AuthSessionBroker.
- Decides how to authenticate (interactive, managed identity, certificate, secrets, ...).
- Must ensure secrets are not leaked into plans, events, or exports.
-
Providers / Steps
- Request sessions through the execution context.
- Must not perform their own authentication flows.
The execution context may enrich the broker request with common run metadata, such as:
CorrelationIdActor
Providers and steps should treat these values as optional.
IdLE step handlers can optionally accept a Context parameter.
To remain backwards compatible, the engine passes -Context $Context only if the
handler supports a Context parameter.
Guidance:
- New step handlers should accept
Contextto access providers, event sink, and auth session acquisition. - Existing handlers without
Contextcontinue to work unchanged.
Providers should have contract tests that verify behavior against a mock or test harness. Unit tests must not call live systems.
For testing guidance, see Testing (comes later).
Providers and the step registry are host-controlled extension points and should be treated as trusted code. Workflows and lifecycle requests are data-only and must not contain executable objects.
For details, see Security.
Providers must not be embedded into the core engine or steps.
Doing so would:
- break portability
- reduce testability
- tightly couple IdLE to specific environments
Introducing strict interfaces or class hierarchies for providers can quickly make implementations brittle.
Contracts should remain:
- behavior-focused
- documented
- enforced by tests and usage patterns
Steps must never rely on provider-specific behavior beyond the documented contract.
If a step requires provider-specific functionality, the contract itself should be clarified or refined.