SpecialX
|
cfb7b005fd
|
feat(portal-shell): v2.1 P0 auth + middleware + login + graphql proxy
- 新增 ARCHITECTURE.md v3.0:portal-shell 架构权威文档
涵盖 §3.4 V3-A2/A3 认证链、§4 GraphQL 联邦、§5 安全、
§6 部署、§10 P0-P3 验收清单
- 新增 middleware.ts:认证 + 路由门禁
httpOnly cookie edu_session(JWT)读取
DEV_MODE 合成 dev-user/teacher 身份(NODE_ENV!=production &&
NEXT_PUBLIC_DEV_MODE=true)
生产模式 jose JWKS RS256 验签(iss/aud 校验)
路由权限位图注入 x-user-id/x-user-role/x-user-permissions 头
/shell/** 强制 checkRoutePermission,拒绝跳 /shell/forbidden
- 新增 instrumentation.ts:生产环境 DEV_MODE 强制 false
防止生产环境误开 DEV_MODE 合成身份
- 新增 app/api/auth/login/route.ts + logout/route.ts
登录走 api-gateway /v1/iam/login
设置 httpOnly + Secure + SameSite=Strict cookie
- 新增 app/api/graphql/route.ts:同域 GraphQL 代理
转发到 apollo-router,注入 router-authorization 头
- 新增 app/login/page.tsx + login-form.tsx
zod 表单校验,next 参数支持
- 新增 app/shell/forbidden/page.tsx:403 页面
- 更新 route-permissions.ts:补全 P0 路由权限映射
- 更新 permission-bitmap.ts(shared-ts):位图编码/解码
- 更新 apollo-client.ts:DEV_MODE APQ 关闭,错误处理
- 更新 config-fetcher.ts:config-service 直连降级
- 更新 ApolloProvider.tsx:SSR/RSC 兼容
- 更新 eslint.config.js:design-tokens/no-hardcoded-fonts
白名单调整
|
2026-07-22 11:35:36 +08:00 |
|
SpecialX
|
9cedf0c437
|
feat(portal-shell): v2.0 P0 shadcn standardization + security + streaming + error handling
- shadcn/ui 标准化:废弃纸感令牌,统一 bg-background/text-foreground 等
- Tailwind v4 + @theme inline,移除 tailwind.config.js
- React 19 use() + Suspense 流式渲染,首屏骨架秒出
- 三级错误边界:Route → Section → Widget 层层兜底
- 错误上报:useErrorReport → sendBeacon → /api/log mock 端点
- 三层安全边界:L1 角色门禁 / L2 权限点门禁 / L3 数据范围
- 权限位图 base36 压缩:67 权限点 → ~14 字符,JWT 体积减少 ≥ 99%
- notify 统一 Toast 封装,禁止业务直接 import sonner
- PluginBoundary 替代 PluginLoader(错误边界 + Suspense + Skeleton 三件套)
验证:typecheck 0 错误 / lint 0 错误 / build 6 路由生成成功
|
2026-07-17 16:10:05 +08:00 |
|
SpecialX
|
5fcb831a18
|
feat(shared-ts): federation shared utilities for apollo subgraphs
- RouterAuthGuard: validate Router-Authorization header (ADR-036)
- DataLoader factory: request-scoped batching (ADR-035)
- ScopeTokenService: Redis-backed scope token (ADR-041)
- GraphqlContext: build context from HTTP headers
- FederationExceptionFilter: HTTP-to-GraphQL error mapping
|
2026-07-14 23:46:51 +08:00 |
|
SpecialX
|
81a539b9ab
|
chore(deps): 统一依赖管理 - pnpm 11 + node:22 + golang:1.25 + python:3.12 + shared-* 集中化
CI / quality-ts (push) Failing after 6s
CI / quality-go (push) Failing after 25s
CI / quality-proto (push) Failing after 6s
CI / deploy (push) Has been skipped
- Node.js 统一到 node:22-alpine,Go 统一到 golang:1.25-alpine,Python 统一到 python:3.12-slim
- pnpm 升级到 11.13.0(corepack),新增 allowBuilds 白名单解决 ERR_PNPM_IGNORED_BUILDS
- 新增 packages/shared-py 集中 Python 共享依赖,shared-ts 补充 graphql-yoga/prom-client
- api-gateway 修复 go.mod 的 shared-go 依赖 + Dockerfile 改用 repo 根作 context
- Python 服务(data-ana/ai)Dockerfile 改用 repo 根作 context + 声明 uv workspace sources
- 16 个服务的 Dockerfile + CI + docker-compose.tools.yml 全部对齐版本矩阵
- known-issues.md 沉淀 9 条 pnpm 11 / uv workspace / Go shared-go 迁移经验
- 验证:4 服务完全成功(api-gateway /healthz 200),其余 install 成功(build 失败为预存 TS 错误)
|
2026-07-14 12:04:49 +08:00 |
|
SpecialX
|
2ba4250165
|
feat(p1): complete P1 foundation stage
CI Go / test (push) Has been cancelled
CI Proto / lint (push) Has been cancelled
CI Python / test (push) Has been cancelled
CI TypeScript / test (push) Has been cancelled
- monorepo: pnpm workspace + go.work + pyproject.toml + commitlint/husky
- infra: docker-compose (minimal + full profiles) + init-sql + prometheus
- arch-scan: multi-language scanner skeleton (TS/Go/Python/Proto)
- shared-proto: buf v2 + classes.proto (ClassService CRUD contract)
- api-gateway: Go/Gin + JWT HS256 auth + reverse proxy + request ID
- classes: NestJS golden template (error system + observability + middleware + CRUD + tests)
- teacher-portal: Next.js + paper-feel UI design system
- CI/CD: 4 workflows (go/ts/py/proto)
- docs: migration guide + project_rules + coding-standards + git-workflow + ui-design-system + 004 + 9 module READMEs + known-issues + spec/plan migration + roadmap
|
2026-07-07 23:39:37 +08:00 |
|