Skip to content

Comments

feat: Code Signing on macOS#139

Merged
iamEvanYT merged 7 commits intomainfrom
evan/mac-code-signing
Jul 4, 2025
Merged

feat: Code Signing on macOS#139
iamEvanYT merged 7 commits intomainfrom
evan/mac-code-signing

Conversation

@iamEvanYT
Copy link
Member

@iamEvanYT iamEvanYT commented Jul 4, 2025

Summary by CodeRabbit

  • New Features
    • Expanded macOS app permissions, including access to audio input, Bluetooth, camera, printing, USB, location, screen recording, and enhanced file access.
  • Chores
    • Improved macOS build and notarization process by updating environment variable usage and automating API key handling for Apple services.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 4, 2025

Walkthrough

The changes rename the Apple API key environment variable in the macOS build workflow, update the macOS entitlements plist with new permissions, add a new module to create a temporary notarization API key file from the renamed environment variable, and invoke this module during the macOS after-pack build step. No public API signatures were changed.

Changes

File(s) Change Summary
.github/workflows/build-and-release.yml Renamed Apple API key environment variable from APPLE_API_KEY to APPLE_API_KEY_DATA for macOS build steps.
build/entitlements.mac.plist Added new application identifier and expanded security entitlements for device, personal info, screen, and file access.
build/hooks/afterPack.js Added macOS-specific call to createNotarizationApiKeyFile() after VMP signing.
build/hooks/components/notarization.js New module exporting createNotarizationApiKeyFile to create a temp .p8 file from APPLE_API_KEY_DATA and set APPLE_API_KEY.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow
    participant afterPack.js
    participant notarization.js
    participant OS

    Workflow->>afterPack.js: Run handler (macOS)
    afterPack.js->>notarization.js: createNotarizationApiKeyFile()
    notarization.js->>OS: Check APPLE_API_KEY_DATA env var
    alt APPLE_API_KEY_DATA exists
        notarization.js->>OS: Write temp .p8 file with key data
        notarization.js->>OS: Set APPLE_API_KEY env var to temp file path
        notarization.js-->>afterPack.js: Success
    else APPLE_API_KEY_DATA missing
        notarization.js-->>afterPack.js: Log "No API key found"
    end
    afterPack.js->>Workflow: Continue build process
Loading

Poem

A rabbit hops through code so neat,
With notarization now complete.
Entitlements grow, permissions bloom,
API keys in temp files loom.
macOS builds, a secret stashed—
In every hop, security's dashed!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea172ec and 2ddc176.

📒 Files selected for processing (1)
  • build/hooks/components/notarization.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • build/hooks/components/notarization.js
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: build (windows-latest)
  • GitHub Check: build (macos-13)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (ubuntu-24.04-arm)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2025

Build artifacts for all platforms are ready! 🚀

Download the artifacts from:

(execution 16078195145 / attempt 1)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
build/hooks/components/notarization.js (1)

14-22: Consider cleanup mechanism for temporary files.

The temporary API key files are created but never cleaned up, which could lead to accumulation of sensitive data on the file system. Consider implementing a cleanup mechanism.

You might want to add a cleanup function or use a process exit handler to remove the temporary files. Would you like me to suggest an implementation for cleaning up these temporary files?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f514f45 and ea172ec.

📒 Files selected for processing (4)
  • .github/workflows/build-and-release.yml (1 hunks)
  • build/entitlements.mac.plist (2 hunks)
  • build/hooks/afterPack.js (2 hunks)
  • build/hooks/components/notarization.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: build (windows-latest)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: build (ubuntu-24.04-arm)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (macos-13)
🔇 Additional comments (5)
.github/workflows/build-and-release.yml (1)

99-99: LGTM: Environment variable rename aligns with new notarization process.

The change from APPLE_API_KEY to APPLE_API_KEY_DATA properly supports the new workflow where the raw API key data is provided and a temporary file is created during the build process.

build/entitlements.mac.plist (2)

5-6: LGTM: Application identifier correctly specified.

The application identifier follows the correct format for macOS apps and aligns with the developer account.


15-32: Audit Broad macOS Entitlements

I scanned the codebase for APIs corresponding to each newly granted entitlement and found no matches for:

• Camera & Audio (AVCaptureDevice, AVAudioSession)
• Location (CLLocationManager, requestWhenInUseAuthorization, requestAlwaysAuthorization)
• Bluetooth (CoreBluetooth, CBCentralManager)
• Screen Recording (CGWindowListCreateImage, RPScreenRecorder)
• USB/Device Access (IOKit, USBDevice)

Please manually verify whether your app truly requires each of these permissions. If any aren’t in active use, remove them to adhere to the principle of least privilege.

build/hooks/afterPack.js (1)

2-2: LGTM: Import statement correctly added.

The import for the new notarization module is properly structured.

build/hooks/components/notarization.js (1)

1-5: LGTM: Module imports are appropriate.

The necessary Node.js modules are correctly imported for file operations, path handling, OS utilities, and cryptographic functions.

@iamEvanYT iamEvanYT merged commit b88fe8c into main Jul 4, 2025
10 checks passed
@iamEvanYT iamEvanYT deleted the evan/mac-code-signing branch July 4, 2025 17:22
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