jwt.constants.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @ts-nocheck
  2. import { JwtSecretUpdateError, JwtSecretUpdateProgress } from '@supabase/shared-types/out/events'
  3. import { JWTSigningKey } from '@/data/jwt-signing-keys/jwt-signing-keys-query'
  4. export const statusLabels: Record<JWTSigningKey['status'], string> = {
  5. in_use: 'Current key',
  6. standby: 'Standby key',
  7. previously_used: 'Previous key',
  8. revoked: 'Revoked',
  9. }
  10. export const statusColors: Record<JWTSigningKey['status'], string> = {
  11. standby: 'bg-surface-300 text-foreground border border-foreground-muted',
  12. in_use: 'bg-brand-200 text-brand-600 border-brand-500',
  13. previously_used: 'bg-warning-200 text-warning-600 border-warning-500',
  14. revoked: 'bg-destructive-200 text-destructive-600 border-destructive-500',
  15. }
  16. export const JWT_SECRET_UPDATE_ERROR_MESSAGES = {
  17. [JwtSecretUpdateError.APIServicesConfigurationUpdateFailed]:
  18. 'failed to update configuration for API services',
  19. [JwtSecretUpdateError.APIServicesRestartFailed]: 'failed to restart API services',
  20. [JwtSecretUpdateError.DatabaseAdminAPIConfigurationUpdateFailed]:
  21. 'failed to update configuration for database admin API',
  22. [JwtSecretUpdateError.PostgreSQLRestartFailed]: 'failed to restart PostgreSQL service',
  23. [JwtSecretUpdateError.BrivenAPIKeyUpdateFailed]: 'failed to update Briven API key',
  24. [JwtSecretUpdateError.APIGatewayUpdateFailed]: 'failed to update API Gateway',
  25. }
  26. export const JWT_SECRET_UPDATE_PROGRESS_MESSAGES = {
  27. [JwtSecretUpdateProgress.RestartedAPIServices]: 'restarted API services',
  28. [JwtSecretUpdateProgress.RestartedPostgreSQL]: 'restarted PostgreSQL service',
  29. [JwtSecretUpdateProgress.Started]: 'started updating',
  30. [JwtSecretUpdateProgress.UpdatedAPIServicesConfiguration]:
  31. 'updated configuration for API services',
  32. [JwtSecretUpdateProgress.UpdatedDatabaseAdminAPIConfiguration]:
  33. 'updated configuration for database admin API',
  34. [JwtSecretUpdateProgress.UpdatedAPIGatewayConfiguration]: 'updated configuration for API Gateway',
  35. }