Repository navigation
Description
Description
Add Set-SafeguardAccessPolicyAccessRequestProperty to replace the complete AccessRequestProperties subobject independently of other policy fields. Include SessionAccessAccounts convenience resolution for interactive asset-scoped policy configuration.
Acceptance criteria
- Accept standard session parameters, policy ID/name resolution, and a mandatory API-shaped
AccessRequestPropertiesobject matching the existing getter's output. - Fetch the complete policy, replace only AccessRequestProperties, and use the established full-policy PUT. This is subobject replacement, not an implicit per-property merge; preserve ScopeItems, ApproverProperties, ApproverSets, SessionProperties, and other policy fields.
- Preserve the entire supplied API-supported shape rather than projecting a partial field list. Document current fields: AccessRequestType, SessionAccessAccountType, SessionAccessAccounts, AllowLinkedAccountPasswordAccess, AllowSimultaneousAccess, MaximumSimultaneousReleases, ChangePasswordAfterCheckin, ChangeSshKeyAfterCheckin, IncludePasswordRelease, IncludeSshKeyRelease, TerminateExpiredSessions, PassphraseProtectSshKey, UseAltLoginName, and LinkedAccountScopeFiltering.
- Add optional
SessionAccessAccountsaccepting account IDs, resolvable names, or asset\account references; resolve through existing Resolve-SafeguardPolicyAccountId. When explicitly supplied, set SessionAccessAccountType=PolicySpecific and override the supplied object's session-account list. Explicit empty arrays clear the list; omission leaves the supplied object unchanged. - Document asset\account as the reliable name form when account names are not globally unique. Do not add supporting lookup cmdlets.
- Reject null/malformed input explicitly, preserve false/empty values, and surface API validation errors normally. Leave existing Add/Edit parameter behavior unchanged.
- Add help/examples describing full replacement, mandatory object input, convenience precedence and clearing, and export the new cmdlet.
Regression coverage
Cover full supported object payloads, invalid shapes, false/empty values, reference resolution and ambiguity, asset-qualified names, empty-list clearing, object-plus-convenience precedence, preservation of unrelated policy data, and unchanged Add/Edit behavior.
Existing implementation
Getter and current mappings are in src/policies.psm1:702–735, 1328–1356, 1768–1798; session-account resolution/type mapping is at 1332–1341 and 1774–1783, and full-policy PUT at 1856. The historical single-field update question in #530 is related but not the same operation.
Activity