refactor kiro flow to web signin authorization

This commit is contained in:
QLHazyCoder
2026-05-19 12:16:59 +08:00
parent 98e776348e
commit ef700be3e2
22 changed files with 521 additions and 1391 deletions
+14 -3
View File
@@ -143,7 +143,13 @@
|| normalizedHost.includes(`.${normalizedFamily}.`);
}
function isKiroAuthHost(hostname = '') {
function isKiroWebHost(hostname = '') {
const normalized = normalizeHostname(hostname);
return normalized === 'app.kiro.dev'
|| normalized === 'kiro.dev';
}
function isKiroAwsAuthHost(hostname = '') {
const normalized = normalizeHostname(hostname);
return normalized === 'view.awsapps.com'
|| normalized === 'login.awsapps.com'
@@ -153,6 +159,10 @@
|| normalized.endsWith('.amazonaws.com');
}
function isKiroRegisterHost(hostname = '') {
return isKiroWebHost(hostname) || isKiroAwsAuthHost(hostname);
}
function getRuntimeSourceDefinitions() {
return {
...(typeof flowRegistryApi.getRuntimeSourceDefinitions === 'function'
@@ -327,8 +337,9 @@
case 'gopay-flow':
return /gopay|gojek/i.test(candidate.hostname);
case 'kiro-register-page':
return isKiroRegisterHost(candidate.hostname);
case 'kiro-desktop-authorize':
return isKiroAuthHost(candidate.hostname);
return isKiroAwsAuthHost(candidate.hostname);
default:
return false;
}
@@ -351,7 +362,7 @@
if (normalizedHostname === 'www.icloud.com' || normalizedHostname === 'www.icloud.com.cn') return 'icloud-mail';
if (normalizedUrl.includes('duckduckgo.com/email/settings/autofill')) return 'duck-mail';
if (normalizedUrl.includes('2925.com')) return 'mail-2925';
if (isKiroAuthHost(normalizedHostname)) return 'kiro-register-page';
if (isKiroRegisterHost(normalizedHostname)) return 'kiro-register-page';
if (isSignupEntryHost(normalizedHostname)) return 'chatgpt';
return 'unknown-source';
}