Remove DisplayName from the generic entitlement model#269
Conversation
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Removes DisplayName from IdLE’s provider-agnostic entitlement identity model so entitlements are identified strictly by Kind + Id, reducing ambiguity in matching/lookup semantics across providers, steps, tests, examples, and docs.
Changes:
- Updated AD, Entra ID, and Mock providers to stop parsing/emitting
DisplayNameon normalizedIdLE.Entitlementobjects (Entra ID retains provider-specificMail). - Updated built-in entitlement steps (EnsureEntitlement + PruneEntitlements*) to stop parsing/passing
DisplayName, and narrowedKeepPatternmatching toIdonly. - Updated tests, example workflows, and documentation/references to reflect the new entitlement shape.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Steps/Invoke-IdleStepPruneEntitlements.Tests.ps1 | Removes DisplayName from prune step test fixtures and keep entries. |
| tests/Steps/Invoke-IdleStepEnsureEntitlement.Tests.ps1 | Updates EnsureEntitlement test input entitlement to Kind + Id only. |
| tests/ProviderContracts/EntitlementProvider.Contract.ps1 | Updates entitlement contract fixture to omit DisplayName. |
| tests/Core/Test-IdleCondition.Tests.ps1 | Updates entitlement objects used in Condition DSL tests to omit DisplayName. |
| tests/Core/Get-IdlePropertyValue.Tests.ps1 | Replaces entitlement DisplayName extraction test with a Kind extraction test. |
| src/IdLE.Steps.Common/Public/Invoke-IdleStepPruneEntitlementsEnsureKeep.ps1 | Updates help text to remove DisplayName from Keep entry shape. |
| src/IdLE.Steps.Common/Public/Invoke-IdleStepPruneEntitlements.ps1 | Updates help text to remove DisplayName from Keep entry shape. |
| src/IdLE.Steps.Common/Public/Invoke-IdleStepEnsureEntitlement.ps1 | Stops parsing/passing DisplayName when normalizing step entitlement input. |
| src/IdLE.Steps.Common/Private/Test-IdlePruneEntitlementShouldKeep.ps1 | Removes KeepPattern matching against DisplayName (now Id only). |
| src/IdLE.Steps.Common/Private/ConvertTo-IdlePruneEntitlement.ps1 | Removes DisplayName normalization for prune Keep entries. |
| src/IdLE.Provider.Mock/Public/New-IdleMockIdentityProvider.ps1 | Removes DisplayName from mock entitlement seed data and normalization. |
| src/IdLE.Provider.EntraID/Public/New-IdleEntraIDIdentityProvider.ps1 | Stops emitting/copying entitlement DisplayName; keeps provider-specific Mail in list output. |
| src/IdLE.Provider.EntraID/Private/ConvertTo-IdleEntraIDEntitlement.ps1 | Updates normalization/help to drop DisplayName support (Mail remains). |
| src/IdLE.Provider.AD/Public/New-IdleADIdentityProvider.ps1 | Stops emitting/copying entitlement DisplayName for AD groups. |
| src/IdLE.Provider.AD/Private/ConvertTo-IdleADEntitlement.ps1 | Updates normalization/help to drop DisplayName support. |
| examples/workflows/templates/entraid-leaver.psd1 | Removes DisplayName from leaver Keep entry example. |
| examples/workflows/templates/ad-leaver.psd1 | Removes DisplayName from leaver Keep entry example. |
| docs/use/workflows/conditions.md | Removes DisplayName entitlement examples/paths; focuses on .Id member-access usage. |
| docs/reference/steps/step-prune-entitlements.md | Regenerated step reference to reflect updated Keep entry shape. |
| docs/reference/steps/step-prune-entitlements-ensure-keep.md | Regenerated step reference to reflect updated Keep entry shape. |
| docs/reference/steps/step-ensure-entitlement.md | Regenerated step reference to reflect updated entitlement input example. |
| docs/reference/providers/provider-mock.md | Updates provider reference to remove entitlement DisplayName field. |
| docs/reference/providers/provider-entraID.md | Updates provider reference to remove entitlement DisplayName field (Mail remains). |
| docs/reference/providers/provider-ad.md | Updates provider reference to remove entitlement DisplayName field. |
| docs/reference/capabilities.md | Updates entitlement list shape description to Kind + Id and notes provider-specific fields. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Code Coverage Report
|
blindzero
left a comment
There was a problem hiding this comment.
@copilot make sure that PSSA warnings are all resolved.
On destructive measures (e.g. removing unused vars), consult before removing. If it is 100% sure that a parameter or var is not used in may be removed there. Make very very sure.
Especially check all documentations and instructions if it is made clear that common warnings are not occuring in the future.
…ING.md Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Done in commits
No parameters or variables were removed. Repo-wide PSSA: 171 warnings (down from 175), 0 errors. All 841 tests pass. Also added a PSSA guidance table to |
…erence generator Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR removes DisplayName from the generic IdLE.Entitlement model so entitlements are identified deterministically by stable identifiers (Kind + Id), and updates providers/steps/tests/examples/docs accordingly while cleaning up PSScriptAnalyzer (PSSA) warnings.
Changes:
- Removed
DisplayNamefrom normalized entitlement objects across built-in steps and provider implementations (AD/EntraID/Mock) and updated pruning/normalization helpers accordingly. - Updated tests, examples, and documentation to reflect the reduced entitlement shape and the “Kind + Id” identity rule.
- Addressed PSSA issues (empty catch blocks, unused parameters, indentation/whitespace) and improved analyzer/tool robustness.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Invoke-IdleScriptAnalyzer.ps1 | Allows empty findings collections in summary output to prevent zero-results crashes. |
| tools/Generate-IdleStepReference.ps1 | Adds verbose logging in catch and updates autogenerated entitlement example to omit DisplayName. |
| tests/Steps/Invoke-IdleStepPruneEntitlements.Tests.ps1 | Updates prune/ensure-keep tests to use entitlements without DisplayName. |
| tests/Steps/Invoke-IdleStepEnsureEntitlement.Tests.ps1 | Updates EnsureEntitlement step tests to omit DisplayName. |
| tests/ProviderContracts/EntitlementProvider.Contract.ps1 | Updates provider contract test entitlement shape to Kind + Id only. |
| tests/Core/Test-IdleCondition.Tests.ps1 | Updates condition DSL fixtures to entitlement objects without DisplayName. |
| tests/Core/Get-IdlePropertyValue.Tests.ps1 | Updates member-access enumeration tests away from DisplayName examples. |
| src/IdLE.Steps.Common/Public/Invoke-IdleStepPruneEntitlementsEnsureKeep.ps1 | Updates help text to remove DisplayName mention for Keep entries. |
| src/IdLE.Steps.Common/Public/Invoke-IdleStepPruneEntitlements.ps1 | Updates help text to remove DisplayName mention for Keep entries. |
| src/IdLE.Steps.Common/Public/Invoke-IdleStepEnsureEntitlement.ps1 | Removes DisplayName from entitlement normalization in the step and updates examples. |
| src/IdLE.Steps.Common/Private/Test-IdlePruneEntitlementShouldKeep.ps1 | Removes DisplayName matching from KeepPattern logic (now Id-only). |
| src/IdLE.Steps.Common/Private/ConvertTo-IdlePruneEntitlement.ps1 | Normalizes keep entries to Kind + Id (no DisplayName). |
| src/IdLE.Provider.Mock/Public/New-IdleMockIdentityProvider.ps1 | Removes DisplayName from mock entitlements and normalization. |
| src/IdLE.Provider.EntraID/Public/New-IdleEntraIDIdentityProvider.ps1 | Removes DisplayName from entitlement outputs and normalization/resolve behavior. |
| src/IdLE.Provider.EntraID/Private/ConvertTo-IdleEntraIDEntitlement.ps1 | Updates converter docs/logic to no longer support DisplayName (keeps optional Mail). |
| src/IdLE.Provider.AD/Public/New-IdleADIdentityProvider.ps1 | Removes DisplayName from AD entitlement outputs and resolves; fixes PSSA unused-var/unused-param warnings. |
| src/IdLE.Provider.AD/Private/New-IdleADAdapter.ps1 | Adds/adjusts PSSA suppressions and fixes indentation/unused parameter warnings in adapter internals. |
| src/IdLE.Provider.AD/Private/ConvertTo-IdleADEntitlement.ps1 | Updates converter docs/logic to remove DisplayName support. |
| src/IdLE.Core/Private/Resolve-IdleTemplateString.ps1 | Adds PSSA suppression for nested-scriptblock parameter usage. |
| examples/workflows/templates/entraid-leaver.psd1 | Removes DisplayName from entitlement keep entries in example workflow. |
| examples/workflows/templates/ad-leaver.psd1 | Removes DisplayName from entitlement keep entries in example workflow. |
| docs/use/workflows/conditions.md | Removes DisplayName references from conditions/member-access guidance and examples. |
| docs/reference/steps/step-prune-entitlements.md | Updates generated step reference to remove DisplayName mention. |
| docs/reference/steps/step-prune-entitlements-ensure-keep.md | Updates generated step reference to remove DisplayName mention. |
| docs/reference/steps/step-ensure-entitlement.md | Updates generated step reference example to omit DisplayName. |
| docs/reference/providers/provider-mock.md | Removes DisplayName from documented normalized entitlement shape. |
| docs/reference/providers/provider-entraID.md | Removes DisplayName from documented output shape (retains provider-specific fields like Mail). |
| docs/reference/providers/provider-ad.md | Removes DisplayName from documented output shape. |
| docs/reference/capabilities.md | Updates entitlement list capability documentation to reflect Kind + Id core plus metadata/provider-specific fields. |
| CONTRIBUTING.md | Adds explicit PSSA remediation guidance patterns for contributors. |
DisplayNamefrom all provider/step/test/doc filesDisplayNameinGenerate-IdleStepReference.ps1example (line 687) → regenerated step reference docGenerate-IdleStepReference.ps1—PSAvoidUsingEmptyCatchBlockPSAvoidUsingPlainTextForPasswordfor$PasswordGenerationSpecialCharSetinNew-IdleADAdapter.ps1(SuppressMessageAttribute— false positive, parameter holds allowed characters not a password)PSReviewUnusedParameterfor$CurrentValueinNew-IdleADAdapter.ps1SetUserScriptMethod ($null = $CurrentValue)PSUseConsistentIndentationcascade (163 warnings) inNew-IdleADAdapter.ps1— root cause was multi-line pipeline withPipelineIndentation = IncreaseIndentationForFirstPipelineinside ScriptMethod not resetting depth; converted to single-line pipelinePSUseConsistentWhitespaceextra spaces around=onNew-IdleADAdapter.ps1line 834New-IdleADAdapter.ps1PSReviewUnusedParameterfor$RequestinResolve-IdleTemplateString.ps1(SuppressMessageAttribute— used inside nested scriptblock$resolvePath, PSSA cannot trace cross-scriptblock usage)Invoke-IdleScriptAnalyzer.ps1when PSSA finds 0 results — added[AllowEmptyCollection()]toWrite-PssaSummary's$FindingsparameterOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.