Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughIntroduces API token management (backend routes, UI, TS module, CSS, templates), integrates optional MCP endpoints (FastApiMCP) gated by DISABLE_MCP, updates auth to accept API tokens, adds OpenAPI operation_id metadata, adjusts typings, revises env/docs/README, and updates dependencies (fastapi-mcp, litellm). Minor repo hygiene (.gitignore, wordlist). Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as Frontend (Modal)
participant TS as tokens.ts
participant API as FastAPI /api/tokens
participant Auth as token_required
participant DB as Organizations Graph
participant CB as app.state.callback_handler
rect rgba(200,240,255,0.2)
note over User,UI: Open Tokens Modal
User->>UI: Click "API Tokens"
UI->>TS: setupTokenManagement()
TS->>API: GET /api/tokens/list
API->>Auth: Validate (OAuth or API token)
Auth-->>API: user_email
API->>DB: MATCH tokens by user_email
DB-->>API: Token list
API-->>TS: { tokens: [...] }
TS->>UI: Render table
end
rect rgba(220,255,220,0.2)
note over User,API: Generate Token
User->>UI: Click "Generate New Token"
UI->>TS: generateToken()
TS->>API: POST /api/tokens/generate
API->>Auth: Validate
Auth-->>API: user_email
API->>CB: persist ('api', user_data, api_token)
CB-->>API: ok
API-->>TS: { token_id, created_at }
TS->>UI: Show token (masked), Copy/Show controls
TS->>API: GET /api/tokens/list (refresh)
API-->>TS: updated list
end
rect rgba(255,230,230,0.2)
note over User,API: Delete Token
User->>UI: Click "Delete" (last 4)
UI->>TS: confirm delete
TS->>API: DELETE /api/tokens/{last4}
API->>Auth: Validate
Auth-->>API: user_email
API->>DB: DELETE matching token(s)
DB-->>API: count
API-->>TS: 200/404
TS->>UI: Update list / show error
end
sequenceDiagram
autonumber
participant Env as ENV
participant App as app_factory
participant MCP as FastApiMCP
participant API as FastAPI
Env-->>App: DISABLE_MCP = [unset/false/true]
alt MCP enabled (unset/false)
App->>MCP: new FastApiMCP(name="queryweaver", ops=[list,connect,schema,query])
MCP->>API: mount_http(/mcp)
else MCP disabled (true/1/yes)
App->>API: Skip MCP mount (log)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Dependency ReviewThe following issues were found:
|
Fix #159
Summary by CodeRabbit