feat(integrations): add one token lifecycle for every OAuth provider

A provider describes where its grant lives and how its token endpoint is
called; the kit reads the grant, refreshes it under the per-user advisory
lock, re-reads under the lock so a peer's refresh or a reconnect wins, and
writes back only over the refresh token it spent. Retry-After is read in
one place, both forms, with a cap.
This commit is contained in:
Marc-André Bombeck committed 2026-10-21 19:13:16 +02:00
1 parent 45da8ae971
commit 23f6fe4c6e
7 files changed
+570 -10

No files matched your search

+8 -1
View File
@@ -62,7 +62,14 @@ export async function persistRotatedToken(
}
export type SerializedRefreshProvider =
"whoop" | "withings" | "oura" | "codex" | "admin-codex";
| "whoop"
| "withings"
| "oura"
| "strava"
| "google-health"
| "polar"
| "codex"
| "admin-codex";
/**
* Provider refreshes hold a database transaction open around one bounded