All files / features / container-registries containerRegistriesCrudConfig.ts

100% Statements 2/2
100% Branches 0/0
100% Functions 0/0
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3766x                                                               66x        
import type { CrudFieldConfig, CrudFieldType } from '@/layers/interfaces'
 
export const CONTAINER_REGISTRY_FIELD_SET: CrudFieldConfig[] = [
  {
    field: 'name',
    title: 'Name',
    description:
      'Unique registry name — the key for image references (<registry>/<image>:<tag>)',
    validation: { required: true, minLength: 3, maxLength: 100 },
  },
  {
    field: 'url',
    title: 'URL',
    description: 'OCI registry endpoint, e.g. https://registry.gitlab.com',
    validation: {
      required: true,
      pattern: '^[a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/[^\\s]+$',
      patternMessage: 'Must be a valid absolute URL with a scheme and host',
    },
  },
  {
    field: 'username',
    title: 'Username',
    description: 'Username for authenticated pulls; leave empty for public registries',
  },
  {
    field: 'token',
    title: 'Token',
    description:
      'Write-only — encrypted at rest (AES-256-GCM), never returned in responses. Edit: leave empty to keep the current token.',
  },
]
 
export const CONTAINER_REGISTRY_FIELD_TYPES: Record<string, CrudFieldType> = {
  token: 'password',
}