feat(vaults): 添加对 MCP OAuth Credential 的UI交互 - #215
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (7)
📝 WalkthroughWalkthroughThe PR adds MCP OAuth credential types, payload handling, validation, organization API support, directory server selection, popup completion handling, and first-credential navigation. ChangesMCP OAuth credential model
Vault credential entry flow
OAuth dialog and API flow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CredentialDialog
participant OrganizationAPI
participant OAuthPopup
participant VaultCredentialsPanel
CredentialDialog->>OrganizationAPI: Start MCP Vault OAuth
OrganizationAPI-->>CredentialDialog: Return OAuth flow ID and redirect URL
CredentialDialog->>OAuthPopup: Open redirect URL
OAuthPopup-->>CredentialDialog: Send OAuth completion message
CredentialDialog->>VaultCredentialsPanel: Close dialog and refresh
Possibly related issues
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
66dd218 to
41badc3
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/src/features/managed-agents/resources/dialogs.tsx`:
- Around line 310-410: Update ManagedTextField to accept and forward an input
type prop, then apply type="password" to the token, secret, and client-secret
fields in the managed-agent credential dialog, including bearer, OAuth, refresh,
and environment-variable secret values. Add an intentional reveal control only
if the existing editing UX requires users to view these values.
- Around line 178-208: Update the OAuth submission flow around connectOAuth() to
retain the returned started.oauth_flow_id before opening the popup, then have
the useEffect completion handler accept messages only when both message.flow_id
matches that stored ID and message.vault_id matches vaultId. Preserve the
existing same-origin/type checks and error/completion handling, and include the
new flow ID and vaultId dependencies as needed.
- Around line 225-248: Update connectOAuth to open a blank OAuth popup
synchronously after validation and before awaiting startMCPVaultAuth, then
navigate that popup to started.redirect_url when the request succeeds. Track the
popup and close it in the request-failure path, while preserving the existing
popup-blocked error handling.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: d36eee2c-5240-4df0-86c8-f981aff9ca5f
📒 Files selected for processing (7)
web/src/features/managed-agents/api.tsweb/src/features/managed-agents/resources/detail.tsxweb/src/features/managed-agents/resources/dialogs.tsxweb/src/features/managed-agents/resources/entities.tsxweb/src/features/managed-agents/resources/model.test.tsweb/src/features/managed-agents/resources/model.tsxweb/src/features/managed-agents/types.ts
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41badc3bd5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- 添加mcp_oauth认证类型支持,包括访问令牌和刷新令牌配置 - 实现OAuth连接流程,支持动态注册和自定义客户端凭据 - 新增可选凭证字段折叠面板,优化表单布局和用户体验 - 添加目录服务器选择器,支持从预配置服务器列表中选择MCP服务器 - 实现凭证创建和编辑表单的完整验证逻辑 - 添加认证确认复选框,确保用户了解共享责任 - 集成CSRF保护和OAuth完成回调处理 - 扩展输入组件以支持密码类型和自动填充控制 - 添加跳过按钮用于首次凭证创建向导 - 实现凭证表单准备状态检查逻辑 - 添加OAuth弹窗阻止检测和错误处理机制
41badc3 to
803fa22
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
目标:本 PR 仅为前端修改
摘要
mcp_oauth(可选填写 Refresh)。效果
测试计划
mcp_oauthbun test src/features/managed-agents/resources/model.test.tsSummary by CodeRabbit