fix: 收口审查发现的 CI 与授权边界
将 admin identity helper 移到共享边界,清理跨 feature 导入;修复 CI 集成环境、浏览器数据库/Playwright 配置;增强 doctor source hash 对重命名文件的处理,并补充 logout API 文档。
This commit is contained in:
1 parent
bd129a3069
commit
0788480ce3
12 files changed
+35
-16
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"scope": "模板完成证据登记,保留命令、日志与产物哈希",
|
||||
"generatedAt": "2026-10-19T00:40:00+08:00",
|
||||
"generatedAt": "2026-10-19T01:15:00+08:00",
|
||||
"templates": {
|
||||
"acheng-campus-food": {
|
||||
"real-manifest-interaction": {
|
||||
@@ -292,5 +292,5 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceTreeHash": "ff1ad5d31af376ed6c2aa019533b168805bdf5cfaf306418b8327fb432dbeee3"
|
||||
"sourceTreeHash": "7c75d6c3fe05b9c09e1392deaa8114a18dedaa1074e0a9d9022e4ee757ae930e"
|
||||
}
|
||||
@@ -87,6 +87,15 @@ jobs:
|
||||
node-version: 24
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- name: Prepare API test env
|
||||
working-directory: apps/api
|
||||
run: |
|
||||
cat > .env <<EOF
|
||||
DATABASE_URL=$DATABASE_URL
|
||||
DEFAULT_BRAND_ID=$DEFAULT_BRAND_ID
|
||||
SESSION_SECRET=$SESSION_SECRET
|
||||
SEED_ADMIN_PASSWORD=$SEED_ADMIN_PASSWORD
|
||||
EOF
|
||||
- run: pnpm --filter @personal-brand/api test:integration
|
||||
|
||||
taro:
|
||||
@@ -147,9 +156,18 @@ jobs:
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm --filter @personal-brand/taro exec playwright install --with-deps chromium
|
||||
- name: Prepare API test env
|
||||
working-directory: apps/api
|
||||
run: |
|
||||
cat > .env <<EOF
|
||||
DATABASE_URL=$DATABASE_URL
|
||||
DEFAULT_BRAND_ID=$DEFAULT_BRAND_ID
|
||||
SESSION_SECRET=$SESSION_SECRET
|
||||
SEED_ADMIN_PASSWORD=$SEED_ADMIN_PASSWORD
|
||||
EOF
|
||||
- run: pnpm --filter @personal-brand/api db:migrate:deploy
|
||||
- run: pnpm --filter @personal-brand/api db:seed
|
||||
- run: pnpm --filter @personal-brand/api test:integration
|
||||
env:
|
||||
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/personal_brand
|
||||
- name: Start API
|
||||
run: pnpm --filter @personal-brand/api start > /tmp/api.log 2>&1 &
|
||||
env:
|
||||
@@ -175,3 +193,5 @@ jobs:
|
||||
curl --retry 30 --retry-delay 1 --retry-connrefused -fsS http://localhost:3002
|
||||
curl --retry 30 --retry-delay 1 --retry-connrefused -fsS http://localhost:3000
|
||||
- run: pnpm --filter @personal-brand/taro exec playwright test --config=playwright.config.ts --reporter=line
|
||||
env:
|
||||
ADMIN_URL: http://localhost:3000
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { ForbiddenException, UnauthorizedException } from "@nestjs/common";
|
||||
import type { FastifyRequest } from "fastify";
|
||||
import { readIdentity } from "../../auth.js";
|
||||
import { readIdentity } from "./auth.js";
|
||||
|
||||
export type AdminIdentity = {
|
||||
subject: string;
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
UpdateTrustContentDto,
|
||||
} from "../../admin.dto.js";
|
||||
import { TemplateWorkspaceService } from "../../template-workspace.service.js";
|
||||
import { requireAdminIdentity } from "../workspace/admin-access.identity.js";
|
||||
import { requireAdminIdentity } from "../../admin-access.identity.js";
|
||||
import { AdminBrandConfigService } from "./admin-brand-config.service.js";
|
||||
|
||||
@Controller("admin/config")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Body, Controller, Get, Param, Patch, Post, Req } from "@nestjs/common";
|
||||
import type { FastifyRequest } from "fastify";
|
||||
import { AdminAccessService } from "../../admin-access.service.js";
|
||||
import { requireAdminIdentity } from "../workspace/admin-access.identity.js";
|
||||
import { requireAdminIdentity } from "../../admin-access.identity.js";
|
||||
import { CreateBrandMemberDto, UpdateBrandMemberDto } from "../../admin.dto.js";
|
||||
import { TenantService } from "./tenant.service.js";
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
PreviewTemplateSampleDto,
|
||||
UpdateCapabilityInstallationDto,
|
||||
} from "../../admin.dto.js";
|
||||
import { requireAdminIdentity } from "./admin-access.identity.js";
|
||||
import { requireAdminIdentity } from "../../admin-access.identity.js";
|
||||
import { AdminSampleContentService } from "./admin-sample-content.service.js";
|
||||
import { AdminWorkspaceCapabilitiesService } from "./admin-workspace-capabilities.service.js";
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
UpdateInquiryFormDto,
|
||||
UpdateInquirySubmissionDto,
|
||||
} from "../../admin.dto.js";
|
||||
import { requireAdminIdentity } from "./admin-access.identity.js";
|
||||
import { requireAdminIdentity } from "../../admin-access.identity.js";
|
||||
import { AdminInquiryService } from "./admin-inquiry.service.js";
|
||||
|
||||
@Controller("admin/workspace")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Body, Controller, Delete, Get, Param, Patch, Post, Req } from "@nestjs/common";
|
||||
import type { FastifyRequest } from "fastify";
|
||||
import { CreateOfferingDto, UpdateOfferingDto } from "../../admin.dto.js";
|
||||
import { requireAdminIdentity } from "./admin-access.identity.js";
|
||||
import { requireAdminIdentity } from "../../admin-access.identity.js";
|
||||
import { AdminOfferingService } from "./admin-offering.service.js";
|
||||
|
||||
@Controller("admin/workspace")
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Body, Controller, Get, Post, Req } from "@nestjs/common";
|
||||
import type { FastifyRequest } from "fastify";
|
||||
import { RollbackTemplateDto, UpgradeTemplateDto } from "../../admin.dto.js";
|
||||
import { TemplateWorkspaceService } from "../../template-workspace.service.js";
|
||||
import { requireAdminIdentity } from "./admin-access.identity.js";
|
||||
import { requireAdminIdentity } from "../../admin-access.identity.js";
|
||||
|
||||
@Controller("admin/workspace")
|
||||
class AdminTemplateController {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Controller, Get, Post, Body, Req } from "@nestjs/common";
|
||||
import type { FastifyRequest } from "fastify";
|
||||
import { InstallTemplateDto, SelectTemplateVersionDto } from "../../admin.dto.js";
|
||||
import { TemplateWorkspaceService } from "../../template-workspace.service.js";
|
||||
import { requireAdminIdentity } from "./admin-access.identity.js";
|
||||
import { requireAdminIdentity } from "../../admin-access.identity.js";
|
||||
import { AdminWorkspaceService } from "./admin-workspace.service.js";
|
||||
|
||||
@Controller("admin/workspace")
|
||||
|
||||
@@ -7,9 +7,7 @@ export default defineConfig({
|
||||
viewport: { width: 375, height: 812 },
|
||||
screenshot: "only-on-failure",
|
||||
launchOptions: {
|
||||
executablePath:
|
||||
process.env.CHROMIUM_PATH ||
|
||||
"/home/que01/.cache/ms-playwright/chromium-1228/chrome-linux64/chrome",
|
||||
...(process.env.CHROMIUM_PATH ? { executablePath: process.env.CHROMIUM_PATH } : {}),
|
||||
args: ["--no-sandbox"],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -444,7 +444,8 @@ export function sourceTreeHash(root) {
|
||||
.toString("utf8")
|
||||
.split("\0")
|
||||
.filter((file) => file && !file.startsWith(".codex-tasks/"))
|
||||
.map((file) => path.join(rootPath, file));
|
||||
.map((file) => path.join(rootPath, file))
|
||||
.filter((file) => fs.existsSync(file) && fs.statSync(file).isFile());
|
||||
} else {
|
||||
files = walkRepositoryFiles(rootPath).filter(
|
||||
(file) => !path.relative(rootPath, file).startsWith(".codex-tasks/"),
|
||||
|
||||
Reference in new issue
Block a user