Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion framework/oauth2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,6 @@ func generateSecureRandomString(length int) (string, error) {
// The function errors out cleanly on any misconfig (missing identity, unknown
// mode, missing template config) — no fallbacks, no generated identities.
func (p *OAuth2Provider) InitiateUserOAuthFlow(ctx context.Context, oauthConfigID string, mcpClientID string, redirectURI string, flowMode schemas.MCPAuthMode) (*schemas.OAuth2FlowInitiation, string, error) {

// 1. Load template OAuth config.
templateConfig, err := p.configStore.GetOauthConfigByID(ctx, oauthConfigID)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion transports/bifrost-http/lib/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,9 @@ func (m *MockConfigStore) UpdateMCPPerUserHeaderFlow(ctx context.Context, flow *
func (m *MockConfigStore) DeleteMCPPerUserHeaderFlowsByModeIdentityAndMCPClient(ctx context.Context, mode schemas.MCPAuthMode, identity, mcpClientID string) error {
return nil
}
func (m *MockConfigStore) DeleteMCPPerUserHeaderFlow(ctx context.Context, id string) error { return nil }
func (m *MockConfigStore) DeleteMCPPerUserHeaderFlow(ctx context.Context, id string) error {
return nil
}
func (m *MockConfigStore) ListAllPendingMCPPerUserHeaderFlows(ctx context.Context) ([]tables.TableMCPPerUserHeaderFlow, error) {
return nil, nil
}
Expand Down
54 changes: 23 additions & 31 deletions ui/app/workspace/config/views/mcpView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import { IS_ENTERPRISE } from "@/lib/constants/config";
import {
getErrorMessage,
useGetCoreConfigQuery,
Expand All @@ -25,7 +24,6 @@ import {
import { CoreConfig, DefaultCoreConfig } from "@/lib/types/config";
import { EnvVar } from "@/lib/types/schemas";
import { RbacOperation, RbacResource, useRbac } from "@enterprise/lib";
import { useGetAuthTypeQuery } from "@enterprise/lib/store/apis/scimApi";
import { AlertTriangle } from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
import { toast } from "sonner";
Expand All @@ -41,13 +39,9 @@ export default function MCPView() {
RbacOperation.Update,
);
const { data: bifrostConfig } = useGetCoreConfigQuery({ fromDB: true });
const { data: authType } = useGetAuthTypeQuery(undefined, {
skip: !IS_ENTERPRISE,
});
const config = bifrostConfig?.client_config;
const [updateCoreConfig, { isLoading }] = useUpdateCoreConfigMutation();
const [localConfig, setLocalConfig] = useState<CoreConfig>(DefaultCoreConfig);
const isSCIMEnabled = IS_ENTERPRISE && authType?.type === "sso";

const [localValues, setLocalValues] = useState<{
mcp_agent_depth: string;
Expand Down Expand Up @@ -292,32 +286,30 @@ export default function MCPView() {
/>
</div>

{isSCIMEnabled && (
/* Temp Token Auth */
<div className="flex items-center justify-between space-x-2 rounded-sm border p-4">
<div className="space-y-0.5">
<label
htmlFor="mcp-enable-temp-token-auth"
className="text-sm font-medium"
>
Allow Temp Token Auth Links
</label>
<p className="text-muted-foreground text-sm">
When enabled, per-user MCP OAuth links can include a short-lived
scoped token so someone without an active Bifrost dashboard
session can complete the flow. Keep disabled to require normal
dashboard authentication.
</p>
</div>
<Switch
id="mcp-enable-temp-token-auth"
checked={localConfig.mcp_enable_temp_token_auth ?? false}
onCheckedChange={handleTempTokenAuthChange}
disabled={!hasSettingsUpdateAccess}
data-testid="mcp-enable-temp-token-auth-switch"
/>
{/* Temp Token Auth */}
<div className="flex items-center justify-between space-x-2 rounded-sm border p-4">
<div className="space-y-0.5">
<label
htmlFor="mcp-enable-temp-token-auth"
className="text-sm font-medium"
>
Allow Temp Token Auth Links
</label>
<p className="text-muted-foreground text-sm">
When enabled, per-user MCP OAuth links can include a short-lived
scoped token so someone without an active Bifrost dashboard
session can complete the flow. Keep disabled to require normal
dashboard authentication.
</p>
</div>
)}
<Switch
id="mcp-enable-temp-token-auth"
checked={localConfig.mcp_enable_temp_token_auth ?? false}
onCheckedChange={handleTempTokenAuthChange}
disabled={!hasSettingsUpdateAccess}
data-testid="mcp-enable-temp-token-auth-switch"
/>
</div>

{/* Code Mode Binding Level */}
<div className="space-y-4 rounded-sm border p-4">
Expand Down
Loading