-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(actions): add passthrough auth #6665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Greptile OverviewGreptile SummaryThis PR introduces OAuth Pass-through authentication for MCP and OpenAPI connectors, allowing Onyx to forward user OAuth tokens directly to services that share the same identity provider. Additionally, it enhances the ActionCard component with improved hover state management using React Context. Key Changes:
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant OpenAPIModal
participant MCPModal
participant useAuthType
participant API
participant Backend
User->>OpenAPIModal: Select "OAuth Pass-through"
OpenAPIModal->>useAuthType: Check if OAuth enabled
useAuthType-->>OpenAPIModal: OIDC or Google OAuth
OpenAPIModal->>OpenAPIModal: Show pt-oauth option
User->>OpenAPIModal: Submit pt-oauth
OpenAPIModal->>API: updateCustomTool(passthrough_auth: true)
API->>Backend: PATCH /api/admin/tool/custom/{id}
Backend-->>API: Success
API-->>OpenAPIModal: Tool updated
OpenAPIModal->>User: Show success message
User->>MCPModal: Select "OAuth Pass-through"
MCPModal->>useAuthType: Check if OAuth enabled
useAuthType-->>MCPModal: OIDC or Google OAuth
MCPModal->>MCPModal: Show PT_OAUTH option
User->>MCPModal: Submit PT_OAUTH
MCPModal->>API: Update MCP server config
API->>Backend: Update auth_type: PT_OAUTH
Backend-->>API: Success
API-->>MCPModal: Server updated
MCPModal->>User: Show success message
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 issues found across 7 files
Prompt for AI agents (all 3 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="web/src/sections/actions/modals/MCPAuthenticationModal.tsx">
<violation number="1" location="web/src/sections/actions/modals/MCPAuthenticationModal.tsx:434">
P2: The `PT_OAUTH` option is added but the `onValueChange` handler doesn't set `auth_performer` to `PER_USER` for this auth type. Since PT_OAUTH forwards the user's token, it should also be treated as per-user authentication. Update the condition at line 417 to include `PT_OAUTH`:
```tsx
if (value === MCPAuthenticationType.OAUTH || value === MCPAuthenticationType.PT_OAUTH) {
```</violation>
</file>
<file name="web/src/sections/actions/modals/OpenAPIAuthenticationModal.tsx">
<violation number="1" location="web/src/sections/actions/modals/OpenAPIAuthenticationModal.tsx:231">
P2: `passthroughOAuthEnabled` is used in `computedInitialValues` but is missing from the useMemo dependency array. The initial values won't recalculate when this prop changes. Add `passthroughOAuthEnabled` to the dependency array.</violation>
<violation number="2" location="web/src/sections/actions/modals/OpenAPIAuthenticationModal.tsx:377">
P1: The validation schema doesn't include "pt-oauth" in the allowed values. Form submission will fail when users select "OAuth Pass-through" because `authMethod.oneOf(["oauth", "custom-header"])` at line 150 rejects "pt-oauth". Update the schema to include the new auth method.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
61efe68 to
29f8443
Compare
| className="h-6 w-6" | ||
| aria-label={`Edit ${title}`} | ||
| onClick={handleRenameClick} | ||
| className="h-6 w-6 opacity-70 hover:opacity-100" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, how come we have custom styling here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don’t need custom styling here, at least for now. If we need custom styling, we can introduce it as a prop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the custom styling if it's not needed then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sry, I misunderstood the question. We need this styling here.
…n OpenAPI and MCP modals
…th and API token authentication
29f8443 to
9d2128d
Compare
| className="h-6 w-6" | ||
| aria-label={`Edit ${title}`} | ||
| onClick={handleRenameClick} | ||
| className="h-6 w-6 opacity-70 hover:opacity-100" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the custom styling if it's not needed then?
|
Please remember to remove the custom styling in |
…no-auth flow test
Description
This pull request introduces a new "OAuth Pass-through" authentication method for both MCP and OpenAPI connectors, improves the Action Card component's hover state management, and refines UI behaviors for authentication and server management actions. The most significant changes are grouped below by theme.
How Has This Been Tested?
Tested from UI
Additional Options
Summary by cubic
Adds OAuth pass-through to MCP and OpenAPI so Onyx can forward the signed-in user’s token. Also replaces the legacy Actions page with dedicated MCP and OpenAPI pages and improves cards, tool lists, and loading states.
New Features
UI Improvements
Written for commit 5811fba. Summary will update automatically on new commits.