Repository navigation
fix(kas-login): say a company sso form error in the user's language - #36451
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the 400 response only gains an optional Notes
[DESIGN-REVIEWED] 51b3e26 Description read[DESCRIPTION-READ] 644fde10600926d5b9b5a090f9addf5ed7b95c038745117fd47d21ef2de3cb28 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 new What this change shipsInventory (6 items) — 6 justifiedIntent: a company SSO user with a translated UI reads why the start URL or Region was refused in their own language, without AWS's raw error token. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 51b3e26 Description read[DESCRIPTION-READ] bf7f7b3011f75c88d7aa35c19369b425198107092ac41a8e1eeb0662bcae722c That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: this PR only changes error copy, and the before/after screenshots in German and English (shots 1–9) show it. Notes
[UX-REVIEWED] 51b3e26 Description read[DESCRIPTION-READ] 38a221294238dc59f380b17f25a3611482fcb65aea20f812a3f49a987cae43c0 That sha256 names everything this verdict read: the PR description, plus the 12 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 |
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: |
|
[operator: bolichen97] CI on
|
Code change approver recommendation: ApproveWhy: the decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. The change adds an optional An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
0a0744d to
c9eb67e
Compare
|
Rebased: main moved in website/src/components/KasLoginGate.tsx, KasLoginGate.test.tsx, auth/service.py, cloud/login_target.py, test/test_kas_login_service.py, docs/system-specs/modules/kas-auth.md, cloud.md and the website/src/i18n/locales/*.json catalogs since this head went green (2f7e9f2 -> 98046f8); CI re-running. The red on |
|
[operator: bolichen97] Status on
The description's nine screenshots are intact: each attachment URL answers 200 with PNG bytes. So nothing here is a code defect and no push is warranted. These lanes need a re-run, which I am holding until the repository's Actions queue drops — 22 branches are running CI right now, and re-running 8 workflows into that is what exhausted the API limit in the first place. Auto-merge stays armed; the remaining gate is a maintainer approval. |
|
Rebased: main moved in website/src/components/KasLoginGate.tsx, KasLoginGate.test.tsx, hooks/useKasLogin.ts, dashboard/handlers/kas_login.py, auth/service.py, cloud/login_target.py, test/test_cloud_login_target.py, test/test_kas_login_service.py, docs/system-specs/modules/kas-auth.md, cloud.md and the website/src/i18n/locales/*.json catalogs since this head went green (98046f8 -> e65debd); CI re-running. GitHub reported this PR as conflicting in three files. #35577 rewrote each start-URL refusal's English text in |
c9eb67e to
d380383
Compare
|
Rebased: main moved in docs/system-specs/modules/kas-auth.md and the website/src/i18n/locales/*.json catalogs since this head was pushed (e65debd -> 8c917a5); CI re-running. The previous head's CI had two reds, and neither comes from this PR's change, so there was no code to fix; this push re-runs both. |
d380383 to
a356be3
Compare
The company SSO form showed the gateway's English sentence under a translated headline, and after an AWS refusal that sentence ended with AWS's raw answer, "(AWS: Invalid request)". The gateway now names the start-URL rule a refusal broke in a `reason` field of the begin-device 400 (`characters`, `not_a_url`, `not_https`, `credentials`, `port`, `hostname`, carried from LoginTargetError, and `aws_rejected` for AWS's own refusal). The form says each refusal it can fix from its catalog instead, in plain words that call the field "the URL": the Region error, the refusal that names neither field, and every start-URL rule. A reason the form has no sentence for keeps the gateway's text. The error text, status and code are unchanged, so `kirocrew kas login` and the audit log still carry AWS's answer, and the agent hand-off keeps the error's report. Fixes #32061
a356be3 to
51b3e26
Compare
|
Rebased: main moved in docs/system-specs/modules/cloud.md, docs/system-specs/modules/kas-auth.md and the website/src/i18n/locales/*.json catalogs since this head was pushed (8c917a5 -> be1ce64); CI re-running. The new base carries #39470, the fix for the one test red on the previous head ( The screenshots in the description are re-taken on the whole Settings > Kiro account page, which main changed in #39373 to show the sign-in choices in its card. [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head 51b3e26. The start URL checks now attach a reason to each refusal. The begin device 400 response returns it as an optional field and keeps the error, status and code as they were. The form shows a translated sentence for each known code and reason, and falls back to the gateway's text for anything else. I ran the changed backend suites, the login gate component tests and the catalog parity tests on this head and all passed. I also checked that every locale has the new keys and that the error report the form passes on still carries the original status and code. I found no wrong behaviour, compatibility break or security concern, so nothing blocks.
Problem / Motivation
Goal: The company SSO form says why a start URL or Region was refused in the user's own language, without AWS's raw answer.
In the dashboard's company SSO form (Settings > Kiro account > Continue with company SSO), #33747 made the headline name the field to fix. Under that headline two things are still wrong. The detail is the gateway's English sentence even when the UI is translated: a German user reads "Prüfe die Anmelde-URL deiner Firma." and then "That does not look like a web address. …". And after an AWS refusal the detail ends with AWS's raw answer,
(AWS: Invalid request).Why it matters
Company SSO is how organisations sign in, and a typo in the start URL or Region is the usual first-run mistake. A user with a translated UI gets the one sentence that says what to fix in English, followed by an AWS error token that means nothing to them, so they guess or take it for an outage.
Not a goal
errortexts incloud/login_target.pyandauth/service.py(fix: say what is wrong with a start URL in plain words #35577 rewrites those).kirocrew kas login, the cloud wizard and the audit log keep the text they print today.code.auth_service_unreachable, for example, keeps its "Check your connection" headline and the gateway's detail.What changed (motivation → approach → change)
The sentence under the headline now comes from the dashboard's catalog, so it is in the user's language and never ends with AWS's raw answer.
code/reason)invalid_start_url/characters,not_a_url,not_https,credentials,port,hostnameinvalid_start_url/aws_rejectedstart_url_or_region_rejectedinvalid_regionThe form showed the gateway's
errorstring as it came. The gateway named only the field (code), never the rule the URL broke, so the form had nothing to pick a translated sentence from. NowLoginTargetError(cloud/login_target.py) carries areasonat each reachable start-URL check,InvalidStartUrlError(auth/service.py) passes it on, and the begin-device 400 (dashboard/handlers/kas_login.py) answers it as areasonfield,aws_rejectedwhen AWS itself refuses the URL.useKasLoginFlow(hooks/useKasLogin.ts) hands the begin's error toKasLoginGate.tsx, which picks the catalog sentence fromcodeandreason. A reason it has no sentence for keeps the gateway's text, and the error report still goes with the alert, so "Ask the agent" hands off the status and code.The catalog sentences (
website/src/i18n/locales/) say each rule in the plain words #35577 gave the gateway's English texts, and call the field "the URL". Thekas-authandcloudspecs say the same.Backwards compatibility
Compatible: the 400 answer only gains an optional
reasonfield;error, HTTP status andcodeare unchanged (curl evidence below), andreasonis a keyword-only argument with a default on both exception types.Removes nothing: the diff adds a field and catalog keys, and renames or removes no path, key, record or function.
Tests
test/test_cloud_login_target.py::test_a_refusal_names_the_rule_it_broke: each start-URL check names its rule, and an empty URL names none.test/test_kas_login_service.pyandtest/test_kas_login_api.py: the service's refusal carries the reason, and the 400 answers it (not_https,aws_rejected) with status andcodeunchanged.website/src/components/KasLoginGate.test.tsx: one row per code and reason shows the catalog sentence, no(AWS:text and only the named fieldsaria-invalid; an unknown reason keeps the gateway's text; the card's hand-off of a translated refusal still carries 400 andinvalid_start_url; in German, anaws_rejectedrefusal and a bad Region show the German sentences and no(AWS:text.Proof: PROVEN test/test_kas_login_api.py::test_begin_device_bad_start_url_is_a_coded_400_with_the_reason[malformed-not_https], test/test_kas_login_api.py::test_begin_device_bad_start_url_is_a_coded_400_with_the_reason[refused-by-aws-aws_rejected], test/test_kas_login_service.py::test_begin_idc_refuses_an_unusable_start_url_before_calling_aws[http://acme.awsapps.com/start-not_https], test/test_kas_login_service.py::test_begin_idc_refuses_an_unusable_start_url_before_calling_aws[https://acme.awsapps.com/start?x=1-characters], test/test_kas_login_service.py::test_begin_idc_refuses_an_unusable_start_url_before_calling_aws[https://acme.awsapps.com:abc/start-not_a_url] (head 0cd15f36fb5b)
That head is the verification host's commit of this PR's tree (
5267934be1).prove.py runs Python only; the frontend half was checked by reverting the alert's message to
beginError, which fails 11 KasLoginGate cases (every catalog row and both German cases).Determinism:
npx vitest run src/components/KasLoginGate.test.tsx --sequence.shufflepassed 3 of 3 runs (59 tests each). The changed backend tests (-k 'reason or rule or start_url', 23 tests) passed 3 of 3 runs with-n0(no repeat or shuffle plugin is installed).test/test_flake_pattern_ratchet.pypasses.Manual verification
Run on Linux (Ubuntu 24.04.5) against an isolated gateway (a fresh
KIROCREW_HOME,agent.acp_backendkas, a loopback port), driven with scripted Playwright in Chromium on Settings > Kiro account. The AWS case really calls SSO-OIDCStartDeviceAuthorizationin us-east-1.Before (main at
5c9bf25f3e), German UI:After, German UI:
After, English UI:
In both languages, before and after, the named inputs carry
aria-invalid="true"andaria-describedby="kas-sso-begin-error", and the other input carries neither. The gateway's begin-device answer keepserror, status andcode, and addsreasonwhere one applies:Happy path: a well-formed
https://my-company.awsapps.com/startwithus-east-1raises no form-side error and reaches AWS (which refuses it, since that portal does not exist, and the form shows the catalog sentence); "Continue with AWS Builder ID" starts a device sign-in (HTTP 200, a device code on the page) with no begin error, then was cancelled.Real-machine verification
Machine: EC2 m7i.2xlarge, Ubuntu 24.04.5 LTS x86_64, 8 vCPU / 31 GiB
Before (main 5c9bf25):
node capture.mjs(scripted Playwright on Settings > Kiro account, company SSO, German UI, against an isolated gateway) ->Prüfe die Anmelde-URL deiner Firma und die AWS-Region. AWS found no Identity Center for '...' in region us-east-1. ... (AWS: Invalid request)After (this PR's patch on main 5c9bf25, tree 71859ba0e3): the same command ->
Prüfe die Anmelde-URL deiner Firma und die AWS-Region. AWS hat für diese URL in dieser Region kein Identity Center gefunden. ..., and no(AWS:in any of the six German and English framesCleanup: both gateways stopped by their own pid and their temporary homes removed; the instance is a disposable verification host with no inbound rules, terminated when idle
Screenshots / video
Light theme, the whole Settings > Kiro account page, signed out, with the sign-in choices in its card: the German UI before and after, and the English UI after.
Before, German (English detail and

(AWS: Invalid request)):After, German:

More states
Related Issues
Fixes #32061
Follows #33747 (the headline that names the field). #35577 rewrote the gateway's own start-URL texts in plain words; this PR leaves them as they are.
Sibling sweep
Swept: git grep -nE "beginError|message={.*[Ee]rror" -- website/src/components/KasLoginGate.tsx website/src/components/KiroPrerequisiteGate.tsx website/src/pages/developer/KiroSignInCard.tsx website/src/hooks/useKasLogin.ts
Sibling: website/src/components/KasLoginGate.tsx -- changed here
Sibling: website/src/hooks/useKasLogin.ts -- changed here
Sibling: website/src/pages/developer/KiroSignInCard.tsx -- not affected -- it embeds KasLoginEmbedded, which renders the same Chooser alert changed here
Sibling: website/src/components/KiroPrerequisiteGate.tsx -- not affected -- it wraps KasLoginGate, which renders the same Chooser alert changed here
Pattern harvest
Not generalizable: the gateway already returned a machine-readable
codefor refusals the user can fix; one form showed the developer-facingerrortext where it should have keyed its catalog off that code, and a rule matching "rendererroras it came" would flag the deliberate raw detail of errors the user cannot fix.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.