Repository navigation
fix(auth): find an IdC profile on any Kiro control plane at sign-in - #32445
Conversation
An IAM Identity Center sign-in asked only the control plane picked from the Identity Center region for the account's Kiro profiles. That region does not say where the profile is served, so a us-east-1 instance whose profile lives on the eu-central-1 control plane got zero profiles and every sign-in ended with "no available Kiro profiles". Ask every known control-plane host, the login region's own first, and keep the first answer that lists a profile. A host that refuses is logged and skipped; the login fails only when every host refused or none lists a profile. Closes #28904
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: home-region profiles still resolve with one call to the same host, so the extra lookup only changes logins that already failed. Notes
[DESIGN-REVIEWED] 54f75e6 Description read[DESCRIPTION-READ] ab3e1355ceb3375189c0a6f38f9e18061a85414f1b2a924a28c0948ae8d96601 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix asks the other control plane only after the login region's own host returns nothing or refuses. A sign-in that works today makes the same first call and gets the same answer. Not checked: whether a us-east-1 IdC bearer token is accepted by the eu-central-1 control plane (#28904 reporter's account). What this change shipsInventory (4 items) — 4 justifiedIntent: let an Identity Center user whose Kiro profile lives on another region's control plane finish signing in. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 54f75e6 Description read[DESCRIPTION-READ] 89781a8eeddb1ee42786b16e3defad8c4fee1db30406e37e66ed93409452f70a That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
buluoray
left a comment
There was a problem hiding this comment.
Reviewed on 54f75e6: sign-in asks the two fixed first-party control-plane hosts for the profile, home host first; accounts that already worked see the same single call. Non-blocking: no test covers the all-hosts-refuse branch.
…32445) An IAM Identity Center sign-in asked only the control plane picked from the Identity Center region for the account's Kiro profiles. That region does not say where the profile is served, so a us-east-1 instance whose profile lives on the eu-central-1 control plane got zero profiles and every sign-in ended with "no available Kiro profiles". Ask every known control-plane host, the login region's own first, and keep the first answer that lists a profile. A host that refuses is logged and skipped; the login fails only when every host refused or none lists a profile. Closes #28904 (cherry picked from commit 90d19e3)
Problem / Motivation
Goal: An IAM Identity Center user whose Kiro profile is served by another region's control plane signs in from the dashboard or
kirocrew kas logininstead of failing with "no available Kiro profiles".The browser approval succeeds, then the dashboard shows "Sign-in failed / Something went wrong while waiting for approval" and the log says
IdC login has no available Kiro profiles. The reporter's Identity Center lives inus-east-1; their Kiro profile is served fromeu-central-1. kiro-cli signs the same account in fine.Why it matters
Every Identity Center account whose Kiro profile sits on a different control plane than its Identity Center region cannot use Kiro Crew's own sign-in at all, and every retry fails the same way. Entering the profile's region in the form instead sends the SSO-OIDC calls to a region where the Identity Center does not live, so there is no workaround.
Not a goal
kas login.nextTokenpast the first page ofListAvailableProfiles.What changed (motivation → approach → change)
Sign-in asked only one Kiro control plane for the account's profiles: the one picked from the Identity Center region. That region does not say where the profile is served, and the profile ARN that would say it is exactly what the call is looking for.
list_available_profilesinauth/login/control_plane.pynow asks every control-plane host in_CPS_ENDPOINTS, the login region's own host first, and keeps the first answer that lists a profile. An account whose profile is in its own region still costs one call. A host that refuses or sends an unreadable answer is logged as a warning and skipped;ControlPlaneErroris raised only when every host refused, and zero profiles everywhere still ends the login as "no available Kiro profiles". The region table,control_plane_urland the post-sign-in policy fetch are unchanged.The
kas-authspec describes the lookup.Backwards compatibility
Compatible: the function keeps its signature and its outcomes (a profile list, an empty list, or
ControlPlaneError); a sign-in that worked before gets the same answer from the same first host.Removes nothing: no input, key, host or caller is taken away; a login that failed on the first host now also asks the other one.
Tests
test_poll_idc_finds_a_profile_on_another_regions_control_plane(new, four cases): aus-east-1oreu-west-1sign-in whose own control plane answers no profiles, or refuses, stores the profile the other control plane lists, and the login region's own host is asked first.test_control_plane_url_is_the_regional_cps_host: comment only, theeu-west-1row now orders the hosts.test_poll_idc_with_no_profiles_is_error_and_saves_nothingandtest_poll_idc_control_plane_failure_is_errorscript one answer per host, since both hosts are now asked before the login ends.test_poll_idc_resolves_profile_arn(unchanged) still sees a single control-plane call when the first host has the profile.Proof: PROVEN test/test_kas_login_service.py::test_poll_idc_finds_a_profile_on_another_regions_control_plane[no-profiles-us-east-1-https://management.us-east-1.kiro.dev/-https://management.eu-central-1.kiro.dev/], test/test_kas_login_service.py::test_poll_idc_finds_a_profile_on_another_regions_control_plane[no-profiles-eu-west-1-https://management.eu-central-1.kiro.dev/-https://management.us-east-1.kiro.dev/], test/test_kas_login_service.py::test_poll_idc_finds_a_profile_on_another_regions_control_plane[refused-us-east-1-https://management.us-east-1.kiro.dev/-https://management.eu-central-1.kiro.dev/], test/test_kas_login_service.py::test_poll_idc_finds_a_profile_on_another_regions_control_plane[refused-eu-west-1-https://management.eu-central-1.kiro.dev/-https://management.us-east-1.kiro.dev/] (head 54f75e6)
Determinism: the new and changed tests (with
test_control_plane_url_is_the_regional_cps_host) passed 20 runs at-n0and 10 runs at-n 4 --dist loadgroup --max-worker-restart=2besidetest_kas_auth_whoami.pyandtest_enterprise_policy_fetch.py; the wholetest_kas_login_service.pypassed in a shuffled order (seed 10467).Manual verification
N/A — unit coverage sufficient: the fix is in which hosts one HTTP call goes to, and the tests script both control planes' answers through the real poll path. No live Identity Center with a cross-region profile was available here.
Screenshots / video
N/A — no frontend change.
Related Issues
Closes #28904
Builds on #29049 by @Skripd, which takes the same approach; this keeps the
eu-west-1row of the region table, which the post-sign-in policy fetch still reads.Sibling sweep
Swept:
git grep -nE "list_available_profiles|control_plane_url|ListAvailableProfiles" -- src/Pattern harvest
Rule candidate: review-prompt
Pattern: a service host chosen from an incidental region (the sign-in region) when the value that names the resource's region is not known yet.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.