Conversation
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
…tion' Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
…o test Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Define supported attributes for AD provider and enforce validation
AD Provider: Enforce strict attribute validation with explicit contract
Feb 11, 2026
blindzero
approved these changes
Feb 11, 2026
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an explicit attribute allowlist (“contract”) for the AD identity provider and enforces strict, fail-fast validation so unsupported workflow attributes can’t be silently ignored.
Changes:
- Introduces
Get-IdleADAttributeContract+Test-IdleADAttributeContractand integrates validation intoCreateIdentity/EnsureAttribute. - Adds
OtherAttributespass-through support to the AD adapter for custom LDAP attributes duringCreateIdentity. - Updates tests, example workflow template, and AD provider documentation to reflect the new contract and strict behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Providers/ADIdentityProvider.Tests.ps1 | Adds strict-mode validation tests for supported/unsupported attributes and OtherAttributes typing. |
| tests/ProviderContracts/IdentityProvider.Contract.ps1 | Updates contract test to use a realistic attribute name for EnsureAttribute. |
| src/IdLE.Provider.AD/Public/New-IdleADIdentityProvider.ps1 | Runs attribute-contract validation before adapter calls; emits new observability events. |
| src/IdLE.Provider.AD/Private/Test-IdleADAttributeContract.ps1 | Implements strict validation + actionable error messages for unsupported attributes. |
| src/IdLE.Provider.AD/Private/Get-IdleADAttributeContract.ps1 | Defines the per-operation supported attribute allowlists. |
| src/IdLE.Provider.AD/Private/New-IdleADAdapter.ps1 | Passes OtherAttributes through to New-ADUser parameters when present. |
| examples/workflows/templates/ad-joiner-complete.psd1 | Demonstrates OtherAttributes usage in the AD joiner workflow template. |
| docs/reference/providers/provider-ad.md | Documents the attribute contracts, strict validation behavior, and new provider-emitted events. |
…ion in EnsureAttribute, and documentation fixes Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
blindzero
approved these changes
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AD Provider: Attribute Contract and Strict Validation ✅
Implementation Complete
This PR implements strict attribute validation for the AD Provider with fail-fast behavior on unsupported attributes, as specified in the issue.
What Changed
Core Implementation
New-ADUser -OtherAttributesTesting
Documentation
Code Review Feedback Addressed
AttributesRequestedand removed misleadingAppliedfieldKey Features
✅ Strict validation by default - Unsupported attributes cause immediate errors (no lenient mode)
✅ Clear error messages - Dynamic list of supported attributes from contract
✅ OtherAttributes support - Custom LDAP attributes can be set via hashtable in CreateIdentity
✅ Manager auto-resolution - Works in both CreateIdentity and EnsureAttribute (DN/GUID/UPN/sAMAccountName)
✅ Observability events - Tracks requested attributes
✅ No backward compatibility - Clean implementation for pre-1.0
Test Results
Original prompt
This section details on the original issue you should resolve
<issue_title>AD Provider: Define supported attributes (CreateIdentity vs EnsureAttribute) and enforce strict validation</issue_title>
<issue_description>## Summary
Define and document the supported attribute contract for the AD provider, split by operation:
CreateIdentity(internallyNew-ADUser)EnsureAttribute(internallySet-ADUser/-Replace/ dedicated parameters)Then enforce strict fail-fast validation so unsupported/unknown attributes cannot be silently ignored.
This addresses the current situation where attributes provided in workflows may not be applied (because the provider adapter maps only a subset of keys), yet execution appears successful.
Motivation
Current behavior (problem)
IdLE.Provider.AD, user creation builds a parameter hashtable forNew-ADUserfrom a hard-coded mapping list.New-ADUserand are therefore silently ignored.Additionally, AD cmdlet support differs between:
New-ADUsersupported parametersSet-ADUsersupported parameters-Add/-Replace/-ClearSo we need an explicit contract to avoid surprise behavior and inconsistencies between steps.
Goals
CreateIdentityEnsureAttributeNon-Goals
Managerresolution/format across steps (tracked in a dedicated issue).Proposed Design
1) Attribute contract definition
Introduce two allowlists (per provider):
AD.CreateIdentity.SupportedAttributesAD.EnsureAttribute.SupportedAttributesEach list contains the workflow-facing attribute keys that IdLE accepts.
For each supported key, define:
-Replace/-Addusage, and2) Strict validation (default)
During planning/execution, validate provided attribute keys:
CreateIdentity: validateWith.Attributeskeys againstAD.CreateIdentity.SupportedAttributesplus the reserved containerOtherAttributes.EnsureAttribute: validate the requested attribute key(s) againstAD.EnsureAttribute.SupportedAttributes.If unsupported keys are present:
OtherAttributes(CreateIdentity only)”3) Optional lenient mode (temporary)
Provide a provider option (default strict):
AttributeValidationMode = 'Strict' | 'Lenient'StrictIn
Lenient:This is an escape hatch for existing workflows and should be documented as deprecated once adoption is complete.
4) Observability
Emit events during execution:
Provider.AD.CreateIdentity.AttributesAppliedProvider.AD.EnsureAttribute.AttributesAppliedPayload (example):
Requested: list of keysApplied: list of keysIgnored: list of keys (strict: empty)OtherAttributes (CreateIdentity only)
CreateIdentitysupports a dedicated container:OtherAttributesmust be a hashtable.(Implementation details are covered in this issue only as part of contract + validation. The actual pass-through to
New-ADUser -OtherAttributesmust be included in this work if not already implemented.)Implementation Notes (current code locations)
src/IdLE.Provider.AD/Public/New-IdleADIdentityProvider.ps1(CreateIdentity,EnsureAttribute)src/IdLE.Provider.AD/Private/New-IdleADAdapter.ps1(NewUser,SetUser)Acceptance Criteria
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.