Audit ServiceTypeByKey — add Ignored entries for newer Apple entitlements#326
Audit ServiceTypeByKey — add Ignored entries for newer Apple entitlements#326Badlazzor wants to merge 1 commit into
Conversation
| ParentApplicationIdentifierEntitlementKey: Ignored, | ||
| "com.apple.developer.icloud-container-identifiers": Ignored, | ||
| "com.apple.developer.ubiquity-container-identifiers": Ignored, | ||
| "com.apple.developer.healthkit.access": Ignored, |
There was a problem hiding this comment.
I wasn't able to log in to the Developer Portal because our legal agreement is out of date, but are you sure Healthkit can be ignored? See: https://developer.apple.com/documentation/Xcode/adding-capabilities-to-your-app#Perform-additional-configuration-steps
There was a problem hiding this comment.
Good check. Ben — the ASC-registrable capability is com.apple.developer.healthkit (line 60, already mapped to Healthkit). The .access subkey is a build/runtime array declaring which HealthKit data classes (e.g. health-records) the app accesses; the ASC registration itself sits on the parent key. That's why Apple's doc you linked flags additional configuration for the capability parent, not the .access subkey.
That entry actually came in on #325 (already merged); it's showing in this PR's context lines around the new adds. Happy to file a follow-up if you'd prefer the .access variant treated as its own ASC-registrable capability, but I don't see evidence in the ASC docs/portal that it is.
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.
6ee72be to
789e080
Compare
Issue
Any iOS/macOS entitlement key that is not present in
ServiceTypeByKey(autocodesign/devportalclient/appstoreconnect/capabilities.go) causesautocodesign.Entitlement.Capability()to return:That error propagates up through
ProfileClient.SyncBundleID→autocodesign/profiles.go#ensureBundleIDand aborts the entire automatic-code-signing phase with: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
ServiceTypeByKeyfor entitlement keys that should be safely mapped toIgnoredbecause 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 realCapabilityTypemapping for maintainer review in a follow-up.Changes
Three new
Ignoredentries — build/runtime entitlements, not App Store Connect-registrable:com.apple.developer.kernel.extended-virtual-addressingcom.apple.developer.kernel.increased-memory-limitcom.apple.developer.authentication-services.credential-provider-uiAutofillCredentialProvidercapability; metadata-onlyPlus a table-driven regression test (
TestCapability_IgnoredKeys) covering bothCapability()andAppearsOnDeveloperPortal()for each new key.Intentionally out of scope
Flagging for maintainer decision — these likely need a real
CapabilityType, notIgnored:com.apple.developer.weatherkit— WeatherKit is a registrable service (appears under Services → WeatherKit in App Store Connect). Needs a newCapabilityTypeconstant (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/...TestCapability_IgnoredKeyspasses for all three keyskernel.increased-memory-limitviaxcode-archive@6.xafter dep bump; confirm nounknown entitlement keyerror🤖 Generated with Claude Code