auth-nav.ts146 lines · main
1// @ts-nocheck
2import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'
3import { RegistryDefinations } from '../types'
4
5/**
6 * Contextual chords for jumping between Authentication sub-pages — `A + <letter>`.
7 *
8 * Active only while AuthLayout is mounted (i.e. the user is somewhere under
9 * `/project/<ref>/auth/*`). Mirrors the database-nav pattern: the leading `A`
10 * is layout-scoped so it doesn't burn a global key.
11 */
12export const AUTH_NAV_SHORTCUT_IDS = {
13 NAV_AUTH_OVERVIEW: 'nav.auth-overview',
14 NAV_AUTH_USERS: 'nav.auth-users',
15 NAV_AUTH_OAUTH_APPS: 'nav.auth-oauth-apps',
16 NAV_AUTH_EMAIL: 'nav.auth-email',
17 NAV_AUTH_POLICIES: 'nav.auth-policies',
18 NAV_AUTH_SIGN_IN: 'nav.auth-sign-in',
19 NAV_AUTH_PASSKEYS: 'nav.auth-passkeys',
20 NAV_AUTH_OAUTH_SERVER: 'nav.auth-oauth-server',
21 NAV_AUTH_SESSIONS: 'nav.auth-sessions',
22 NAV_AUTH_RATE_LIMITS: 'nav.auth-rate-limits',
23 NAV_AUTH_MFA: 'nav.auth-mfa',
24 NAV_AUTH_URL_CONFIGURATION: 'nav.auth-url-configuration',
25 NAV_AUTH_PROTECTION: 'nav.auth-protection',
26 NAV_AUTH_HOOKS: 'nav.auth-hooks',
27 NAV_AUTH_AUDIT_LOGS: 'nav.auth-audit-logs',
28 NAV_AUTH_PERFORMANCE: 'nav.auth-performance',
29}
30
31export type AuthNavShortcutId = (typeof AUTH_NAV_SHORTCUT_IDS)[keyof typeof AUTH_NAV_SHORTCUT_IDS]
32
33export const authNavRegistry: RegistryDefinations<AuthNavShortcutId> = {
34 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OVERVIEW]: {
35 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OVERVIEW,
36 label: 'Go to Overview',
37 sequence: ['A', 'O'],
38 showInSettings: false,
39 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
40 },
41 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_USERS]: {
42 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_USERS,
43 label: 'Go to Users',
44 sequence: ['A', 'U'],
45 showInSettings: false,
46 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
47 },
48 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OAUTH_APPS]: {
49 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OAUTH_APPS,
50 label: 'Go to OAuth Apps',
51 sequence: ['A', 'A'],
52 showInSettings: false,
53 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
54 },
55 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_EMAIL]: {
56 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_EMAIL,
57 label: 'Go to Email',
58 sequence: ['A', 'E'],
59 showInSettings: false,
60 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
61 },
62 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_POLICIES]: {
63 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_POLICIES,
64 label: 'Go to Policies',
65 sequence: ['A', 'P'],
66 showInSettings: false,
67 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
68 },
69 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_SIGN_IN]: {
70 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_SIGN_IN,
71 label: 'Go to Sign In / Providers',
72 sequence: ['A', 'I'],
73 showInSettings: false,
74 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
75 },
76 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PASSKEYS]: {
77 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PASSKEYS,
78 label: 'Go to Passkeys',
79 sequence: ['A', 'K'],
80 showInSettings: false,
81 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
82 },
83 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OAUTH_SERVER]: {
84 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_OAUTH_SERVER,
85 label: 'Go to OAuth Server',
86 sequence: ['A', 'V'],
87 showInSettings: false,
88 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
89 },
90 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_SESSIONS]: {
91 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_SESSIONS,
92 label: 'Go to Sessions',
93 sequence: ['A', 'S'],
94 showInSettings: false,
95 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
96 },
97 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_RATE_LIMITS]: {
98 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_RATE_LIMITS,
99 label: 'Go to Rate Limits',
100 sequence: ['A', 'R'],
101 showInSettings: false,
102 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
103 },
104 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_MFA]: {
105 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_MFA,
106 label: 'Go to Multi-Factor',
107 sequence: ['A', 'M'],
108 showInSettings: false,
109 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
110 },
111 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_URL_CONFIGURATION]: {
112 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_URL_CONFIGURATION,
113 label: 'Go to URL Configuration',
114 sequence: ['A', 'L'],
115 showInSettings: false,
116 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
117 },
118 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PROTECTION]: {
119 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PROTECTION,
120 label: 'Go to Attack Protection',
121 sequence: ['A', 'T'],
122 showInSettings: false,
123 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
124 },
125 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_HOOKS]: {
126 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_HOOKS,
127 label: 'Go to Auth Hooks',
128 sequence: ['A', 'H'],
129 showInSettings: false,
130 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
131 },
132 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_AUDIT_LOGS]: {
133 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_AUDIT_LOGS,
134 label: 'Go to Audit Logs',
135 sequence: ['A', 'G'],
136 showInSettings: false,
137 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
138 },
139 [AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PERFORMANCE]: {
140 id: AUTH_NAV_SHORTCUT_IDS.NAV_AUTH_PERFORMANCE,
141 label: 'Go to Performance',
142 sequence: ['A', 'F'],
143 showInSettings: false,
144 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
145 },
146}