TenantAtlas/specs/112-list-expand-parity/quickstart.md
2026-02-26 00:48:25 +01:00

1.4 KiB

Quickstart — Graph Contracts: LIST $expand Parity Fix

Goal

Verify that LIST requests can forward explicit, allowlisted $expand, and that the Entra Admin Roles report requests principal so it can render real principal display names.

Run tests (focused)

From repo root (Sail-first):

  • vendor/bin/sail artisan test --compact tests/Unit/GraphContractRegistryTest.php
  • vendor/bin/sail artisan test --compact tests/Unit/MicrosoftGraphClientListPoliciesSelectTest.php
  • vendor/bin/sail artisan test --compact --filter=EntraAdminRoles

Manual verification (developer)

  • Ensure the entraRoleAssignments contract includes allowed_expand => ['principal'].
  • Ensure the role assignment LIST request includes $expand=principal when explicitly requested.

Usage examples

When listing a policy type where the contract allowlists principal:

  • listPolicies('entraRoleAssignments', [..., 'expand' => 'principal'])
  • listPolicies('entraRoleAssignments', [..., 'expand' => ['principal']])

Normalization behavior:

  • expand string input is split on top-level commas only (commas inside balanced parentheses are not separators) and trimmed.
  • Values not in the contract allowlist are dropped.
  • Max 10 allowlisted expansions are sent; extras are dropped.

Notes

  • No expansions are sent by default. Callers must pass expand explicitly.
  • Diagnostics are emitted when requested expands are removed or truncated.