Commit Graph
2 Commits
Author SHA1 Message Date
alex a29b976f13 fix: stdin TTY 偵測改以 fd 0 實際裝置判定,escript 真終端機不再誤判(issue #19)
- 新增 BearCli.TTY:readlink /proc/self/fd/0 判定 pts/tty/console/ptmx;
  無 /proc 平台退回 :io.rows/0
- vault/self_service 的 tty_stdin?、accounts 的 tty? 改用 TTY.stdin_tty?
- 根因::io.rows/0/:io.columns/0 走 io 協定問 group leader,escript
  (noshell standard_io)不支援行列查詢,一律回 enotsup——真終端機被
  誤判成非 TTY,互動指令(vault unlock 等)無法讀 stdin 密碼
  (bear #52 驗收建議 2)
- 非 TTY(pipe/redirect)行為不變:明確提示+退出碼 2
- 新增 tty_test(4 測試);mix precommit 全綠(200 passed)
2026-09-14 19:26:23 +08:00
iris 62fd6b730e feat: 實作個人自助指令群 profile/password/email/sessions/tokens/mfa(issue #11)
- lib/bear_cli/self_service.ex:六個子群組(profile show/set、password change、
  email change、sessions list/revoke/revoke-others、tokens list/create/revoke、
  mfa status/setup/disable/recovery-codes),對接 alterminal/bear#38 的
  /api/v1/profile* JSON API(PAT Bearer、任何有效帳號)
- 敏感輸入(密碼/驗證碼)互動提示讀取,非 TTY → 退出碼 2;
  一次性明文(PAT 明文、recovery codes)僅於成功當下輸出
- mfa setup:otpauth URI 本地生成 ASCII QR(新增 eqrcode 依賴),
  確認走 /mfa/setup/confirm(依 #38 實作)
- Api 模組新增 profile 系列端點與 429 分流;CLI 分派接上六個指令群組
- docs/commands.md §3.7 對齊 #38 實際 API(sessions 欄位、tokens create
  無 --scope、mfa setup/confirm、email 需重帶 new_email);§7/§8/§9 與
  README 同步更新
- 測試 50 例(fake API 注入):解析、輸出、退出碼、互動輸入、錯誤分流;
  mix precommit 全綠(114 passed)
2026-09-09 22:50:53 +08:00