-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
29 lines (26 loc) · 818 Bytes
/
Copy pathschema.sql
File metadata and controls
29 lines (26 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- ABOUTME: D1 database schema for OAuth tables
-- ABOUTME: Run with: wrangler d1 execute my-mcp-server --file=schema.sql
-- OAuth: Client registrations (RFC 7591)
CREATE TABLE IF NOT EXISTS oauth_clients (
client_id TEXT PRIMARY KEY,
client_secret TEXT NOT NULL,
redirect_uris TEXT NOT NULL,
created_at INTEGER DEFAULT (unixepoch())
);
-- OAuth: Authorization codes (short-lived)
CREATE TABLE IF NOT EXISTS oauth_codes (
code TEXT PRIMARY KEY,
client_id TEXT NOT NULL,
code_challenge TEXT NOT NULL,
redirect_uri TEXT NOT NULL,
scope TEXT NOT NULL,
expires_at INTEGER NOT NULL
);
-- OAuth: Access and refresh tokens
CREATE TABLE IF NOT EXISTS oauth_tokens (
token TEXT PRIMARY KEY,
client_id TEXT NOT NULL,
token_type TEXT NOT NULL,
scope TEXT NOT NULL,
expires_at INTEGER NOT NULL
);