fix: throw when MAS entitlements are missing app-sandbox key#432
Open
claude[bot] wants to merge 1 commit into
Open
fix: throw when MAS entitlements are missing app-sandbox key#432claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
Mac App Store builds require the `com.apple.security.app-sandbox` entitlement. When it is missing, the app signs successfully but is silently rejected by the App Store, which is difficult to diagnose. Enforce the entitlement on the top-level app bundle for `mas` builds so the problem surfaces as a hard error at sign time. Fixes #60 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gqh2zDxQvkcf6euoDUDx81
MarshallOfSound
approved these changes
Jul 1, 2026
MarshallOfSound
marked this pull request as ready for review
July 1, 2026 05:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Samuel Attard · Slack thread
Fixes #60
Before
When signing a Mac App Store (
mas) build with a user-supplied entitlements file that is missing thecom.apple.security.app-sandboxkey,@electron/osx-signwould sign the app successfully. The problem only surfaced later: the App Store silently rejects any submission that does not declare the app sandbox, and there was no signal at sign time pointing at the missing entitlement, making the failure very hard to diagnose.After
For
masbuilds,@electron/osx-signnow validates the entitlements file used to sign the top-level app bundle. Ifcom.apple.security.app-sandboxis missing (or disabled), signing fails immediately with a clear, actionable error explaining that the entitlement is required and that its absence causes a silent App Store rejection. Non-MAS (darwin/ Developer ID) builds are unaffected.How
A new
ensureAppSandboxEntitlementhelper insrc/util-entitlements.tsparses the resolved entitlements plist and throws whencom.apple.security.app-sandboxis falsey. It is invoked fromsignApplicationinsrc/sign.tsfor the top-level app bundle only whenplatform === 'mas', so the check runs against the entitlements the user actually supplied (or the MAS defaults) before any entitlements automation. Unit tests cover the missing, disabled, and enabled cases.Generated by Claude Code