Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@ final class ManagementAuthenticationProcessTests: AskKeyAppTestCase {
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundleName</key><string>AskKey</string>
<key>CFBundleDisplayName</key><string>AskKey</string>
<key>CFBundleName</key><string>Ask Key</string>
<key>CFBundleDisplayName</key><string>Ask Key</string>
<key>LSHasLocalizedDisplayName</key><true/>
<key>CFBundleDevelopmentRegion</key><string>en</string>
<key>CFBundleExecutable</key><string>AskKeyApp</string>
<key>CFBundleIdentifier</key><string>com.sudohg.askkey.auth-test</string>
<key>CFBundlePackageType</key><string>APPL</string>
Expand Down
41 changes: 41 additions & 0 deletions Tests/Automation/test_app_info_plist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""Validate the app's display-name plist without invoking the build script."""

from pathlib import Path
import plistlib
import re
import subprocess
import tempfile
import unittest

ROOT = Path(__file__).resolve().parents[2]
SCRIPT = ROOT / "scripts/build-app.sh"


class AppInfoPlistTests(unittest.TestCase):
def test_generated_plist_enables_localized_display_names(self):
source = SCRIPT.read_text(encoding="utf-8")
matches = re.findall(
r'^cat > "\$APP/Contents/Info\.plist" <<PLIST\n(.*?)^PLIST$',
source, re.MULTILINE | re.DOTALL
)
self.assertEqual(len(matches), 1, "Expected one app Info.plist heredoc")
# Unexpanded bundle ID and version variables are valid plist strings.
contents = matches[0].encode("utf-8")
with tempfile.TemporaryDirectory() as temporary:
plist = Path(temporary) / "Info.plist"
plist.write_bytes(contents)
result = subprocess.run(
["plutil", "-lint", str(plist)],
text=True, capture_output=True
)
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)

properties = plistlib.loads(contents)
self.assertEqual(properties["CFBundleName"], "Ask Key")
self.assertEqual(properties["CFBundleDisplayName"], "Ask Key")
self.assertIs(properties["LSHasLocalizedDisplayName"], True)
self.assertEqual(properties["CFBundleDevelopmentRegion"], "en")


if __name__ == "__main__":
unittest.main()
1 change: 1 addition & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ In credential mode each `xcrun notarytool submit … --wait` runs as:

CI cannot check focus, Touch ID or real clients. Before notarizing, review the release diff for these behaviors, then install the signed `Release` build at `/Applications/Ask Key.app` and walk through this list once with the maintainer. The planner triggers agent requests itself (for example `askkey run --wait-for-approval` with a harmless command that prints no values, or a Codex session); the maintainer only touches the sensor, clicks decisions and reports what they see. Notarize the same build afterwards; its signature hash must match the one tested.

- With Simplified Chinese first in the Mac's preferred languages and the app language set to Follow System, Finder and the Touch ID prompt show 请旨; with English first, both show Ask Key. Finder can retain a stale name in the Launch Services cache until the app is re-registered or the Mac restarts.
- Every Touch ID entry: unlock management, reveal and copy a value, revoke a timed allowance, permanently delete, replace on import, settings actions, approving a read and a write. The prompt accepts a finger without a click.
- With another app's window behind Ask Key, unlock management: Ask Key stays in front afterwards, and its Dock icon does not disappear during the prompt.
- With the management window open behind another app, an agent request arrives: only the approval prompt appears; after Allow and Touch ID, focus returns to the other app.
Expand Down
6 changes: 4 additions & 2 deletions scripts/build-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ cat > "$APP/Contents/Info.plist" <<PLIST
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key><string>AskKey</string>
<key>CFBundleDisplayName</key><string>AskKey</string>
<key>CFBundleName</key><string>Ask Key</string>
<key>CFBundleDisplayName</key><string>Ask Key</string>
<key>LSHasLocalizedDisplayName</key><true/>
<key>CFBundleDevelopmentRegion</key><string>en</string>
<key>CFBundleExecutable</key><string>AskKeyApp</string>
<key>CFBundleIdentifier</key><string>${BUNDLE_ID}</string>
<key>CFBundleIconFile</key><string>AppIcon</string>
Expand Down
Loading