-
Notifications
You must be signed in to change notification settings - Fork 53
feat(auth): add owner-aware OAuth storage foundation #1529
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
Closed
Closed
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
540fa59
feat(auth): add owner-aware OAuth storage foundation
bsbds 6f6c67a
fix(auth): preserve OAuth callback commit boundary
bsbds 3e2bf5f
fix(auth): refresh scoped OAuth lookups
bsbds c8cb2a3
fix(auth): refresh OAuth foreign-key lookups
bsbds 83a08ad
test(migrations): clarify PostgreSQL index creation coverage
bsbds 73ec857
docs(migrations): cover partial OAuth schema recovery
bsbds fb056da
test(migrations): describe PostgreSQL ordering scope
bsbds a8ddb1f
test(auth): cover cross-user OAuth isolation
bsbds 1486596
docs(auth): explain OAuth bulk-delete session state
bsbds 2e58987
docs(auth): remove misplaced OAuth callback note
bsbds 5a124bb
docs(deployment): clarify nullable OAuth identity semantics
bsbds 12a079f
test(mcp): assert hidden actor OAuth response state
bsbds f207b9b
test(auth): verify create-all OAuth uniqueness
bsbds f65ebb4
fix(gmail): warn on owner-mismatched watch state
bsbds eddd27d
docs(deployment): add OAuth index recovery steps
bsbds 4ddf9dd
fix(gmail): capture account owner before transition lock
bsbds 53b5f2a
fix(gmail): warn when background account is unavailable
bsbds 33a1914
test(auth): prove owner indexes are partial
bsbds 2716ae1
fix(auth): normalize OAuth query user IDs
bsbds 04d47ad
fix(migrations): detect SQLite owner name collisions
bsbds 296c307
refactor(auth): defer unused OAuth lookup index
bsbds c1cc8e6
test(migrations): verify PostgreSQL owner index predicates
bsbds 60e5305
ci(migrations): run owner OAuth PostgreSQL tests
bsbds 5b3872c
docs(auth): explain actor OAuth delete cascade
bsbds 4fc6aca
docs(migrations): add SQLite interruption recovery
bsbds aaecb39
docs(deployment): warn about old worker restarts
bsbds 54e0cb3
docs(deployment): describe PostgreSQL OAuth lock scope
bsbds 4c33957
docs(deployment): verify OAuth index definitions
bsbds d78d53e
docs(migrations): distinguish SQLite migration guards
bsbds 6da8afe
docs(migrations): generalize SQLite name recovery
bsbds f22ce04
chore: merge origin main into OAuth owner foundation
bsbds 7b0c2d4
test(migrations): align PostgreSQL assertions with merge graph
bsbds efe77d2
fix(auth): reject malformed OAuth state owners
bsbds 930bde9
fix(migrations): preserve single-head OAuth rollback
bsbds 816d997
fix(auth): isolate actor OAuth backrefs
bsbds 76764c0
fix(gmail): signal OAuth ownership mismatches
bsbds daab4e0
fix(gmail): preserve mismatched watch state
bsbds e1611eb
docs(migrations): guard SQLite watch rows
bsbds 86421fb
fix(gmail): scope watch OAuth relationship
bsbds 259ce9d
refactor(auth): require scoped delete providers
bsbds 8b8392e
test(auth): verify production SQLite cascades
bsbds 339f36c
docs(auth): explain OAuth owner convention
bsbds 07c0d00
fix(gmail): preserve ownership mismatch cursors
bsbds a5511d3
fix(gmail): enforce watch ownership lifecycle
bsbds 8598f8a
fix(sqlite): require foreign key enforcement
bsbds 2a7454e
docs(migrations): add SQLite rollback recovery
bsbds 9b94f61
fix(migrations): validate OAuth owner column
bsbds 493902d
docs(migrations): detect orphan Gmail watches
bsbds d4a9b88
ci(migrations): trigger OAuth owner checks
bsbds 5b1bb5d
chore: merge upstream main and align OAuth migration
bsbds a8718e8
chore: merge GitHub connector migration head
bsbds 8da9edd
refactor(gmail): split watch lifecycle from OAuth foundation
bsbds 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,20 @@ | ||
| """Shared invariants used by startup and Alembic owner-aware migrations.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| OWNER_AWARE_UNIQUE_INDEX_DIALECTS = frozenset({"sqlite", "postgresql"}) | ||
|
|
||
|
|
||
| def require_owner_aware_unique_index_dialect(dialect: object) -> str: | ||
| """Return a supported dialect name or reject before schema inspection. | ||
|
|
||
| Actor/ordinary builtin OAuth identity relies on partial unique indexes. | ||
| Both application startup and the revision itself call this neutral helper | ||
| so their supported-dialect contract and diagnostic cannot drift. | ||
| """ | ||
| if not isinstance(dialect, str) or dialect not in OWNER_AWARE_UNIQUE_INDEX_DIALECTS: | ||
| raise RuntimeError( | ||
| "actor-owned builtin OAuth requires partial unique indexes; " | ||
| f"database dialect {dialect!r} is unsupported" | ||
| ) | ||
| return dialect |
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
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.