Skip to content

Audit ServiceTypeByKey — add Ignored entries for newer Apple entitlements#326

Open
Badlazzor wants to merge 1 commit intofix/healthkit-access-entitlementfrom
audit/service-type-by-key
Open

Audit ServiceTypeByKey — add Ignored entries for newer Apple entitlements#326
Badlazzor wants to merge 1 commit intofix/healthkit-access-entitlementfrom
audit/service-type-by-key

Conversation

@Badlazzor
Copy link
Copy Markdown
Contributor

Stacked on #325 (fix/healthkit-access-entitlement). Merge that one first; then this PR's diff collapses to its own three entries.

Issue

Any iOS/macOS entitlement key that is not present in ServiceTypeByKey (autocodesign/devportalclient/appstoreconnect/capabilities.go) causes autocodesign.Entitlement.Capability() to return:

unknown entitlement key: <key>

That error propagates up through ProfileClient.SyncBundleIDautocodesign/profiles.go#ensureBundleID and aborts the entire automatic-code-signing phase with:

failed to manage code signing: failed to ensure code signing assets:
failed to ensure profiles: failed to update bundle ID capabilities:
unknown entitlement key: <key>

The map currently has 34 entries. Apple has added a number of entitlement keys since it was last extended (see current entitlements reference), and each such addition is a latent production break the moment a user project declares that key. #325 is the most recently reported instance (com.apple.developer.healthkit.access, iOS 17.5+).

Intent

Audit ServiceTypeByKey for entitlement keys that should be safely mapped to Ignored because they do not require App Store Connect registration (matching the existing treatment of e.g. com.apple.developer.icloud-container-identifiers). Flag keys that likely need a real CapabilityType mapping for maintainer review in a follow-up.

Changes

Three new Ignored entries — build/runtime entitlements, not App Store Connect-registrable:

Key Apple doc Why Ignored
com.apple.developer.kernel.extended-virtual-addressing link Build-time memory entitlement; no ASC capability
com.apple.developer.kernel.increased-memory-limit link Build-time memory entitlement; no ASC capability
com.apple.developer.authentication-services.credential-provider-ui link UI-hook companion to the already-mapped AutofillCredentialProvider capability; metadata-only

Plus a table-driven regression test (TestCapability_IgnoredKeys) covering both Capability() and AppearsOnDeveloperPortal() for each new key.

Intentionally out of scope

Flagging for maintainer decision — these likely need a real CapabilityType, not Ignored:

  • com.apple.developer.weatherkit — WeatherKit is a registrable service (appears under Services → WeatherKit in App Store Connect). Needs a new CapabilityType constant (e.g. WeatherKit) and a decision on whether the step should auto-register it.
  • com.apple.developer.matter.allow-setup-payload — Matter companion entitlement for HomePod/Apple TV setup payloads; ASC registration requirements unclear from public docs. Worth checking against the ASC API before classifying.

Anything else currently missing from the map that you'd like folded in here, happy to add — just flagging in review.

Follow-up

There is also a structural hardening worth considering — making Capability() warn-and-skip on unknown keys rather than hard-erroring — so a fresh Apple entitlement does not break every affected build until the allow-list catches up. Proposing that as a separate stacked PR after this one.

Test plan

  • go test ./autocodesign/...
  • go vet ./autocodesign/...
  • New TestCapability_IgnoredKeys passes for all three keys
  • Integration: build a target declaring kernel.increased-memory-limit via [email protected] after dep bump; confirm no unknown entitlement key error

🤖 Generated with Claude Code

Apple has added several entitlement keys since `ServiceTypeByKey` was
last extended. Any key missing from the map hard-errors
`Entitlement.Capability()` with `unknown entitlement key: …`, aborting
`SyncBundleID` / `ensureBundleID` during automatic code signing.

Adds three entries that are safe to treat as `Ignored` (do not appear
on the developer portal, no App Store Connect registration required):

- `com.apple.developer.kernel.extended-virtual-addressing`
- `com.apple.developer.kernel.increased-memory-limit`
- `com.apple.developer.authentication-services.credential-provider-ui`

Adds a regression test (`TestCapability_IgnoredKeys`) covering both
`Capability()` and `AppearsOnDeveloperPortal()` for each new key.

Out of scope (needs maintainer decision):
- `com.apple.developer.weatherkit` — WeatherKit is a registrable
  service in App Store Connect; likely needs a new `CapabilityType`
  constant, not `Ignored`.
- `com.apple.developer.matter.allow-setup-payload` — Matter support
  entitlement; ASC registration requirements unclear.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant