Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

Remove API keys section from Settings page (#7031)

r33drichards4bcf5dcc5e54
diff --git a/libs/fleet/e2e/settings.spec.ts b/libs/fleet/e2e/settings.spec.ts
index c4e7f4fb18..807d2ae7a1 100644
--- a/libs/fleet/e2e/settings.spec.ts
+++ b/libs/fleet/e2e/settings.spec.ts
@@ -114,7 +114,7 @@ test.describe("Settings GitHub trust policies", () => {
).toHaveLength(1)
})
- test("orders account, API keys, GitHub OIDC, and payment method", async ({
+ test("orders account, payment method, and GitHub OIDC", async ({
page,
}) => {
await page.route("**/api/config", route =>
@@ -140,41 +140,35 @@ test.describe("Settings GitHub trust policies", () => {
name: "Account",
exact: true,
})
- const apiKeysHeading = page.getByRole("heading", {
- name: "API keys",
- exact: true,
- })
const githubToggle = page.getByRole("button", {
name: "GitHub Actions OIDC",
})
await expect(page.getByRole("heading", { name: "Settings" })).toBeVisible()
await expect(accountHeading).toBeVisible()
- await expect(apiKeysHeading).toBeVisible()
await expect(paymentHeading).toBeVisible()
await expect(githubToggle).toBeVisible()
+ await expect(
+ page.getByRole("heading", { name: "API keys", exact: true }),
+ ).toHaveCount(0)
const sectionOrder = await page.evaluate(() => {
const elements = [...document.querySelectorAll("h1, h2, h3, h4, button")]
const indexOf = (label: string) =>
elements.findIndex(element => element.textContent?.trim().startsWith(label))
return [
indexOf("Account"),
- indexOf("API keys"),
- indexOf("GitHub Actions OIDC"),
indexOf("Payment method"),
+ indexOf("GitHub Actions OIDC"),
]
})
expect(sectionOrder.every(index => index >= 0)).toBe(true)
expect(sectionOrder).toEqual([...sectionOrder].sort((a, b) => a - b))
- await page.getByRole("button", { name: "Manage API keys" }).click()
- await expect(page).toHaveURL(/\/user-keys$/)
- await page.goto("/settings")
await expect(page.getByLabel("Display name")).toBeHidden()
await githubToggle.click()
await expect(page.getByLabel("Display name")).toBeVisible()
})
- test("keeps account and API keys usable when GitHub settings fail", async ({ page }) => {
+ test("keeps account usable when GitHub settings fail", async ({ page }) => {
await page.unroute("**/api/github-trust-policies")
await page.route("**/api/github-trust-policies", route =>
route.fulfill({ status: 503, body: "temporarily unavailable" }),
@@ -182,7 +176,6 @@ test.describe("Settings GitHub trust policies", () => {
await page.goto("/settings")
await expect(page.getByRole("heading", { name: "Account" })).toBeVisible()
- await expect(page.getByRole("button", { name: "Manage API keys" })).toBeVisible()
await expect(
page.getByText("GitHub Actions settings are unavailable. Expand to retry."),
).toBeVisible()
diff --git a/libs/fleet/src/pages/Settings.tsx b/libs/fleet/src/pages/Settings.tsx
index 9d118ddc9c..7155a4bf62 100644
--- a/libs/fleet/src/pages/Settings.tsx
+++ b/libs/fleet/src/pages/Settings.tsx
@@ -2,7 +2,6 @@
// policies for backend automation.
import { useEffect, useMemo, useState } from "react"
-import { useNavigate } from "react-router-dom"
import Alert from "@cloudscape-design/components/alert"
import Box from "@cloudscape-design/components/box"
import Container from "@cloudscape-design/components/container"
@@ -26,7 +25,6 @@ import { useFeatureFlags } from "../components/FeatureFlagContext"
import { useFlash } from "../components/FlashContext"
import { PageEmpty, PageError } from "../components/PageState"
import { PageShell } from "../components/PageShell"
-import { localVisualPreviewPath } from "../local-visual-preview"
import {
type GitHubTrustPolicy,
githubTrustPoliciesApi,
@@ -35,7 +33,6 @@ import {
import { BillingSettings } from "./Billing"
export function Settings() {
- const navigate = useNavigate()
const flash = useFlash()
const { sub, name } = userInfo()
const { billing } = useFeatureFlags()
@@ -245,7 +242,7 @@ steps:
<PageShell
eyebrow="Account"
title="Settings"
- description="Manage your identity, credentials, automation access, and payment method."
+ description="Manage your identity, payment method, and automation access."
>
<SpaceBetween size="l">
<Container
@@ -290,28 +287,7 @@ steps:
</SpaceBetween>
</Container>
- <Container
- header={
- <Header
- variant="h2"
- description="API keys are managed remotely and changes take effect immediately."
- actions={
- <CuaButton
- onClick={() => navigate(localVisualPreviewPath("/user-keys"))}
- >
- Manage API keys
- </CuaButton>
- }
- >
- API keys
- </Header>
- }
- >
- <Box color="text-body-secondary">
- Create scoped credentials for local tools, CI workflows, and other
- automation that calls Cua on your behalf.
- </Box>
- </Container>
+ {billing && <BillingSettings />}
<ExpandableSection
variant="container"
@@ -509,8 +485,6 @@ steps:
)}
</ExpandableSection>
- {billing && <BillingSettings />}
-
{confirmDelete && (
<Modal
visible