feat: approve a command-line sign-in from the browser - #176
Merged
Conversation
The CLI takes a password on standard input today, so anything driving it — including an agent asked to "install and set it up" — has to be handed the customer's password. This screen is the other half of removing that: the terminal shows a short code, the person confirms it here in a session that already holds their credential, and the terminal never sees the password. The code arrives in the address but is not approved on arrival. A link is easy to send to someone; a code they have to recognise on their own screen is not, and this page hands out a live session. The copy says plainly what the terminal will be able to do and what it will not. The account is never in the request body. The server reads it from this session, so a body naming an account cannot approve a device onto someone else's. Refs Idea2Strategy/Idea2Strategy#479
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
백엔드 짝: 기기 인증 엔드포인트 (별도 PR)
상위 이슈: Idea2Strategy/Idea2Strategy#479
왜 필요한가
지금 CLI 는 비밀번호를 stdin 으로 받는다. 즉 CLI 를 구동하는 무언가 — "설치하고 설정해줘" 라는
지시를 받은 AI 에이전트를 포함해 — 가 사용자의 비밀번호를 손에 쥐어야 한다.
이 화면이 그것을 없애는 나머지 절반이다. 터미널이 짧은 코드를 표시하고, 사용자는 이미 자격을
가진 브라우저 세션에서 그 코드를 확인해 승인한다. 터미널은 비밀번호를 보지 않는다.
설계에서 지킨 것
주소로 왔다고 자동 승인하지 않는다. 코드는
?code=로 채워지지만 사용자가 버튼을 눌러야한다. 링크는 남에게 보내기 쉽고, 이 화면은 살아 있는 세션을 내준다. 터미널에 뜬 코드와 눈으로
대조하는 절차가 그 차이를 만든다.
계정을 본문에 넣지 않는다. 서버가 세션에서 읽는다. 계정을 지목할 수 있는 본문이면 남의 계정에
기기를 승인시킬 수 있다.
무엇을 허용하는지 문장으로 적었다. 전략을 읽고 만들 수 있고, 주문·출시·자금 이동은 못 한다.
검증
pnpm typecheck통과.CliAuthView.test.tsx4건 통과 — 주소만으로 승인되지 않을 것, 확인한코드로 승인될 것, 거절이 승인을 부르지 않을 것, 승인 불가 코드가 설명될 것.