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