Skip to content

Commit 012f3f4

Browse files
samejrTrigger.dev RepoOps
authored andcommitted
feat(webapp): add a Security section to the side menu
The side menu has a new Security section, just above Manage, that groups API keys, Environment variables, Trusted publishing and OIDC. Mono-RevId: 0b47f053d9e16fc7b3f40673b667057580d5f0fd
1 parent d48b9b2 commit 012f3f4

5 files changed

Lines changed: 47 additions & 33 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
The side menu has a new Security section, just above Manage, that groups API keys, Environment variables, Trusted publishing and OIDC.

‎apps/webapp/app/components/navigation/sideMenuSections.tsx‎

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,6 @@ export function buildSideMenuSections({
228228
to: v3DeploymentsPath(organization, project, environment),
229229
dataAction: "deployments",
230230
},
231-
{
232-
id: "environment-variables",
233-
name: "Environment variables",
234-
icon: IDIcon,
235-
activeIconColor: "text-environmentVariables",
236-
to: v3EnvironmentVariablesPath(organization, project, environment),
237-
dataAction: "environment variables",
238-
},
239231
{
240232
id: "preview-branches",
241233
name: "Preview branches",
@@ -252,6 +244,29 @@ export function buildSideMenuSections({
252244
to: regionsPath(organization, project, environment),
253245
dataAction: "regions",
254246
},
247+
],
248+
});
249+
250+
staticSections.push({
251+
id: "security",
252+
title: "Security",
253+
items: [
254+
{
255+
id: "api-keys",
256+
name: "API keys",
257+
icon: KeyIcon,
258+
activeIconColor: "text-text-bright",
259+
to: v3ApiKeysPath(organization, project, environment),
260+
dataAction: "api keys",
261+
},
262+
{
263+
id: "environment-variables",
264+
name: "Environment variables",
265+
icon: IDIcon,
266+
activeIconColor: "text-environmentVariables",
267+
to: v3EnvironmentVariablesPath(organization, project, environment),
268+
dataAction: "environment variables",
269+
},
255270
...(featureFlags.trustedDeploysEnabled
256271
? [
257272
{
@@ -264,6 +279,19 @@ export function buildSideMenuSections({
264279
} satisfies SideMenuItemConfig,
265280
]
266281
: []),
282+
...(isManagedCloud && featureFlags.oidcEnabled
283+
? [
284+
{
285+
id: "oidc",
286+
name: "OIDC",
287+
icon: ShieldIcon,
288+
activeIconColor: "text-text-bright",
289+
to: v3OidcPath(organization, project, environment),
290+
dataAction: "oidc",
291+
badge: <NewBadge />,
292+
} satisfies SideMenuItemConfig,
293+
]
294+
: []),
267295
],
268296
});
269297

@@ -295,27 +323,6 @@ export function buildSideMenuSections({
295323
to: v3BulkActionsPath(organization, project, environment),
296324
dataAction: "bulk actions",
297325
},
298-
{
299-
id: "api-keys",
300-
name: "API keys",
301-
icon: KeyIcon,
302-
activeIconColor: "text-text-bright",
303-
to: v3ApiKeysPath(organization, project, environment),
304-
dataAction: "api keys",
305-
},
306-
...(isManagedCloud && featureFlags.oidcEnabled
307-
? [
308-
{
309-
id: "oidc",
310-
name: "OIDC",
311-
icon: ShieldIcon,
312-
activeIconColor: "text-text-bright",
313-
to: v3OidcPath(organization, project, environment),
314-
dataAction: "oidc",
315-
badge: <NewBadge />,
316-
} satisfies SideMenuItemConfig,
317-
]
318-
: []),
319326
...(alertsInObservability ? [] : [alertsItem]),
320327
...(isManagedCloud
321328
? [

‎apps/webapp/app/components/navigation/sideMenuTypes.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const SideMenuSectionIdSchema = z.enum([
77
"manage",
88
"metrics",
99
"deployments",
10+
"security",
1011
"project-settings",
1112
"tasks",
1213
]);

‎apps/webapp/test/sideMenuSections.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe("buildSideMenuSections alerts placement", () => {
7575

7676
const manage = sections.find((s) => s.id === "manage")!;
7777
const ids = manage.items.map((i) => i.id);
78-
expect(ids.indexOf("alerts")).toBe(ids.indexOf("api-keys") + 1);
78+
expect(ids.indexOf("alerts")).toBe(ids.indexOf("bulk-actions") + 1);
7979
const alerts = manage.items.find((i) => i.id === "alerts")!;
8080
expect(alerts.badge).toBeUndefined();
8181
expect(alerts.matchPrefix).toBeUndefined();
@@ -97,11 +97,11 @@ describe("buildSideMenuSections alerts placement", () => {
9797
expect(manage.items.some((i) => i.id === "alerts")).toBe(false);
9898
});
9999

100-
it("keeps Alerts in Manage after API keys when Observability is hidden", () => {
100+
it("keeps Alerts in Manage after Bulk actions when Observability is hidden", () => {
101101
const sections = build(false);
102102
expect(sections.some((s) => s.id === "metrics")).toBe(false);
103103

104104
const ids = sections.find((s) => s.id === "manage")!.items.map((i) => i.id);
105-
expect(ids.indexOf("alerts")).toBe(ids.indexOf("api-keys") + 1);
105+
expect(ids.indexOf("alerts")).toBe(ids.indexOf("bulk-actions") + 1);
106106
});
107107
});

‎docs/deployment/trusted-publishing.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Trusted publishing uses GitHub Actions OIDC tokens to authorize deployments. No
77

88
## Configure trust
99

10-
1. Select **Staging**, **Preview**, or **Production**, then open [**Trusted publishing**](https://cloud.trigger.dev/_/trusted-publishing) under **Deployments**.
10+
1. Select **Staging**, **Preview**, or **Production**, then open [**Trusted publishing**](https://cloud.trigger.dev/_/trusted-publishing) under **Security**.
1111
2. Enter the **Organization or user** and **Repository**, then click **Save**. This repository configuration applies to the whole project.
1212
3. Click **Enable** for the selected environment. Choose a **Scope by** option (see [Scope and additional claims](#scope-and-additional-claims)), then click **Save** to allow publishing.
1313
4. Configure each environment separately. Preview settings apply to **all Preview branches**.

0 commit comments

Comments
 (0)