Skip to content

Fix macOS release launch entitlement#252

Merged
arul28 merged 1 commit into
mainfrom
release/v1.1.11-mac-entitlement-fix
May 5, 2026
Merged

Fix macOS release launch entitlement#252
arul28 merged 1 commit into
mainfrom
release/v1.1.11-mac-entitlement-fix

Conversation

@arul28
Copy link
Copy Markdown
Owner

@arul28 arul28 commented May 5, 2026

Summary

  • remove the unprovisioned macOS keychain-access-groups entitlement from the Developer ID app
  • leave Touch ID WebAuthn disabled by default unless ADE_ENABLE_TOUCH_ID_WEBAUTHN is explicitly set
  • keep the built-in browser session WebAuthn account chooser registration intact

Validation

  • npm --prefix apps/desktop run test -- src/main/services/builtInBrowser/builtInBrowserWebAuthn.test.ts --reporter=verbose
  • npm --prefix apps/desktop run typecheck
  • npm --prefix apps/desktop run release:mac:local -- v1.1.11 --zip-only
  • npm --prefix apps/desktop run lint (0 errors, existing warnings only)

Release note

Desktop release pipeline fix only; no changelog update needed.

Summary by CodeRabbit

  • Tests
    • Added and updated Touch ID WebAuthn configuration tests.
  • Chores
    • Updated macOS security entitlements.
    • Added conditional gating for Touch ID WebAuthn support.

Greptile Summary

This PR fixes the macOS Developer ID release pipeline by removing an unprovisioned keychain-access-groups entitlement from the plist and gating the app.configureWebAuthn() Touch ID call behind an explicit ADE_ENABLE_TOUCH_ID_WEBAUTHN env var. The built-in browser session WebAuthn account-chooser (the select-webauthn-account handler) is preserved unchanged.

Confidence Score: 4/5

Safe to merge — all findings are P2; the fix is targeted and the core WebAuthn session handler is untouched.

No P0 or P1 issues found. Three P2 observations: a misleading debug log reason string, a silent-failure risk when the env flag is set in a build without the entitlement, and a platform-guarded test assertion that is skipped on Linux CI. None of these block the stated release-pipeline fix.

Minor attention to the env-var/entitlement pairing across entitlements.mac.plist and builtInBrowserWebAuthn.ts.

Important Files Changed

Filename Overview
apps/desktop/build/entitlements.mac.plist Removes unprovisioned keychain-access-groups entitlement; correct fix for the release-pipeline failure, but the env-var escape hatch silently fails without the entitlement.
apps/desktop/src/main/services/builtInBrowser/builtInBrowserWebAuthn.ts Adds isTouchIdWebAuthnEnabled() flag and gates app.configureWebAuthn behind it; debug log reason string is misleading.
apps/desktop/src/main/services/builtInBrowser/builtInBrowserWebAuthn.test.ts Adds env-var setup/teardown and a new test for the enabled case; Darwin-specific guard means the key assertion is skipped on Linux CI.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[configureBuiltInBrowserWebAuthn called] --> B{already configured?}
    B -- yes --> Z[return]
    B -- no --> C[set configured = true]
    C --> D{platform === darwin?}
    D -- no --> G
    D -- yes --> E{ADE_ENABLE_TOUCH_ID_WEBAUTHN set?}
    E -- yes --> F[app.configureWebAuthn with keychainAccessGroup]
    F --> F1{success?}
    F1 -- yes --> G
    F1 -- no --> F2[log warn: webauthn_configure_failed] --> G
    E -- no --> H[log debug: webauthn_touchid_disabled] --> G
    G[session.fromPartition 'persist:ade-browser']
    G --> I[register select-webauthn-account handler]
Loading

Comments Outside Diff (2)

  1. apps/desktop/src/main/services/builtInBrowser/builtInBrowserWebAuthn.test.ts, line 102-115 (link)

    P2 Darwin-specific assertion never runs on Linux CI

    The expect(fakes.app.configureWebAuthn).toHaveBeenCalledWith(…) assertion is inside if (process.platform === "darwin"), so on any Linux runner only the else branch executes — the critical check that the right keychainAccessGroup is passed is skipped. The module mock already stubs electron, so the assertion is safe to run unconditionally on all platforms. Removing the platform guard would give full coverage everywhere.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/desktop/src/main/services/builtInBrowser/builtInBrowserWebAuthn.test.ts
    Line: 102-115
    
    Comment:
    **Darwin-specific assertion never runs on Linux CI**
    
    The `expect(fakes.app.configureWebAuthn).toHaveBeenCalledWith(…)` assertion is inside `if (process.platform === "darwin")`, so on any Linux runner only the `else` branch executes — the critical check that the right `keychainAccessGroup` is passed is skipped. The module mock already stubs `electron`, so the assertion is safe to run unconditionally on all platforms. Removing the platform guard would give full coverage everywhere.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Claude Code

  2. apps/desktop/build/entitlements.mac.plist, line 1-10 (link)

    P2 Env-var opt-in silently fails without the entitlement

    The keychain-access-groups entitlement was removed, but the runtime code still accepts the env flag to call app.configureWebAuthn(). In a Developer ID-signed build the OS will reject the keychain access group request because the entitlement is absent; the try/catch swallows the error and only logs a warning, so a developer who sets the flag expecting Touch ID to work will see silent failure. Consider adding a comment in the plist (or in the source) noting that the entitlement must be re-added alongside the feature flag, or remove the env-var path entirely until the entitlement is properly provisioned.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/desktop/build/entitlements.mac.plist
    Line: 1-10
    
    Comment:
    **Env-var opt-in silently fails without the entitlement**
    
    The `keychain-access-groups` entitlement was removed, but the runtime code still accepts the env flag to call `app.configureWebAuthn()`. In a Developer ID-signed build the OS will reject the keychain access group request because the entitlement is absent; the try/catch swallows the error and only logs a warning, so a developer who sets the flag expecting Touch ID to work will see silent failure. Consider adding a comment in the plist (or in the source) noting that the entitlement must be re-added alongside the feature flag, or remove the env-var path entirely until the entitlement is properly provisioned.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Claude Code

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
apps/desktop/src/main/services/builtInBrowser/builtInBrowserWebAuthn.ts:46-51
**Misleading debug log reason string**

The `reason` field says `"missing_provisioned_keychain_access_group"`, but the access group constant is still defined in the code — the feature is disabled intentionally via the absent env var. A reader looking at this log in production would search for a provisioning issue that doesn't exist. A value like `"touch_id_not_enabled"` or `"env_var_not_set"` more accurately describes why this path was taken.

### Issue 2 of 3
apps/desktop/src/main/services/builtInBrowser/builtInBrowserWebAuthn.test.ts:102-115
**Darwin-specific assertion never runs on Linux CI**

The `expect(fakes.app.configureWebAuthn).toHaveBeenCalledWith(…)` assertion is inside `if (process.platform === "darwin")`, so on any Linux runner only the `else` branch executes — the critical check that the right `keychainAccessGroup` is passed is skipped. The module mock already stubs `electron`, so the assertion is safe to run unconditionally on all platforms. Removing the platform guard would give full coverage everywhere.

### Issue 3 of 3
apps/desktop/build/entitlements.mac.plist:1-10
**Env-var opt-in silently fails without the entitlement**

The `keychain-access-groups` entitlement was removed, but the runtime code still accepts the env flag to call `app.configureWebAuthn()`. In a Developer ID-signed build the OS will reject the keychain access group request because the entitlement is absent; the try/catch swallows the error and only logs a warning, so a developer who sets the flag expecting Touch ID to work will see silent failure. Consider adding a comment in the plist (or in the source) noting that the entitlement must be re-added alongside the feature flag, or remove the env-var path entirely until the entitlement is properly provisioned.

Reviews (1): Last reviewed commit: "fix: remove unprovisioned mac keychain e..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored May 5, 2026 1:53am

@capy-ai
Copy link
Copy Markdown

capy-ai Bot commented May 5, 2026

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

📝 Walkthrough

Walkthrough

This PR implements an environment variable gate for Touch ID WebAuthn on macOS. The implementation adds a conditional check that reads ADE_ENABLE_TOUCH_ID_WEBAUTHN from environment variables before configuring WebAuthn, and updates macOS security entitlements accordingly.

Changes

Touch ID WebAuthn Environment Gate

Layer / File(s) Summary
macOS Security Entitlements
apps/desktop/build/entitlements.mac.plist
Adds com.apple.security.cs.allow-jit and com.apple.security.cs.disable-library-validation entitlements (both true); removes the keychain-access-groups entitlement block.
Environment Gate Function
apps/desktop/src/main/services/builtInBrowser/builtInBrowserWebAuthn.ts
Adds isTouchIdWebAuthnEnabled() function that checks ADE_ENABLE_TOUCH_ID_WEBAUTHN, accepting "1" or "true" (case-insensitive).
Conditional WebAuthn Configuration
apps/desktop/src/main/services/builtInBrowser/builtInBrowserWebAuthn.ts
Wraps macOS Touch ID WebAuthn configuration behind the gate; skips app.configureWebAuthn() and logs a debug message when disabled.
Test Lifecycle and Assertions
apps/desktop/src/main/services/builtInBrowser/builtInBrowserWebAuthn.test.ts
Manages ADE_ENABLE_TOUCH_ID_WEBAUTHN lifecycle across test cases (save, clear, restore); adds assertions that configureWebAuthn is not called when disabled, and verifies correct invocation when enabled on macOS.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

desktop

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix macOS release launch entitlement' directly addresses the main change: removing an unprovisioned keychain-access-groups entitlement from the macOS Developer ID app configuration, which aligns with the primary objective of fixing a macOS release issue.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/v1.1.11-mac-entitlement-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines +46 to 51
} else if (process.platform === "darwin") {
logger()?.debug("built_in_browser.webauthn_touchid_disabled", {
reason: "missing_provisioned_keychain_access_group",
keychainAccessGroup: BUILT_IN_BROWSER_WEBAUTHN_KEYCHAIN_ACCESS_GROUP,
});
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Misleading debug log reason string

The reason field says "missing_provisioned_keychain_access_group", but the access group constant is still defined in the code — the feature is disabled intentionally via the absent env var. A reader looking at this log in production would search for a provisioning issue that doesn't exist. A value like "touch_id_not_enabled" or "env_var_not_set" more accurately describes why this path was taken.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/main/services/builtInBrowser/builtInBrowserWebAuthn.ts
Line: 46-51

Comment:
**Misleading debug log reason string**

The `reason` field says `"missing_provisioned_keychain_access_group"`, but the access group constant is still defined in the code — the feature is disabled intentionally via the absent env var. A reader looking at this log in production would search for a provisioning issue that doesn't exist. A value like `"touch_id_not_enabled"` or `"env_var_not_set"` more accurately describes why this path was taken.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

@arul28 arul28 merged commit 6ff0ee9 into main May 5, 2026
24 checks passed
@arul28 arul28 deleted the release/v1.1.11-mac-entitlement-fix branch May 8, 2026 03:21
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