Skip to content

feat(auth): add formal password authentication foundation (M0A.5a)#83

Open
wangjk9527 wants to merge 1 commit into
datagallery-lab:mainfrom
wangjk9527:feat/m0a5a-formal-auth-foundation
Open

feat(auth): add formal password authentication foundation (M0A.5a)#83
wangjk9527 wants to merge 1 commit into
datagallery-lab:mainfrom
wangjk9527:feat/m0a5a-formal-auth-foundation

Conversation

@wangjk9527

@wangjk9527 wangjk9527 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Lands the M0A.5a formal authentication foundation: a reusable password-auth contract and shared test client for API and automated tests, while retaining the existing development auth entry point.

  • Registration policy (open/closed), public URL / Cookie Secure alignment, and GET /api/v1/auth/status
  • Login anti-enumeration; Web (30-day) and TUI (7-day) session TTL with expiresAt
  • Recoverable CSRF rotation (CSRF_INVALID)
  • Shared createAuthenticatedTestClient(); core HTTP smoke/seed paths migrate to password mode with dynamic userId / workspaceId
  • Script HTTP auth classification gate for scripts/**/*.mjs; CI core-smoke-tests runs password-mode test:auth-foundation
  • HITL event bridge: ask_user / submit_plan bypass ActionRouter; emit TOOL_CALL_END before synthesized RUN_FINISHED so interaction.requested can complete

Out of scope: M0A.5b (TUI login, #84) and native one-click deployment (#82).

Design / plan

  • Design: docs/superpowers/specs/2026-07-23-formal-auth-and-tui-login-design.md
  • Plan: docs/superpowers/plans/2026-07-23-m0a5a-formal-auth-foundation.md
  • Related: docs/superpowers/specs/2026-07-22-native-one-click-deployment-design.md

Test plan

  • npm run test:auth-foundation
  • npm run smoke:auth
  • npm run smoke:config-api
  • npm run smoke:copilotkit-run
  • npm run smoke:server-datasources (skipped when no external DB)
  • npm run typecheck
  • npm run test:web
  • npm --workspace @datafoundry/tui test
  • CI Core Smoke Tests green

Notes

  • Legacy dev auth mode is retained; new tests do not depend on it.
  • Web registration UI may briefly diverge from API registrationMode until M0A.5c.

@wangjk9527
wangjk9527 force-pushed the feat/m0a5a-formal-auth-foundation branch 2 times, most recently from 76a7f47 to 0989386 Compare July 23, 2026 16:09
@wangjk9527 wangjk9527 mentioned this pull request Jul 23, 2026
6 tasks

@iancaoo iancaoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一处硬语法错误:scripts/verify-token-usage-display.mjs 第 6 行把新的 import 插进了既有 import { ... } from ".../live-run-state.ts" 块内部,node --check 直接报 SyntaxError: Unexpected reserved word,该脚本无法加载/运行。其余改动整体 OK。

Comment thread scripts/verify-token-usage-display.mjs
实现 password 模式会话/CSRF/注册策略,并修复 HITL 事件桥、cookie Path
与缺失注册策略静默 open 等确定性缺陷。脚本侧统一正式认证客户端,并为
FORMAL_HTTP_AUTH_TARGETS 增加 node --check 语法门禁。
@wangjk9527
wangjk9527 force-pushed the feat/m0a5a-formal-auth-foundation branch from 0989386 to a91e8d7 Compare July 24, 2026 02:51
@wangjk9527 wangjk9527 changed the title M0A.5a formal auth foundation feat(auth): add formal password authentication foundation (M0A.5a) Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants