Skip to content

fix(macos): support file-based notarization keychains - #94

Merged
tarwin merged 1 commit into
tarwin:mainfrom
9wick:fix/notarize-keychain
Nov 15, 2026
Merged

tarwin merged 1 commit into
tarwin:mainfrom
9wick:fix/notarize-keychain

Conversation

@9wick

@9wick 9wick commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

tinyjs notarize currently passes --keychain-profile to notarytool, but provides no way to select a file-based keychain. A profile stored only in an unlocked file-based keychain therefore cannot be found through the default data protection keychain lookup, even though it works when passed directly to notarytool with --keychain.

This adds optional notarize.keychain and TINYJS_NOTARY_KEYCHAIN settings. A configured path is forwarded as a single --keychain argument, with the environment variable taking precedence. Omitting the setting, or using null or an empty string, preserves the existing command. Configuration docs and the JSON Schema are updated as well.

Example:

{
  "notarize": {
    "profile": "notary-profile",
    "keychain": "ci.keychain-db"
  }
}

Verified on macOS 26.4.1 arm64 with notarytool 1.1.1 (40) and txiki.js 26.6.0:

  • A profile stored only in a file-based keychain works with explicit --keychain and is not found without it.
  • A project-relative keychain path containing spaces completes notarization with Accepted, followed by successful stapling and stapler validate.
  • An absolute path supplied through TINYJS_NOTARY_KEYCHAIN overrides an invalid config path and completes notarization and stapling. Missing and locked keychains surface errors.
  • With no keychain setting or environment override, a separate profile in the data protection keychain still completes notarization, stapling, and validation.

Automated checks: node test/notarize/check.mjs (10 cases covering config precedence, omitted/null/empty values, and paths with spaces or Unicode), node --check cli.js, and python3 test/config-schema/coverage.py. The keychain-selection regression case also fails against the previous CLI. Verification results are recorded in TODO-verify.md.

- Add notarize.keychain and TINYJS_NOTARY_KEYCHAIN support
- Document setup and cover notarytool arguments with a check script
@tarwin

tarwin commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thanks @9wick I'll get onto this ASAP

@tarwin
tarwin merged commit fd580f2 into tarwin:main Nov 15, 2026
tarwin added a commit that referenced this pull request Nov 15, 2026
@tarwin

tarwin commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Merged and released in v0.74.0. Thank you @9wick, this was a really clean PR: small change, thorough docs and schema, a test that runs the real CLI, and a careful write-up of what you checked against Apple. It's credited in the changelog.

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.

2 participants