Skip to content

Name selector coerced to a stringified join item on 65 family-endpoint pairs #152

Description

Summary

65 cmdlet/parameter pairs bind a name-shaped selector against a family endpoint whose items are
join records
. A join item carries no name property -- its members are the objects being joined
(member, policy, and usually context) -- so the selector cannot bind by property name and the
PowerShell pipeline stringifies the entire object onto the wire instead.

This is the general fix issue that #90 said it would file. #90 is closed, but 101 pairs are still
waived inside Tests/Fixtures/PfbSelectorWaivers.psd1 pointing at it; this issue is the tracking
home for 65 of them.

Mechanism

A parameter declared ValueFromPipelineByPropertyName binds by looking for a property of the
matching name on the incoming object. Piping a join item supplies no name, so nothing binds by
name and the object itself becomes the value. The request then carries the stringified hashtable
as the selector:

BoundValue  @{context=; member=; policy=}
Evidence    names=@{context=; member=; policy=}   <- the names= prefix is the wire key

Three shape variants, all the same mechanism:

BoundValue rows
@{context=; member=; policy=} 124
@{member=; policy=} 21
@{context=; link=; member=; policy=} 5
total 150 across 65 pairs

@{member=; policy=} differs only in that those endpoints (/tls-policies/members,
/tls-policies/network-interfaces) predate the realm/context work and carry no context member.

Scope of exposure

Primary producers are unaffected. Every one of the 150 rows is a non-primary family endpoint;
zero primary producers coerce. Concretely:

Get-PfbWormPolicy | GET /worm-data-policies          | primary | Bound   | PROBE-name
Get-PfbWormPolicy | GET /worm-data-policies/members  |         | Coerced | @{context=; member=; policy=}

So Get-PfbWormPolicy -Name x is correct. The defect is reached only when a caller pipes items
from, or targets, the /members-style family endpoint.

Every row is classified Coerced rather than Bound -- the rail detects all 150. None is silently
mis-binding.

Affected pairs (65)

Get-PfbAdmin|Name, Get-PfbAdminCache|Name, Get-PfbAuditFileSystemPolicy|Name,
Get-PfbAuditObjectStorePolicy|Name, Get-PfbDataEvictionPolicy|Name,
Get-PfbDirectoryService|Name, Get-PfbDirectoryServiceRole|Name, Get-PfbFileLock|Name,
Get-PfbFileLockClient|Name, Get-PfbFileSystem|Name, Get-PfbFileSystemGroupPerformance|Name,
Get-PfbFileSystemSession|Name, Get-PfbFileSystemSnapshot|Name,
Get-PfbFileSystemSnapshotTransfer|Name, Get-PfbFileSystemStorageClass|Name,
Get-PfbFileSystemUserPerformance|Name, Get-PfbLocalDirectoryService|Name,
Get-PfbLocalGroup|Name, Get-PfbManagementAccessPolicy|Name, Get-PfbNetworkAccessPolicy|Name,
Get-PfbNetworkInterface|Name, Get-PfbNetworkInterfaceConnector|Name,
Get-PfbNetworkInterfaceConnectorPerformance|Name,
Get-PfbNetworkInterfaceConnectorSettings|Name, Get-PfbObjectStoreAccessPolicy|Name,
Get-PfbObjectStoreRole|Name, Get-PfbObjectStoreUser|Name, Get-PfbPolicy|Name,
Get-PfbPolicyAll|Name, Get-PfbQosPolicy|Name, Get-PfbSshCaPolicy|Name,
Get-PfbStorageClassTieringPolicy|Name, Get-PfbTlsPolicy|Name,
Get-PfbUserGroupQuotaPolicy|Name, Get-PfbUserGroupQuotaPolicyRule|PolicyName,
Get-PfbWormPolicy|Name, Remove-PfbAdminCache|Name, Remove-PfbAuditFileSystemPolicy|Name,
Remove-PfbAuditObjectStorePolicy|Name, Remove-PfbDataEvictionPolicy|Name,
Remove-PfbDirectoryServiceRole|Name, Remove-PfbFileLock|Name, Remove-PfbFileSystem|Name,
Remove-PfbFileSystemSession|Name, Remove-PfbFileSystemSnapshot|Name,
Remove-PfbFileSystemSnapshotTransfer|Name, Remove-PfbLocalGroup|Name,
Remove-PfbManagementAccessPolicy|Name, Remove-PfbNetworkAccessRule|Name,
Remove-PfbNetworkInterface|Name, Remove-PfbObjectStoreAccessPolicy|Name,
Remove-PfbObjectStoreAccessPolicyRule|Name, Remove-PfbObjectStoreRole|Name,
Remove-PfbObjectStoreTrustPolicyRule|Name, Remove-PfbObjectStoreUser|Name,
Remove-PfbPolicy|Name, Remove-PfbQosPolicy|Name, Remove-PfbSshCaPolicy|Name,
Remove-PfbStorageClassTieringPolicy|Name, Remove-PfbTlsPolicy|Name,
Remove-PfbUserGroupQuotaPolicy|Name, Remove-PfbWormPolicy|Name,
Update-PfbObjectStoreAccessPolicyRule|Name, Update-PfbObjectStoreRole|Name,
Update-PfbObjectStoreTrustPolicyRule|Name

Evidence

Reports/PfbPipelineSelectorMap.json, regenerated on the #141 branch. Filter results to
Outcome = 'Coerced' and a BoundValue containing both member= and policy=.

Get-PfbUserGroupQuotaPolicy|Name entered this set only at #141 -- that PR changed no cmdlet, it
taught the wire-name resolver an assignment shape it previously skipped, so the parameter resolved
for the first time and the pair became visible to the rail. The defect predates #141 and was
revealed by it, not introduced.

Relationship to existing issues

Not in scope

A further 37 pairs coerce for a different reason -- the target item has no name property but
is not a join record (alert/hardware records keyed on component_name, @{group=; member=}
membership items, realm/object-store records). Tracked separately in #153 so the two fixes are
not conflated.

Suggested fix direction

Not prescribed here. The options visible from the rail are: give the family endpoints' parameters
an explicit binding source rather than relying on property-name binding; or reject a non-scalar
selector at bind time so the failure is loud instead of a malformed request. Either way the 65
waivers in Tests/Fixtures/PfbSelectorWaivers.psd1 should be re-pointed at this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions