Skip to content

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

TypeScript

fix(control-ui): move API keys to Marketplace menu

Miguelon Peluchona390ea2894f7
diff --git a/control-ui/app/constants/routes.ts b/control-ui/app/constants/routes.ts
index ed36e8c04..70bf942d5 100644
--- a/control-ui/app/constants/routes.ts
+++ b/control-ui/app/constants/routes.ts
@@ -73,6 +73,7 @@ export const CONTROL_ROUTES = {
plugins: '/marketplace/plugins',
install: (query?: ControlRouteQuery) => withQuery('/marketplace/install', query),
publish: (query?: ControlRouteQuery) => withQuery('/marketplace/publish', query),
+ keys: '/marketplace/keys',
connect: '/marketplace/connect',
entry: (name: string, version: string) =>
`/marketplace/entries/${segment(name)}/${segment(version)}`,
@@ -101,7 +102,6 @@ export const CONTROL_ROUTES = {
entries: '/publisher/entries',
sharedWithMe: '/publisher/shared-with-me',
credentials: '/publisher/credentials',
- apiKeys: '/publisher/api-keys',
},
secrets: {
root: '/secrets',
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index 68d9dcc12..90c379468 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -2169,6 +2169,12 @@ textarea.cu-input {
min-width: 0;
}
+.cu-table-panel__title-row {
+ display: flex;
+ align-items: center;
+ gap: var(--cu-space-1);
+}
+
.cu-table-panel__subtitle {
margin: 0;
font-size: 0.75rem;
diff --git a/control-ui/app/publisher/api-keys/page.tsx b/control-ui/app/publisher/api-keys/page.tsx
index f79943129..703b05807 100644
--- a/control-ui/app/publisher/api-keys/page.tsx
+++ b/control-ui/app/publisher/api-keys/page.tsx
@@ -1,5 +1,6 @@
-import { PublisherPageContent } from '../PublisherPageContent'
+import { redirect } from 'next/navigation'
+import { CONTROL_ROUTES } from '@constants/routes'
export default function PublisherApiKeysPage() {
- return <PublisherPageContent activeTab="api-keys" />
+ redirect(CONTROL_ROUTES.marketplace.keys)
}
diff --git a/control-ui/app/registry/keys/page.tsx b/control-ui/app/registry/keys/page.tsx
index 93c1cd0c1..cc2c42915 100644
--- a/control-ui/app/registry/keys/page.tsx
+++ b/control-ui/app/registry/keys/page.tsx
@@ -1,6 +1,13 @@
-import { redirect } from 'next/navigation'
-import { CONTROL_ROUTES } from '@constants/routes'
+import { AuthGate } from '@components/AuthGate'
+import { DashboardLayout } from '@components/DashboardLayout'
+import RegistryApiKeysPanel from '@components/RegistryApiKeysPanel'
export default function RegistryKeysPage() {
- redirect(CONTROL_ROUTES.publisher.apiKeys)
+ return (
+ <AuthGate>
+ <DashboardLayout isDetailPage>
+ <RegistryApiKeysPanel />
+ </DashboardLayout>
+ </AuthGate>
+ )
}
diff --git a/control-ui/components/PublishToRegistryForm.tsx b/control-ui/components/PublishToRegistryForm.tsx
index 1464a4fa6..65f749194 100644
--- a/control-ui/components/PublishToRegistryForm.tsx
+++ b/control-ui/components/PublishToRegistryForm.tsx
@@ -587,7 +587,7 @@ export function PublishToRegistryForm({
</p>
<p className="cu-field__hint">
Need a key to publish from CI or a script?{' '}
- <a href={CONTROL_ROUTES.publisher.apiKeys}>Manage API keys →</a>
+ <a href={CONTROL_ROUTES.marketplace.keys}>Manage API keys →</a>
</p>
</div>
))}
diff --git a/control-ui/components/PublisherView/index.tsx b/control-ui/components/PublisherView/index.tsx
index 9def530c0..3b62521e2 100644
--- a/control-ui/components/PublisherView/index.tsx
+++ b/control-ui/components/PublisherView/index.tsx
@@ -3,7 +3,6 @@
import { CONTROL_ROUTES } from '@constants/routes'
import { useInboundGrants } from '../../lib/hooks/useInboundGrants'
import { isPublisherEnabled, usePublishScope } from '../../lib/hooks/usePublishScope'
-import RegistryApiKeysPanel from '../RegistryApiKeysPanel'
import { TabBar } from '../TabBar'
import { TablePanelHeader } from '../TablePanelHeader'
import { DockerCredentialsPanel } from './DockerCredentials'
@@ -15,7 +14,6 @@ const TABS: { value: PublisherTab; href: string; label: string }[] = [
{ value: 'entries', href: CONTROL_ROUTES.publisher.entries, label: 'Published entries' },
{ value: 'shared', href: CONTROL_ROUTES.publisher.sharedWithMe, label: 'Shared with me' },
{ value: 'credentials', href: CONTROL_ROUTES.publisher.credentials, label: 'Docker credentials' },
- { value: 'api-keys', href: CONTROL_ROUTES.publisher.apiKeys, label: 'API keys' },
]
export function PublisherView({ activeTab }: { activeTab: PublisherTab }) {
@@ -72,7 +70,6 @@ export function PublisherView({ activeTab }: { activeTab: PublisherTab }) {
<GrantedToMe status={inbound.status} grants={inbound.grants} reload={inbound.reload} />
) : null}
{activeTab === 'credentials' ? <DockerCredentialsPanel orgScope={orgScope} /> : null}
- {activeTab === 'api-keys' ? <RegistryApiKeysPanel embedded /> : null}
</div>
</div>
</section>
diff --git a/control-ui/components/PublisherView/types.ts b/control-ui/components/PublisherView/types.ts
index 539770319..b41d5b4ef 100644
--- a/control-ui/components/PublisherView/types.ts
+++ b/control-ui/components/PublisherView/types.ts
@@ -1 +1 @@
-export type PublisherTab = 'entries' | 'shared' | 'credentials' | 'api-keys'
+export type PublisherTab = 'entries' | 'shared' | 'credentials'
diff --git a/control-ui/components/RegistryApiKeysPanel.tsx b/control-ui/components/RegistryApiKeysPanel.tsx
index badbab491..b6ebaf1ed 100644
--- a/control-ui/components/RegistryApiKeysPanel.tsx
+++ b/control-ui/components/RegistryApiKeysPanel.tsx
@@ -50,7 +50,7 @@ function fmtExpiry(v: string | null): string {
return d.getTime() < Date.now() ? `Expired ${d.toLocaleDateString()}` : d.toLocaleString()
}
-export default function RegistryApiKeysPanel({ embedded = false }: { embedded?: boolean }) {
+export default function RegistryApiKeysPanel() {
const { showToast } = useToast()
const { confirm, confirmDialog } = useConfirmDialog()
const [view, setView] = useState<View>({ kind: 'loading' })
@@ -235,7 +235,7 @@ export default function RegistryApiKeysPanel({ embedded = false }: { embedded?:
return (
<section>
- {embedded ? content : <div className="cu-card cu-card--viewport-fill">{content}</div>}
+ <div className="cu-card cu-card--viewport-fill">{content}</div>
{creating ? (
<CreateApiKeyModal onCreate={handleCreate} onCancel={() => setCreating(false)} />
) : null}
diff --git a/control-ui/components/RegistryCatalog.tsx b/control-ui/components/RegistryCatalog.tsx
index f2818c25d..6d524a133 100644
--- a/control-ui/components/RegistryCatalog.tsx
+++ b/control-ui/components/RegistryCatalog.tsx
@@ -261,6 +261,18 @@ export default function RegistryCatalog() {
{isInitialLoad ? 'Marketplace' : `Marketplace (${filtered.length})`}
</>
}
+ titleActions={
+ <RowActionsMenu
+ ariaLabel="Marketplace actions"
+ actions={[
+ {
+ key: 'api-keys',
+ label: 'Manage API keys',
+ onClick: () => router.push(CONTROL_ROUTES.marketplace.keys),
+ },
+ ]}
+ />
+ }
subtitle="Discover and install connectors and plugins from the Marketplace."
actionsClassName="cu-registry-toolbar"
actions={
diff --git a/control-ui/components/TablePanelHeader/index.tsx b/control-ui/components/TablePanelHeader/index.tsx
index a411c3ad1..0faf54e18 100644
--- a/control-ui/components/TablePanelHeader/index.tsx
+++ b/control-ui/components/TablePanelHeader/index.tsx
@@ -9,11 +9,15 @@ export function TablePanelHeader({
actionsClassName,
subtitle,
title,
+ titleActions,
}: TablePanelHeaderProps) {
return (
<div className="cu-table-panel__head">
<div className="cu-table-panel__heading">
- <span className="cu-panel-title">{title}</span>
+ <div className="cu-table-panel__title-row">
+ <span className="cu-panel-title">{title}</span>
+ {titleActions}
+ </div>
{subtitle ? <p className="cu-table-panel__subtitle">{subtitle}</p> : null}
</div>
{actions ? (
diff --git a/control-ui/components/TablePanelHeader/types.ts b/control-ui/components/TablePanelHeader/types.ts
index e125df52c..4bc72272e 100644
--- a/control-ui/components/TablePanelHeader/types.ts
+++ b/control-ui/components/TablePanelHeader/types.ts
@@ -5,4 +5,5 @@ export type TablePanelHeaderProps = {
actionsClassName?: string
subtitle?: ReactNode
title: ReactNode
+ titleActions?: ReactNode
}
diff --git a/control-ui/components/__tests__/PublisherView.test.tsx b/control-ui/components/__tests__/PublisherView.test.tsx
index eb318493e..f5f8b114d 100644
--- a/control-ui/components/__tests__/PublisherView.test.tsx
+++ b/control-ui/components/__tests__/PublisherView.test.tsx
@@ -14,9 +14,6 @@ vi.mock('../PublisherView/GrantedToMe', () => ({
vi.mock('../PublisherView/DockerCredentials', () => ({
DockerCredentialsPanel: () => <div>docker-credentials-panel</div>,
}))
-vi.mock('../RegistryApiKeysPanel', () => ({
- default: () => <div>api-keys-panel</div>,
-}))
vi.mock('../../lib/hooks/usePublishScope', async orig => {
const actual = await orig<typeof import('../../lib/hooks/usePublishScope')>()
return { ...actual, usePublishScope: vi.fn() }
@@ -96,16 +93,6 @@ describe('PublisherView', () => {
expect(screen.getByText('docker-credentials-panel')).toBeInTheDocument()
})
- it('renders API-key management on the API keys tab', () => {
- vi.mocked(hook.usePublishScope).mockReturnValue({
- scope: { scope: 'acme', curator: false, orgName: 'Acme' },
- loading: false,
- error: false,
- })
- render(<PublisherView activeTab="api-keys" />)
- expect(screen.getByText('api-keys-panel')).toBeInTheDocument()
- })
-
it('renders the granted-to-me panel on the shared tab', () => {
vi.mocked(hook.usePublishScope).mockReturnValue({
scope: { scope: 'acme', curator: false, orgName: 'Acme' },
@@ -125,10 +112,6 @@ describe('PublisherView', () => {
render(<PublisherView activeTab="entries" />)
const shared = screen.getByRole('tab', { name: /shared with me/i })
expect(shared).toHaveAttribute('href', '/publisher/shared-with-me')
- expect(screen.getByRole('tab', { name: /^api keys$/i })).toHaveAttribute(
- 'href',
- '/publisher/api-keys'
- )
})
it('hides the "Shared with me" tab when inbound grants are unavailable (403)', () => {
@@ -146,7 +129,6 @@ describe('PublisherView', () => {
expect(screen.queryByRole('tab', { name: /shared with me/i })).toBeNull()
expect(screen.getByRole('tab', { name: /published entries/i })).toBeInTheDocument()
expect(screen.getByRole('tab', { name: /docker credentials/i })).toBeInTheDocument()
- expect(screen.getByRole('tab', { name: /^api keys$/i })).toBeInTheDocument()
})
it('shows the "Shared with me" tab when inbound grants are available', () => {
diff --git a/control-ui/components/__tests__/RegistryCatalog.test.tsx b/control-ui/components/__tests__/RegistryCatalog.test.tsx
index 388a16f65..3856e67f1 100644
--- a/control-ui/components/__tests__/RegistryCatalog.test.tsx
+++ b/control-ui/components/__tests__/RegistryCatalog.test.tsx
@@ -319,6 +319,16 @@ describe('RegistryCatalog controls', () => {
expect(navigation.push).toHaveBeenCalledWith('/marketplace/publish?type=recipe')
})
+ it('opens API-key management from the Marketplace title menu', async () => {
+ mockApiSuccess()
+ render(<RegistryCatalog />)
+
+ fireEvent.click(await screen.findByRole('button', { name: 'Marketplace actions' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Manage API keys' }))
+
+ expect(navigation.push).toHaveBeenCalledWith('/marketplace/keys')
+ })
+
})
describe('RegistryCatalog state handling', () => {
diff --git a/control-ui/e2e/qa-recorder-marketplace-api-keys.spec.ts b/control-ui/e2e/qa-recorder-marketplace-api-keys.spec.ts
index 94f820b40..40696aa53 100644
--- a/control-ui/e2e/qa-recorder-marketplace-api-keys.spec.ts
+++ b/control-ui/e2e/qa-recorder-marketplace-api-keys.spec.ts
@@ -1,6 +1,6 @@
// control-ui/e2e/qa-recorder-marketplace-api-keys.spec.ts
//
-// Optional headful QA recorder journey for the Control UI Publisher ->
+// Optional headful QA recorder journey for the Control UI Marketplace ->
// registry API keys panel. MUTATING: it creates a publish-scoped API key,
// drives the one-time reveal modal, then revokes the key from the table and
// best-effort revokes it through the Control API in finally. Requires
@@ -41,11 +41,11 @@ async function waitForKeyId(request: APIRequestContext, description: string): Pr
throw new Error(`Created API key "${description}" did not appear through Control API.`)
}
-test.describe('optional QA recorder: Control UI publisher API keys', () => {
- test('Publisher API key — create, reveal, revoke', async ({ page }, testInfo) => {
+test.describe('optional QA recorder: Control UI marketplace API keys', () => {
+ test('Marketplace API key — create, reveal, revoke', async ({ page }, testInfo) => {
requireRecorderConfirm(
'QA_RECORDER_CONFIRM_MUTATIONS',
- 'This journey creates and revokes a publisher API key.'
+ 'This journey creates and revokes a marketplace API key.'
)
assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
@@ -57,7 +57,7 @@ test.describe('optional QA recorder: Control UI publisher API keys', () => {
try {
await loginThroughUi(page, credentials)
- await page.goto(`${CONTROL_UI_URL}/publisher/api-keys`)
+ await page.goto(`${CONTROL_UI_URL}/marketplace/keys`)
// The "+ Create key" CTA only renders once the panel reaches its ready
// state, so it doubles as the shell + readiness assertion.
await expect(page.getByRole('button', { name: '+ Create key', exact: true })).toBeVisible({
@@ -102,7 +102,7 @@ test.describe('optional QA recorder: Control UI publisher API keys', () => {
await confirmDialog.getByRole('button', { name: 'Revoke', exact: true }).click()
await expect(page.getByText(description)).toBeHidden({ timeout: 20_000 })
- await screenshotAndLog(page, testInfo, 'control-ui-publisher-api-keys')
+ await screenshotAndLog(page, testInfo, 'control-ui-marketplace-api-keys')
} finally {
const id = keyId || (await findKeyId(page.request, description))
if (id) {
diff --git a/docs/concepts/publisher-and-marketplace.md b/docs/concepts/publisher-and-marketplace.md
index 826350cd8..dd5350f14 100644
--- a/docs/concepts/publisher-and-marketplace.md
+++ b/docs/concepts/publisher-and-marketplace.md
@@ -79,15 +79,15 @@ The **Marketplace** is the catalog surface — what every authenticated admin in
- **Browse** — `/marketplace`. Search/filter by category, mode, transport. Shows public entries from every org.
- **Install** — `/marketplace/install`. Pick an entry, supply credentials if the entry has a credential schema, hit `POST /admin/registry/install` (or `/install-recipe` for plugins). control-api materializes the K8s resource and tags it with `clerum.io/catalog-id` annotations.
- **Detail** — `/marketplace/entries/[name]/[version]`. View metadata, version history, install instructions.
+- **Manage API keys** — `/marketplace/keys`. Generate `efrk_...` keys for CI publishing.
- **Connect** — `/marketplace/connect`. Self-hosted deploys only — bind your deploy to an org.
### 4. Publisher
-The **Publisher** is the *owner-only* surface. Once your deploy is org-bound, a "Publisher" entry appears in the sidebar with four tabs:
+The **Publisher** is the *owner-only* surface. Once your deploy is org-bound, a "Publisher" entry appears in the sidebar with three tabs:
- **Published entries** (`/publisher/entries`) — your org's entries. Expand a row to share it with another org (cross-org grant).
- **Docker credentials** (`/publisher/credentials`) — mint a `efrk_` API key + docker config so CI can `docker push` images for local-mode connectors.
-- **API keys** (`/publisher/api-keys`) — create, scope, expire, and revoke `efrk_` keys for CI and scripts.
- **Shared with me** (`/publisher/shared-with-me`) — entries other orgs have granted to yours.
The whole surface is hidden in the sidebar if your deploy isn't org-bound, or if `CONTROL_API_PUBLISHER_UI_ENABLED=false`.