Skip to content

Refactor virtual key and security interfaces to use generated types #663

@nickna

Description

@nickna

Overview

Part of #658 - Refactor virtual key and security interfaces to use generated types as source of truth.

Scope

Refactor the following files to use generated types:

  • models/virtualKey.ts (15 interfaces)
  • models/security.ts (8 interfaces)
  • models/securityExtended.ts (17 interfaces)
  • models/ipFilter.ts (17 interfaces)

Total: ~57 interfaces

Dependencies

Current State Example

// models/virtualKey.ts
export interface VirtualKeyDto {
  id: string;
  name: string;
  value: string;
  isEnabled: boolean;
  // ... more fields
}

Implementation Considerations

  1. Security-Sensitive Types: These types handle API keys and security rules
  2. Naming Overlap: Both security.ts and securityExtended.ts may have overlapping types
  3. WebUI Dependencies: Virtual keys are heavily used in the UI

Implementation Steps

  1. Map all 57 interfaces to generated equivalents
  2. Identify security-specific validations needed
  3. Convert in order:
    • security.ts (8 interfaces - smallest)
    • virtualKey.ts (15 interfaces)
    • ipFilter.ts (17 interfaces)
    • securityExtended.ts (17 interfaces)
  4. Update service imports
  5. Special attention to security type validations
  6. Build and test

Special Security Considerations

  • Ensure sensitive fields remain properly typed (e.g., API keys as strings)
  • Validate that security rules maintain correct structure
  • Check that IP filter validations remain intact

Validation

  • Type validation tests pass
  • Security-specific type tests added
  • SDK builds successfully
  • WebUI builds successfully
  • Virtual key management UI works correctly

Definition of Done

  • All 57 interfaces converted
  • Security validations maintained
  • Type tests added
  • PR security-reviewed
  • Merged to dev branch

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions