Skip to content

fix(auth): bound macOS Keychain status probes - #10

Merged
pentaoa merged 2 commits into
wormforce:mainfrom
Stevvven777:codex/bounded-macos-keychain-status
Sep 5, 2026
Merged

fix(auth): bound macOS Keychain status probes#10
pentaoa merged 2 commits into
wormforce:mainfrom
Stevvven777:codex/bounded-macos-keychain-status

Conversation

@Stevvven777

Copy link
Copy Markdown
Contributor

Summary

  • add an optional existence-only SecretStore.has() operation and use it for credential status probes
  • make macOS status call /usr/bin/security find-generic-password without -w, so it never requests the stored password
  • bound credential-helper subprocesses to five seconds, kill a timed-out helper, and expose the stable additive reasonCode: CREDENTIAL_STORE_TIMEOUT
  • keep secret load/write/delete paths separate and preserve their existing behavior

Failure and compatibility semantics

  • auth status remains read-only and does not retry credential-store operations
  • timeout leaves both the Keychain item and local profile metadata unchanged
  • existing status fields and exit behavior remain compatible; reasonCode and the optional store method are additive
  • Windows and Linux backends retain their current lookup behavior while gaining the same bounded external-helper runner where applicable

Validation

  • macOS arm64, Node.js v26.8.1
  • npm run check
  • npm test — 314/314 passed
  • npm pack --dry-run --json — passed
  • npm audit --omit=dev — 0 vulnerabilities
  • real macOS host regression with synthetic profile metadata and a nonexistent synthetic Keychain account — exit 0 in 0.28 seconds, no password read
  • timeout fixture runs a genuinely non-returning helper and verifies bounded CREDENTIAL_STORE_TIMEOUT status with no automatic retry

Closes #9

@Stevvven777

Copy link
Copy Markdown
Contributor Author

GitHub Actions created CI run https://github.com/wormforce/sustech-cli/actions/runs/33626389782, but it completed as action_required without starting jobs because this is a fork PR. Maintainer approval is needed to run it. Local macOS arm64 gates passed: typecheck, 314/314 tests, prepack dry-run, production audit with 0 vulnerabilities, and a real metadata-only synthetic Keychain status probe returned in 0.28 s. I have not retriggered the workflow.

@pentaoa pentaoa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the metadata-only macOS status path, helper-process timeout handling, and credential status error projection. Status uses the optional existence probe instead of retrieving a password; the timeout has a stable reason code and does not retry the operation. No blocking implementation issue found.

During verification, the new Linux fixture failed during an ordinary write because it applied a 50 ms timeout to every helper invocation. Pushed 1e39512 to this maintainer-editable branch: normal operations now use the production timeout, while only the deliberately hanging lookup uses 50 ms. The build and all 16 credential/keyring/dashboard tests pass, including the bounded hanging-helper test.

Ready to merge once the updated cross-platform CI checks pass.

@pentaoa
pentaoa merged commit 8080005 into wormforce:main Sep 5, 2026
6 checks passed
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.

[Bug] auth status can hang in macOS Keychain host context

2 participants