Skip to content

fix: throw when MAS entitlements are missing app-sandbox key#432

Open
claude[bot] wants to merge 1 commit into
mainfrom
fix/mas-entitlements-app-sandbox
Open

fix: throw when MAS entitlements are missing app-sandbox key#432
claude[bot] wants to merge 1 commit into
mainfrom
fix/mas-entitlements-app-sandbox

Conversation

@claude

@claude claude Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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 the com.apple.security.app-sandbox key, @electron/osx-sign would 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 mas builds, @electron/osx-sign now validates the entitlements file used to sign the top-level app bundle. If com.apple.security.app-sandbox is 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 ensureAppSandboxEntitlement helper in src/util-entitlements.ts parses the resolved entitlements plist and throws when com.apple.security.app-sandbox is falsey. It is invoked from signApplication in src/sign.ts for the top-level app bundle only when platform === '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

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
MarshallOfSound marked this pull request as ready for review July 1, 2026 05:52
@MarshallOfSound
MarshallOfSound requested a review from a team as a code owner July 1, 2026 05:52
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.

Check com.apple.security.app-sandbox in user provided entitlements file

2 participants