Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
rahul05ranjan
left a comment
There was a problem hiding this comment.
Static review only — no Swift toolchain on my machine, so I traced the code paths rather than running anything.
The change is minimal — registering AssociatedDomainsEntitlement in supportedTypes (EntitlementTypes.swift:20) plus a regression test — but I checked what that registration actually unlocks, and it fixes a real gap:
- Before this,
com.apple.developer.associated-domainsfell through as an unrecognized key.Entitlements.entitlements()(Entitlements.swift:29-33) only returns parsed entitlements, soupsertApp'swantedCapabilities(DeveloperServicesAddAppOperation.swift:88) never saw it. The App ID then gets created without the ASSOCIATED_DOMAINS capability while the binary still carries the entitlement, so the dev profile doesn't grant it and installd rejects the install with the generic 0xe8008015. Presumably that's the user-visible breakage motivating this. - The free-team path (DeveloperServicesAddAppOperation.swift:182) now filters it out via
anyCapability?.isFree != false, consistent withisFree: falsein the capability mapping (DeveloperServicesCapability.swift:82-86). That matches Apple requiring a paid membership for associated domains. For what it's worth, the pre-PR behavior there was coincidentally the same — the free path rebuilds from parsed entitlements only, so the unparsed key was dropped anyway — so no regression. - The type was already fully wired up — identifier,
[String]codec (EntitlementTypes.swift:87-100), and capability mapping — and.associatedDomainsexists in the generated schema (DeveloperAPI/Generated/Types.swift:6743). Values pass through verbatim with no domain-format validation, which I'd say is fine since Apple validates at provisioning time.
Two things I'd like to see addressed before merge:
-
The line was commented out long before this repo existed — it predates the entitlements cleanup in #165 and even the libSupersign -> XKit rename, and
NetworkExtensionEntitlementright below it is still disabled, which suggests these slots were commented out deliberately rather than left as TODOs. If there was a concrete reason (some API failure mode with the capability enabled), it would be good to confirm it no longer applies. The PR body doesn't mention it. -
The test covers the registration round-trip well, but not the consumer paths that motivated the change: nothing asserts
upsertApp's capability list picks it up, or that the free-team filter drops it. A small test on theisFree != falsefilter would lock in the free-account semantics — though I understand that needs API mocking and may belong elsewhere.
One ordering note with #324: its EntitlementsReconciler.knownKeys derives from EntitlementContainer.supportedTypes, so once this merges, associated-domains becomes a profile-checked entitlement there too. The two compose cleanly, but until #324 lands, nothing verifies the fetched profile actually grants this entitlement — relevant for App Store Connect API key sessions where capability creation can silently under-deliver (its doc comment mentions this for app groups).
|
Thanks for the careful review — both points are fair. I checked the history, and I’ll add coverage for the capability list/filter behavior and document the historical context. The interaction with #324 also makes sense: once this is registered, its reconciler will recognize the entitlement when that change lands. |
What does this PR do?
Enables xtool to recognize and provision the
com.apple.developer.associated-domainsentitlement when generating development provisioning profiles. Adds regression coverage for capability mapping and plist encoding.How was it tested?
swift test --jobs 2 --build-path /tmp/xtool-associated-domains-cli-build-4 --filter associatedDomainsEntitlementMapsToDeveloperCapabilityon Linux.AI tool usage
Summary by CodeRabbit