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 白名单调整
This commit is contained in:
@@ -6,7 +6,7 @@ packages:
|
||||
|
||||
# pnpm 11+ build scripts 白名单(从 package.json 的 pnpm.onlyBuiltDependencies 迁移)
|
||||
allowBuilds:
|
||||
'@apollo/protobufjs': set this to true or false
|
||||
'@apollo/protobufjs': false
|
||||
'@module-federation/nextjs-mf': true
|
||||
'@nestjs/core': true
|
||||
'@sentry/cli': true
|
||||
@@ -17,7 +17,7 @@ allowBuilds:
|
||||
esbuild: true
|
||||
msw: true
|
||||
protobufjs: true
|
||||
sharp: set this to true or false
|
||||
sharp: false
|
||||
ssh2: true
|
||||
tsx: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user