Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
feat(control-ui): guide operators to enable registry auth for API keys when connected
Jose Ramireza5698fd15563
diff --git a/control-ui/components/RegistryApiKeysPanel.tsx b/control-ui/components/RegistryApiKeysPanel.tsxindex 473b3542f..fe86c393b 100644--- a/control-ui/components/RegistryApiKeysPanel.tsx+++ b/control-ui/components/RegistryApiKeysPanel.tsx@@ -1,20 +1,21 @@// control-ui/components/RegistryApiKeysPanel.tsx'use client'+import { useCallback, useEffect, useState } from 'react'import {+ type CreateRegistryApiKeyInput,+ type CreatedRegistryApiKey,+ type RegistryApiKey,createRegistryApiKey,listRegistryApiKeys,revokeRegistryApiKey,- type CreatedRegistryApiKey,- type CreateRegistryApiKeyInput,- type RegistryApiKey,} from '../lib/api'-import { TableHeaderRow } from './TableHeaderRow'-import type { TableHeaderColumn } from './TableHeaderRow/types'-import { TablePanelHeader } from './TablePanelHeader'import { useConfirmDialog } from './ConfirmDialog'import CreateApiKeyModal from './CreateApiKeyModal'import RevealApiKeyModal from './RevealApiKeyModal'+import { TableHeaderRow } from './TableHeaderRow'+import type { TableHeaderColumn } from './TableHeaderRow/types'+import { TablePanelHeader } from './TablePanelHeader'import { useToast } from './Toast'import { Button } from './ui'@@ -114,12 +115,7 @@ export default function RegistryApiKeysPanel() {title={`API keys${isReady ? ` for @${(view as { org: string }).org}` : ''}`}actions={isReady ? (- <Button- type="button"- variant="primary"- size="sm"- onClick={() => setCreating(true)}- >+ <Button type="button" variant="primary" size="sm" onClick={() => setCreating(true)}>+ Create key</Button>) : null@@ -141,17 +137,16 @@ export default function RegistryApiKeysPanel() {</p>) : null}{view.kind === 'auth-disabled' ? (- <p className="cu-banner">Registry authentication is disabled in this environment.</p>+ <p className="cu-banner cu-banner--info">+ Registry authentication is disabled, so API keys can't be created here. To enable+ it, set <code>CLERUM_REGISTRY_AUTH_ENABLED=true</code> and restart control-api, then+ reload this page.+ </p>) : null}{view.kind === 'error' ? (<p className="cu-banner cu-banner--warn">Could not load API keys.{' '}- <Button- type="button"- variant="ghost"- size="sm"- onClick={() => void load()}- >+ <Button type="button" variant="ghost" size="sm" onClick={() => void load()}>Retry</Button></p>@@ -201,9 +196,7 @@ export default function RegistryApiKeysPanel() {{creating ? (<CreateApiKeyModal onCreate={handleCreate} onCancel={() => setCreating(false)} />) : null}- {revealed ? (- <RevealApiKeyModal apiKey={revealed} onClose={() => setRevealed(null)} />- ) : null}+ {revealed ? <RevealApiKeyModal apiKey={revealed} onClose={() => setRevealed(null)} /> : null}{confirmDialog}</section>)diff --git a/control-ui/components/RegistryConnectPanel.tsx b/control-ui/components/RegistryConnectPanel.tsxindex 763da5ccc..b78597b58 100644--- a/control-ui/components/RegistryConnectPanel.tsx+++ b/control-ui/components/RegistryConnectPanel.tsx@@ -18,7 +18,7 @@ type View =| { kind: 'pending'; deploymentId?: string; requestedOrgName?: string }| { kind: 'approved'; deploymentId?: string; requestedOrgName?: string }| { kind: 'rejected'; requestedOrgName?: string }- | { kind: 'connected'; org?: string }+ | { kind: 'connected'; org?: string; authEnabled?: boolean }| { kind: 'not-self-hosted' }| { kind: 'error' }@@ -41,7 +41,8 @@ export default function RegistryConnectPanel() {const load = useCallback(async () => {try {const s = await getRegistryConnection()- if (s.state === 'connected') setView({ kind: 'connected', org: s.org })+ if (s.state === 'connected')+ setView({ kind: 'connected', org: s.org, authEnabled: s.authEnabled })else if (s.state === 'approved')setView({kind: 'approved',@@ -308,6 +309,14 @@ export default function RegistryConnectPanel() {deployment can now publish entries and push/pull images.</p>) : null}++ {view.kind === 'connected' && view.authEnabled === false ? (+ <p className="cu-banner cu-banner--info" role="status">+ To create and manage API keys for programmatic publishing, enable registry+ authentication: set <code>CLERUM_REGISTRY_AUTH_ENABLED=true</code> and restart+ control-api. See the "connect to registry" guide for details.+ </p>+ ) : null}</div></div>{confirmDialog}diff --git a/control-ui/components/__tests__/RegistryApiKeysPanel.test.tsx b/control-ui/components/__tests__/RegistryApiKeysPanel.test.tsxindex 164b234dc..a22771fc0 100644--- a/control-ui/components/__tests__/RegistryApiKeysPanel.test.tsx+++ b/control-ui/components/__tests__/RegistryApiKeysPanel.test.tsx@@ -68,12 +68,14 @@ describe('RegistryApiKeysPanel', () => {expect(await screen.findByText(/not bound to a registry org/i)).toBeInTheDocument()})- it('shows the dev-mode notice on 409 registry_auth_disabled', async () => {+ it('shows actionable guidance to enable registry auth on 409 registry_auth_disabled', async () => {vi.mocked(api.listRegistryApiKeys).mockRejectedValue(Object.assign(new Error('x'), { status: 409, code: 'registry_auth_disabled' }))render(<RegistryApiKeysPanel />)expect(await screen.findByText(/registry authentication is disabled/i)).toBeInTheDocument()+ expect(screen.getByText('CLERUM_REGISTRY_AUTH_ENABLED=true')).toBeInTheDocument()+ expect(screen.getByText(/restart/i)).toBeInTheDocument()})it('on create success, shows the reveal modal then refetches', async () => {@@ -81,7 +83,11 @@ describe('RegistryApiKeysPanel', () => {.mockResolvedValueOnce({ org: 'acme', keys: [] }).mockResolvedValueOnce({ org: 'acme', keys: [key] })vi.mocked(api.createRegistryApiKey).mockResolvedValue({- id: 'k1', key: 'efrk_secret', key_prefix: 'efrk_abc', scopes: [], expires_at: null,+ id: 'k1',+ key: 'efrk_secret',+ key_prefix: 'efrk_abc',+ scopes: [],+ expires_at: null,})render(<RegistryApiKeysPanel />)fireEvent.click(await screen.findByRole('button', { name: /create key/i }))@@ -163,8 +169,18 @@ describe('RegistryApiKeysPanel', () => {})it('default sort: two keys with different created_at render newest-first', async () => {- const olderKey = { ...key, id: 'k-old', key_prefix: 'efrk_old', created_at: '2026-01-01T00:00:00Z' }- const newerKey = { ...key, id: 'k-new', key_prefix: 'efrk_new', created_at: '2026-06-01T00:00:00Z' }+ const olderKey = {+ ...key,+ id: 'k-old',+ key_prefix: 'efrk_old',+ created_at: '2026-01-01T00:00:00Z',+ }+ const newerKey = {+ ...key,+ id: 'k-new',+ key_prefix: 'efrk_new',+ created_at: '2026-06-01T00:00:00Z',+ }vi.mocked(api.listRegistryApiKeys).mockResolvedValue({org: 'acme',keys: [olderKey, newerKey],diff --git a/control-ui/components/__tests__/RegistryConnectPanel.test.tsx b/control-ui/components/__tests__/RegistryConnectPanel.test.tsxindex df118b696..5cc6c3d58 100644--- a/control-ui/components/__tests__/RegistryConnectPanel.test.tsx+++ b/control-ui/components/__tests__/RegistryConnectPanel.test.tsx@@ -146,4 +146,32 @@ describe('RegistryConnectPanel', () => {render(<RegistryConnectPanel />)await waitFor(() => expect(screen.getByText('Disconnect')).toBeInTheDocument())})++ it('connected + authEnabled:false → shows guidance to enable registry auth for API keys', async () => {+ vi.mocked(api.getRegistryConnection).mockResolvedValue({+ state: 'connected',+ deploymentId: 'd',+ org: 'acme',+ authEnabled: false,+ })+ render(<RegistryConnectPanel />)+ await waitFor(() =>+ expect(screen.getByText(/enable registry authentication/i)).toBeInTheDocument()+ )+ expect(screen.getByText('CLERUM_REGISTRY_AUTH_ENABLED=true')).toBeInTheDocument()+ })++ it('connected + authEnabled:true → does not show the enable-auth guidance', async () => {+ vi.mocked(api.getRegistryConnection).mockResolvedValue({+ state: 'connected',+ deploymentId: 'd',+ org: 'acme',+ authEnabled: true,+ })+ render(<RegistryConnectPanel />)+ await waitFor(() =>+ expect(screen.getByText(/Connected to the Evenfire Registry/)).toBeInTheDocument()+ )+ expect(screen.queryByText(/enable registry authentication/i)).toBeNull()+ })})diff --git a/control-ui/lib/api.ts b/control-ui/lib/api.tsindex 8259003f8..90f1596bc 100644--- a/control-ui/lib/api.ts+++ b/control-ui/lib/api.ts@@ -3079,6 +3079,7 @@ export type RegistryConnectionStatus = {deploymentId?: stringrequestedOrgName?: stringorg?: string+ authEnabled?: boolean}export async function getRegistryConnection(): Promise<RegistryConnectionStatus> {