mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 04:14:57 +00:00
refactor(oauth): derive auth-code providers from OAUTH_FLOW_TYPES (DRY)
- Update checkAuthCodePorts() to filter from CLIPROXY_PROFILES - Update header comment to list all OAuth ports including Claude - Addresses PR #384 review round 3
This commit is contained in:
1 parent
5c62e06d02
commit
c713d48d08
1 file changed
+6
-1
@@ -8,7 +8,11 @@
|
|||||||
* - Gemini: 8085
|
* - Gemini: 8085
|
||||||
* - Codex: 1455
|
* - Codex: 1455
|
||||||
* - Agy: 51121
|
* - Agy: 51121
|
||||||
|
* - iFlow: 11451
|
||||||
|
* - Kiro: 9876
|
||||||
|
* - Claude: 54545
|
||||||
* - Qwen: Device Code Flow (no port needed)
|
* - Qwen: Device Code Flow (no port needed)
|
||||||
|
* - GHCP: Device Code Flow (no port needed)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -156,7 +160,8 @@ export async function checkAllOAuthPorts(): Promise<OAuthPortDiagnostic[]> {
|
|||||||
* Check OAuth ports for providers that use Authorization Code flow only
|
* Check OAuth ports for providers that use Authorization Code flow only
|
||||||
*/
|
*/
|
||||||
export async function checkAuthCodePorts(): Promise<OAuthPortDiagnostic[]> {
|
export async function checkAuthCodePorts(): Promise<OAuthPortDiagnostic[]> {
|
||||||
const providers: CLIProxyProvider[] = ['gemini', 'codex', 'agy', 'iflow', 'kiro', 'claude'];
|
// Filter providers that use authorization_code flow (DRY: derive from OAUTH_FLOW_TYPES)
|
||||||
|
const providers = CLIPROXY_PROFILES.filter((p) => OAUTH_FLOW_TYPES[p] === 'authorization_code');
|
||||||
const results: OAuthPortDiagnostic[] = [];
|
const results: OAuthPortDiagnostic[] = [];
|
||||||
|
|
||||||
for (const provider of providers) {
|
for (const provider of providers) {
|
||||||
|
|||||||
Reference in new issue
Block a user