Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

feat(control-ui): render recipe-owned credential surface

Jose Ramirez61a985369ff7
diff --git a/control-ui/components/UpdateConnectorCredentials/index.tsx b/control-ui/components/UpdateConnectorCredentials/index.tsx
index d2f51b262..2512cd2fd 100644
--- a/control-ui/components/UpdateConnectorCredentials/index.tsx
+++ b/control-ui/components/UpdateConnectorCredentials/index.tsx
@@ -82,6 +82,7 @@ function findFreshDeploymentReady(
export function UpdateConnectorCredentials({
serverName,
envSecret,
+ surface = 'rotate',
}: UpdateConnectorCredentialsProps) {
const { showToast } = useToast()
const { confirm, confirmDialog } = useConfirmDialog()
@@ -238,6 +239,21 @@ export function UpdateConnectorCredentials({
)
}
+ // A WorkflowRecipe-owned connector whose Secret is missing: the Secret name
+ // belongs to the recipe (the PUT route guards recipe-owned Secrets, the POST
+ // route does not), and HCC never creates a Deployment for managed:false, so a
+ // create here would both cross an ownership boundary and never converge.
+ if (surface === 'recipe-owned') {
+ return (
+ <FormSection title="Update credentials">
+ <p className="cu-muted">
+ This connector&apos;s credentials are managed by its WorkflowRecipe. Add the Secret
+ through the recipe&apos;s secrets, not here.
+ </p>
+ </FormSection>
+ )
+ }
+
function updateField(secretKey: string, value: string) {
setDraft(prev => ({ ...prev, [secretKey]: value }))
if (validationError) setValidationError('')
diff --git a/control-ui/components/UpdateConnectorCredentials/types.ts b/control-ui/components/UpdateConnectorCredentials/types.ts
index af962b03f..a10ab7e49 100644
--- a/control-ui/components/UpdateConnectorCredentials/types.ts
+++ b/control-ui/components/UpdateConnectorCredentials/types.ts
@@ -1,4 +1,5 @@
import type { EnvSecret } from '../../lib/api'
+import type { CredentialSurface } from './resolveCredentialSurface'
export type UpdateConnectorCredentialsProps = {
/**
@@ -14,6 +15,12 @@ export type UpdateConnectorCredentialsProps = {
* instead of a form when this is unset.
*/
envSecret: EnvSecret | undefined
+ /**
+ * Which credential surface to render, derived by resolveCredentialSurface()
+ * from the McpServer's SecretResolved condition and spec.managed. Optional
+ * and defaulting to 'rotate' so existing call sites keep today's behavior.
+ */
+ surface?: CredentialSurface
}
/**
diff --git a/control-ui/components/__tests__/UpdateConnectorCredentials.test.tsx b/control-ui/components/__tests__/UpdateConnectorCredentials.test.tsx
index 01980efc6..9a74c6b57 100644
--- a/control-ui/components/__tests__/UpdateConnectorCredentials.test.tsx
+++ b/control-ui/components/__tests__/UpdateConnectorCredentials.test.tsx
@@ -6,6 +6,7 @@ import {
POLL_TIMEOUT_MS,
UpdateConnectorCredentials,
} from '@components/UpdateConnectorCredentials'
+import type { CredentialSurface } from '@components/UpdateConnectorCredentials/resolveCredentialSurface'
import { getMcpServer, getMcpServers, updateMcpSecret } from '@lib/api'
import type { EnvSecret, McpServerResource } from '@lib/api'
@@ -76,10 +77,17 @@ async function flush(ticks = 4) {
// no-envSecret state, but a JS default parameter substitutes ENV_SECRET for
// an explicit `undefined` argument, silently defeating that test. Callers
// always pass explicitly.
-async function renderPanel(envSecret: EnvSecret | undefined) {
+async function renderPanel(
+ envSecret: EnvSecret | undefined,
+ surface: CredentialSurface = 'rotate'
+) {
const utils = render(
<ToastProvider>
- <UpdateConnectorCredentials serverName={SERVER_NAME} envSecret={envSecret} />
+ <UpdateConnectorCredentials
+ serverName={SERVER_NAME}
+ envSecret={envSecret}
+ surface={surface}
+ />
</ToastProvider>
)
// Flush the best-effort "who else uses this Secret" preview fetch
@@ -587,3 +595,15 @@ describe('UpdateConnectorCredentials — rollout polling', () => {
expect(banner.textContent).not.toMatch(new RegExp(`${OTHER}[^.]*restarted and is serving`))
})
})
+
+describe('UpdateConnectorCredentials — recipe-owned', () => {
+ it('renders an explanation and no form when the Secret belongs to a WorkflowRecipe', async () => {
+ await renderPanel(ENV_SECRET, 'recipe-owned')
+
+ expect(screen.getByText(/managed by its WorkflowRecipe/i)).toBeInTheDocument()
+ // No form at all: neither the inputs nor either submit button.
+ expect(screen.queryByLabelText('api-key')).not.toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: 'Rotate credentials' })).not.toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: 'Set credentials' })).not.toBeInTheDocument()
+ })
+})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 8b05dec72..ebaa80d99 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.387",
+ "version": "0.1.388",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.387",
+ "version": "0.1.388",
"dependencies": {
"@clerum/llm-providers": "file:../packages/llm-providers",
"@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",
diff --git a/control-ui/package.json b/control-ui/package.json
index e226d3c13..73e243e2e 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.387",
+ "version": "0.1.388",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",