Files
clawmates/crates/tc-api/Cargo.toml
T
Omar SobhandClaude Fable 5 91327e3618 P4 complete: OAuth authorization-code flow, MCP-OAuth, AddApps connects
- migration 0005 oauth_states: one-time states (10-min TTL), consumed by a
  CAS DELETE on callback — replays and forgeries both 404
- POST /api/apps/oauth/start: OIDC discovery on the configured issuer (or
  the custom MCP issuer for authType=mcp_oauth), state row, authorize URL
- GET /api/apps/oauth/callback: code exchanged at the REAL token endpoint
  (client id+secret form POST); the access token goes straight to the
  broker (test proves it never appears unencrypted in Postgres); connection
  row + audit; redirects to the claw's Add Apps panel
- [oauth] config (issuer/client/redirect_base) wired through AppState
- Tests against a real local IdP server (discovery + validating token
  endpoint): full round trip, broker-held token, replay/forged state
  refused, bad code fails exchange, mcp_oauth uses the custom issuer while
  plain oauth refuses without a configured IdP
- AddAppsApp: live connection badges + inline API-key connect per app
  (E2E: connect Notion by key from the directory)

136 Rust + 63 frontend tests + 21 Playwright journeys.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-10 06:50:41 -05:00

46 lines
1.1 KiB
TOML

[package]
name = "tc-api"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
publish.workspace = true
[dependencies]
async-stream = "0.3"
axum = "0.8"
futures = "0.3"
serde = { workspace = true }
serde_json = { workspace = true }
sqlx = { workspace = true }
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
tc-auth = { path = "../tc-auth" }
tc-config = { path = "../tc-config" }
tc-db = { path = "../tc-db" }
tc-domain = { path = "../tc-domain" }
tc-runtime = { path = "../tc-runtime" }
tc-safety = { path = "../tc-safety" }
tc-scheduler = { path = "../tc-scheduler" }
tc-secrets = { path = "../tc-secrets" }
thiserror = { workspace = true }
time = { workspace = true }
tokio = { workspace = true }
urlencoding = "2"
uuid = { workspace = true }
[dev-dependencies]
eventsource-stream = "0.2"
reqwest = { version = "0.12", default-features = false, features = [
"json",
"rustls-tls",
"stream",
] }
tc-llm = { path = "../tc-llm" }
tc-testkit = { path = "../tc-testkit" }
hex = "0.4"
hmac = "0.12"
sha2 = "0.10"
[lints]
workspace = true