mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-03-22 00:50:26 +00:00
## Problem - Kiro API endpoints were hardcoded to us-east-1 region - Enterprise users in other regions (e.g., ap-northeast-2) experienced significant latency (200-400x slower) due to cross-region API calls - This is the API endpoint counterpart to quotio PR #241 which fixed token refresh endpoints ## Solution - Add buildKiroEndpointConfigs(region) function for dynamic endpoint generation - Extract region from auth.Metadata["region"] field - Fallback to us-east-1 for backward compatibility - Use case-insensitive authMethod comparison (consistent with quotio PR #252) ## Changes - Add kiroDefaultRegion constant - Convert hardcoded endpoint URLs to dynamic fmt.Sprintf with region - Update getKiroEndpointConfigs to extract and use region from auth - Fix isIDCAuth to use case-insensitive comparison ## Testing - Backward compatible: defaults to us-east-1 when no region specified - Enterprise users can now use their local region endpoints Related: - quotio PR #241: Dynamic region for token refresh (merged) - quotio PR #252: authMethod case-insensitive fix - quotio Issue #253: Performance issue report