feat(cli): macOS Keychain signer with optional TTL#42
Merged
Conversation
Wires the OS-keychain signer tier the daemon already accepts. New `agentlock signer enroll --tier os-keychain [--ttl 4h]` stashes a fresh ed25519 seed in the macOS login keychain via /usr/bin/security and persists pubkey + expires_at in os-keychain.meta.json. `session create` and `session rotate` accept --tier os-keychain; load checks the meta TTL before reading the keychain so expired signers fail fast. TTL is enforced CLI-side (Keychain has no native TTL primitive). Linux/Windows error out with a clear roadmap message. Tests cover enroll, sign round-trip, expired-TTL rejection, re-enroll rotation, checksum tamper, and missing-meta paths; skipped on non-darwin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c8976f4 to
6aaa0c2
Compare
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
os-keychainsigner tier the daemon already accepts.agentlock signer enroll --tier os-keychain [--ttl 4h]stashes a fresh ed25519 seed in the macOS login keychain via/usr/bin/securityand persists pubkey +expires_atinos-keychain.meta.json.session createandsession rotateaccept--tier os-keychain. Load checks the meta TTL before reading the keychain so expired signers fail fast.Test plan
bun run typecheckcleanbun test— 108 pass, 0 fail (6 new keychain tests, skipped on non-darwin)session create --tier os-keychainagainst local daemon, daemon acceptssigner=os_keychain--ttl 2s, sleep, retry → CLI rejects with "expired at ..." messageopenagentlock-signer) is acceptable, or rename🤖 Generated with Claude Code