Skip to content

Handle keyring storage failures with actionable error#9

Open
sharoonthomas wants to merge 1 commit into
fulfilio:masterfrom
sharoonthomas:fix/keyring-error-handling
Open

Handle keyring storage failures with actionable error#9
sharoonthomas wants to merge 1 commit into
fulfilio:masterfrom
sharoonthomas:fix/keyring-error-handling

Conversation

@sharoonthomas
Copy link
Copy Markdown
Contributor

The system keyring can reject writes on macOS when an existing 'fulfil-cli' entry was created by a different binary (error -25244, errSecMissingEntitlement). Previously this surfaced as an unhandled traceback from the middle of 'fulfil auth login'.

Catch PasswordSetError and KeyringLocked in the storage functions and re-raise as a new KeyringError with a platform-specific hint:

  • macOS: run 'security delete-generic-password -s fulfil-cli'
  • other: check that the keyring daemon is unlocked

The login commands route the error through handle_error so the user gets a clean red message (or JSON when piped) with remediation instead of a traceback. Partial workspace state is not written on failure.

The system keyring can reject writes on macOS when an existing
'fulfil-cli' entry was created by a different binary (error -25244,
errSecMissingEntitlement). Previously this surfaced as an unhandled
traceback from the middle of 'fulfil auth login'.

Catch PasswordSetError and KeyringLocked in the storage functions
and re-raise as a new KeyringError with a platform-specific hint:
- macOS: run 'security delete-generic-password -s fulfil-cli'
- other: check that the keyring daemon is unlocked

The login commands route the error through handle_error so the user
gets a clean red message (or JSON when piped) with remediation instead
of a traceback. Partial workspace state is not written on failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant