Skip to content

Commit b1680a5

Browse files
committed
fix(storage): Phase 3 — Backfill stale approved OAuth client flags
Signed-off-by: crimsonsunset <jsangio1@gmail.com>
1 parent 8d752fb commit b1680a5

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

crates/mcpmux-storage/src/database.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ const MIGRATIONS: &[Migration] = &[
238238
name: "workspace_binding_prompt_dismissals",
239239
sql: include_str!("migrations/041_workspace_binding_prompt_dismissals.sql"),
240240
},
241+
Migration {
242+
version: 42,
243+
name: "backfill_approved_clients",
244+
sql: include_str!("migrations/042_backfill_approved_clients.sql"),
245+
},
241246
];
242247

243248
/// SQLite database wrapper.
@@ -778,7 +783,7 @@ mod tests {
778783
|row| row.get(0),
779784
)
780785
.unwrap();
781-
assert_eq!(version, 41);
786+
assert_eq!(version, 42);
782787

783788
let v16_name: String = db
784789
.conn
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- Migration 042: backfill stale approved flags on OAuth clients with real traffic.
2+
--
3+
-- last_seen is only set after a successful authenticated request, which requires
4+
-- an already-issued token. Clients with last_seen set were already granted
5+
-- access; the approved flag just never caught up on legacy auto-approve paths.
6+
7+
UPDATE inbound_clients
8+
SET approved = 1
9+
WHERE approved = 0
10+
AND last_seen IS NOT NULL;

0 commit comments

Comments
 (0)