auth-nav.ts 5.2 KB

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