feat: 接入真实登录与成员权限

- auth/members/messages: 新增超级管理员登录、成员权限和密码消息流程
- agent-config/agent: 支持服务端保存 Agent 配置并取消未配置 mock 成功结果
- projects/deploy-runs/settings: 按当前用户权限保护真实接口
- prisma: 新增用户、项目权限和平台消息表结构
This commit is contained in:
湛兮
2026-06-12 00:38:23 +08:00
parent cf1bebf625
commit bc3aa31289
83 changed files with 3844 additions and 378 deletions
+10
View File
@@ -1,3 +1,4 @@
import { AuthService } from '../auth/auth.service';
import { AppError } from '../common/errors/app-error';
import { GiteaClient } from '../integrations/gitea/gitea.client';
import { ProjectRepository } from './project.repository';
@@ -37,13 +38,22 @@ describe('ProjectsService', () => {
Promise.resolve(options?.tags ?? [{ name: 'v1.0.0', commitSha: 'def' }]),
),
} satisfies Pick<GiteaClient, 'healthSummary' | 'listBranches' | 'listTags'>;
const auth = {
listAllowedProjectKeys: jest.fn(() => Promise.resolve([project.key])),
requireProjectPermission: jest.fn(() => Promise.resolve()),
} satisfies Pick<
AuthService,
'listAllowedProjectKeys' | 'requireProjectPermission'
>;
return {
auth,
gitea,
repository,
service: new ProjectsService(
repository as unknown as ProjectRepository,
gitea as unknown as GiteaClient,
auth as unknown as AuthService,
),
};
}