-
Notifications
You must be signed in to change notification settings - Fork 127
fix(oauth): store keyring tokens as one entry per provider #668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
euxaristia
wants to merge
28
commits into
Gitlawb:main
Choose a base branch
from
euxaristia:fix/keyring-oauth-per-provider-entries
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
a0cf253
fix(oauth): store keyring tokens as one entry per provider
euxaristia 5bfbd16
fix(oauth): lock keyring reads against concurrent Save/Delete
euxaristia f2e37bd
fix(oauth): make the keyring token store bounded, recoverable, and mi…
euxaristia 44aff1a
test(oauth): assert Status also stays lock-free behind a crashed writ…
euxaristia 2a27743
fix(oauth): recover legacy tokens across an interrupted keyring migra…
euxaristia 527846e
fix(oauth): lease the keyring lock with wall-clock time
euxaristia cedc33e
fix(oauth): bound the keyring index chunk count before reading
euxaristia 08ed2c6
fix(oauth): scope the keyring fallback lock to a per-user path
euxaristia 73f6da8
fix(oauth): fail logout on legacy-blob delete failure; cap index chun…
euxaristia ecca0c2
fix(oauth): use wall clock for lock timeout and bound keyring index
euxaristia 19a14ae
fix(oauth): refuse keyring indexes over the reader key cap on write
euxaristia 1895276
fix(oauth): derive the keyring lock path from keyring identity, not f…
euxaristia 1d6a8bf
fix(oauth): refuse to delete the legacy keyring blob on a transient r…
euxaristia c07b9dc
fix(oauth): dedupe and validate the keyring index before fanning out …
euxaristia 9e3f52c
fix(oauth): anchor the keyring lock on home dir and honor the legacy …
euxaristia 226852b
fix(oauth): preserve token scopes across refresh and encode keyring l…
euxaristia ee4163d
fix(oauth): address review findings on legacy freshness, unindexed ke…
euxaristia 6ea4827
fix(oauth): fix readKeyIndex chunked path rawKeys rename and cap order
euxaristia 2270931
test(oauth): cover read() index/entry desync recovery for chunked ind…
euxaristia 61b8406
chore: force CodeRabbit re-review
euxaristia 5c4b8b6
fix(oauth): address PR requested changes for keyring per-provider ent…
euxaristia c511460
fix(oauth): address review findings for per-provider keyring entries
euxaristia 69c8587
fix(oauth): address remaining keyring migration P1s
euxaristia 7d3a429
fix(oauth): harden keyring index write and migration safety
euxaristia b112dc2
fix(oauth): freeze legacy keyring and tombstone durable deletes
euxaristia ad2032f
Harden OAuth migration state transitions against interrupted writes.
euxaristia 797c6ff
fix(oauth): close lease panics, ownership refresh, and review findings.
euxaristia 67a5ad5
fix(oauth): preserve incomplete index chunks and tighten lease owners…
euxaristia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //go:build !windows | ||
|
|
||
| package oauth | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "os" | ||
| "syscall" | ||
| ) | ||
|
|
||
| // checkOAuthLockDirOwner rejects a fallback lock directory not owned by the | ||
| // current user: on a shared temp root another user could have pre-created the | ||
| // path and would then control its lifetime (deletion/renaming), permanently | ||
| // denying OAuth keyring operations. | ||
| func checkOAuthLockDirOwner(info os.FileInfo) error { | ||
| stat, ok := info.Sys().(*syscall.Stat_t) | ||
| if !ok { | ||
| return nil | ||
| } | ||
| if int(stat.Uid) != os.Geteuid() { | ||
| return fmt.Errorf("oauth lock fallback directory is owned by uid %d, not the current user", stat.Uid) | ||
| } | ||
| return nil | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| //go:build windows | ||
|
|
||
| package oauth | ||
|
|
||
| import "os" | ||
|
|
||
| // checkOAuthLockDirOwner is a no-op on Windows: the process temp directory is | ||
| // per-user by default, and keyringFallbackLockDir returns it directly. | ||
| func checkOAuthLockDirOwner(os.FileInfo) error { | ||
| return nil | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.