From ea128311115dc83d564cf22c7e39550dbc6c8213 Mon Sep 17 00:00:00 2001 From: John Coffey Date: Thu, 19 Nov 2026 09:20:23 -0700 Subject: [PATCH] =?UTF-8?q?Passkeys:=20your=20own=20under=20Account=20?= =?UTF-8?q?=E2=80=BA=20Credentials=20(#250)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A Passkeys page in the console's Account section shows the same card as Directory › Accounts, for the signed-in account: list, add, rename and remove your own passkeys without access to the account list. It's the CustomComponent/Passkeys link the server puts under Credentials, shown to accounts that may read passkeys. The administrator view is unchanged. Needs the server's menu link (inbuxa-server, Account › Credentials › Passkeys); against an older server the page simply isn't linked. --- src/components/layout/MainContent.tsx | 5 +++++ src/features/passkeys/OwnPasskeysPage.tsx | 22 ++++++++++++++++++++++ src/lib/layout.test.ts | 5 +++++ src/lib/layout.ts | 2 ++ 4 files changed, 34 insertions(+) create mode 100644 src/features/passkeys/OwnPasskeysPage.tsx diff --git a/src/components/layout/MainContent.tsx b/src/components/layout/MainContent.tsx index 1792ca6..396e1e5 100644 --- a/src/components/layout/MainContent.tsx +++ b/src/components/layout/MainContent.tsx @@ -118,6 +118,11 @@ const CUSTOM_PAGES: Record = { () => import('@/features/deletedAccounts/DeletedAccountsPage'), (m) => m.DeletedAccountsPage, ), + // Account › Credentials: the signed-in account's own passkeys (#250) + Passkeys: onDemand( + () => import('@/features/passkeys/OwnPasskeysPage'), + (m) => m.OwnPasskeysPage, + ), Deliverability: onDemand( () => import('@/features/deliverability/DeliverabilityPage'), (m) => m.DeliverabilityPage, diff --git a/src/features/passkeys/OwnPasskeysPage.tsx b/src/features/passkeys/OwnPasskeysPage.tsx new file mode 100644 index 0000000..89a7bf0 --- /dev/null +++ b/src/features/passkeys/OwnPasskeysPage.tsx @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: 2026 Coffey Labs LLC + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +/** + * INBUXA: Account › Credentials › Passkeys (#250). The same card an + * administrator sees on Directory › Accounts, for the signed-in account, so + * anyone who can open the console manages their own passkeys without + * needing access to the account list. + */ + +import { Loader2 } from 'lucide-react'; +import { useAuthStore } from '@/stores/authStore'; +import { PasskeysPanel } from './PasskeysPanel'; + +export function OwnPasskeysPage() { + const accountId = useAuthStore((s) => s.primaryAccountId); + if (!accountId) return ; + return ; +} diff --git a/src/lib/layout.test.ts b/src/lib/layout.test.ts index e28b491..c673069 100644 --- a/src/lib/layout.test.ts +++ b/src/lib/layout.test.ts @@ -67,6 +67,11 @@ describe('layout visibility', () => { expect(visibleLayouts(schema, 'enterprise', ehlo).map((l) => l.name)).toEqual(['Settings']); }); + it('shows your own passkeys to an account that may read passkeys (#250)', () => { + expect(isLinkVisible(schema, 'CustomComponent/Passkeys', 'oss', canGetFrom(['sysPasskeyGet']))).toBe(true); + expect(isLinkVisible(schema, 'CustomComponent/Passkeys', 'oss', canGetFrom([]))).toBe(false); + }); + it('hides a page this console cannot draw', () => { const all = () => true; expect(isLinkVisible(schema, 'CustomComponent/NotInThisConsole', 'enterprise', all)).toBe(false); diff --git a/src/lib/layout.ts b/src/lib/layout.ts index 8c2789f..e4cba50 100644 --- a/src/lib/layout.ts +++ b/src/lib/layout.ts @@ -65,6 +65,8 @@ const PAGES: Record = { 'CustomComponent/SharedMailboxes': readOnly('sysAccountLock'), 'CustomComponent/DeletedAccounts': readOnly('sysAccount'), 'CustomComponent/Deliverability': readOnly('sysDeliverability'), + // Your own passkeys, under Account › Credentials (#250) + 'CustomComponent/Passkeys': readOnly('sysPasskey'), 'CustomComponent/ScheduledReports': readOnly('sysScheduledReport'), // A migration has no read permission of its own: running one is the right 'CustomComponent/Migrations': { enterprise: false, visible: (c) => holds('sysMigrationRun', c) }, -- 2.54.0