fix(keychain): 再起動非永続な store では DB トークンフォールバックを消さない#34
Merged
Conversation
Linux の keyutils store は CredentialPersistence::UntilReboot(カーネル メモリ常駐)のため、keychain 保存成功を理由に DB フォールバックをクリア すると、再起動後に keychain も DB も空になりログアウトされる (notedeck-dev/notedeck#785)。WSL2 では CONFIG_PERSISTENT_KEYRINGS も無効な ため VM 停止だけで発生する。 - keychain::is_persistent() を追加(store の persistence() が UntilDelete のときのみ true。未設定時は安全側で false) - get_credentials / login の DB クリアを is_persistent() でゲート。 非永続環境では keychain をキャッシュとして扱い、DB を正とする - DB にトークンが残り続ける前提になるため、DB/WAL/SHM を open 時に owner-only (0600) へ締める(従来は umask 依存で 644 だった) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hitalin
added a commit
to notedeck-dev/notedeck
that referenced
this pull request
Jul 16, 2026
Linux keyutils store は UntilReboot(WSL2 では VM 停止で消失)のため、 keychain 保存成功を理由に DB をクリアすると次回起動で認証情報が全消失 してログアウトされていた。notecli の keychain::is_persistent() で DB クリアをゲートし、非永続環境では keychain をキャッシュ扱いにする。 logout の DB クリアはユーザー意図なので無条件のまま。 notecli rev は feat/keychain-persistence-api (615a599) に一旦 pin。 PR notedeck-dev/notecli#34 マージ後に main へ再 pin する。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 16, 2026
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.
なぜ
notedeck-dev/notedeck#785 の修正(notecli 側)。Linux の keyutils store は再起動非永続(
CredentialPersistence::UntilReboot)なのに、keychain 保存成功で DB フォールバックをクリアしていたため、再起動後に認証情報が全消失してログアウトされる。WSL2 は persistent keyring も無効なため VM 停止だけで発生する。変更
keychain::is_persistent()を追加 — store のpersistence()がUntilDelete(ディスク永続 = macOS/Windows/Android)のときのみ true。store 未設定時は安全側で falseget_credentialsの lazy migration とloginコマンドの DB クリアをis_persistent()でゲート。非永続環境では keychain をキャッシュとして扱い、DB フォールバックを正とするテスト
is_persistent_is_false_on_linux: store 未設定時 + keyutils init 後の両方で falsedb_file_is_owner_only: 644 の既存 DB が open で 0600 に締まる🤖 Generated with Claude Code