feat: complete integration oauth egress

This commit is contained in:
zhongqin
2026-09-02 11:16:58 +08:00
parent e9be2e5c14
commit b4e382bdfd
148 changed files with 1536 additions and 152 deletions
+17
View File
@@ -1198,6 +1198,23 @@ CREATE TABLE IF NOT EXISTS itg_api_clients (
CREATE INDEX IF NOT EXISTS idx_itg_api_clients_tenant ON itg_api_clients(tenant_id);
-- OAuth2 authorization-code tokens (oauth2-egress.md §2): one row per
-- (api-client, tenant); access/refresh tokens are vault-sealed.
CREATE TABLE IF NOT EXISTS itg_oauth_tokens (
id INTEGER PRIMARY KEY,
client_key TEXT NOT NULL,
tenant_id TEXT NOT NULL DEFAULT 'default',
access_token TEXT,
refresh_token TEXT,
expires_at TEXT,
scope TEXT,
created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ','now')),
updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ','now')),
UNIQUE (client_key, tenant_id)
);
CREATE INDEX IF NOT EXISTS idx_itg_oauth_tokens_tenant ON itg_oauth_tokens(tenant_id);
-- Full outbound call log (integration.md §10.7: trace_id = itg_receipts.id)
CREATE TABLE IF NOT EXISTS itg_egress_log (
id INTEGER PRIMARY KEY,