This commit is contained in:
Juergen Kunz
2025-07-17 15:34:58 +00:00
parent 82df9a6f52
commit b26abbfd87
7 changed files with 38 additions and 37 deletions

View File

@@ -18,29 +18,29 @@ Implement enhanced routing structure with multiple targets per route, sub-matchi
### 3. Implementation Steps
#### Phase 1: Type Updates
- [ ] Update `IRouteTarget` interface in `route-types.ts`
- [x] Update `IRouteTarget` interface in `route-types.ts`
- Add `match?: ITargetMatch` property
- Add override properties (tls, websocket, etc.)
- Add `priority?: number` field
- [ ] Create `ITargetMatch` interface for sub-matching criteria
- [ ] Update `IRouteAction` to use only `targets: IRouteTarget[]`
- [x] Create `ITargetMatch` interface for sub-matching criteria
- [x] Update `IRouteAction` to use only `targets: IRouteTarget[]`
#### Phase 2: Route Resolution Logic
- [ ] Update route matching logic to handle multiple targets
- [ ] Implement target sub-matching algorithm:
- [x] Update route matching logic to handle multiple targets
- [x] Implement target sub-matching algorithm:
1. Sort targets by priority (highest first)
2. For each target with a match property, check if request matches
3. Use first matching target, or fallback to target without match
- [ ] Ensure target-specific settings override route-level settings
- [x] Ensure target-specific settings override route-level settings
#### Phase 3: Code Migration
- [ ] Find all occurrences of `action.target` and update to `action.targets[0]`
- [ ] Update route helpers and utilities
- [ ] Update certificate manager to handle multiple targets
- [ ] Update connection handlers
- [x] Find all occurrences of `action.target` and update to use `action.targets`
- [x] Update route helpers and utilities
- [x] Update certificate manager to handle multiple targets
- [x] Update connection handlers
#### Phase 4: Testing
- [ ] Update existing tests to use new format
- [x] Update existing tests to use new format
- [ ] Add tests for multi-target scenarios
- [ ] Add tests for sub-matching logic
- [ ] Add tests for setting overrides