mirror of
https://github.com/certd/certd.git
synced 2026-07-14 17:53:28 +08:00
Merge branch 'v2-dev' into v2_audit_log
This commit is contained in:
@@ -10,6 +10,7 @@ import { ApiTags } from "@midwayjs/swagger";
|
||||
import { CodeService } from "../../../modules/basic/service/code-service.js";
|
||||
import { EmailService } from "../../../modules/basic/service/email-service.js";
|
||||
import { AuditType } from "../../../modules/sys/enterprise/service/audit-constants.js";
|
||||
import { TaskServiceBuilder } from "../../../modules/pipeline/service/getter/task-service-getter.js";
|
||||
|
||||
/**
|
||||
*/
|
||||
@@ -44,6 +45,8 @@ export class MineController extends BaseController {
|
||||
getAuditType(): string {
|
||||
return AuditType.mine;
|
||||
}
|
||||
@Inject()
|
||||
taskServiceBuilder: TaskServiceBuilder;
|
||||
|
||||
@Post("/info", { description: Constants.per.authOnly, summary: "查询用户信息" })
|
||||
public async info() {
|
||||
@@ -186,11 +189,13 @@ export class MineController extends BaseController {
|
||||
|
||||
const getAccessById = this.accessService.getById.bind(this.accessService);
|
||||
const accessGetter = new AccessGetter(userId, undefined, getAccessById);
|
||||
const serviceGetter = this.taskServiceBuilder.create({ userId });
|
||||
const accessContext = {
|
||||
http,
|
||||
logger,
|
||||
utils,
|
||||
accessService: accessGetter,
|
||||
serviceGetter,
|
||||
define: undefined,
|
||||
} as any;
|
||||
const access = await newAccess("acmeAccount", { caType: "letsencrypt", email: userEmail }, accessGetter, accessContext);
|
||||
|
||||
@@ -8,7 +8,6 @@ import { TaskServiceBuilder } from "../../../modules/pipeline/service/getter/tas
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import { ApiTags } from "@midwayjs/swagger";
|
||||
import { AuthService } from "../../../modules/sys/authority/service/auth-service.js";
|
||||
import { RuntimeDepsService } from "../../../modules/runtime-deps/runtime-deps-service.js";
|
||||
|
||||
@Provide()
|
||||
@Controller("/api/pi/handle")
|
||||
@@ -29,9 +28,6 @@ export class HandleController extends BaseController {
|
||||
@Inject()
|
||||
notificationService: NotificationService;
|
||||
|
||||
@Inject()
|
||||
runtimeDepsService: RuntimeDepsService;
|
||||
|
||||
@Post("/access", { description: Constants.per.authOnly, summary: "处理授权请求" })
|
||||
async accessRequest(@Body(ALL) body: AccessRequestHandleReq) {
|
||||
let { projectId, userId } = await this.getProjectUserIdRead();
|
||||
@@ -64,12 +60,14 @@ export class HandleController extends BaseController {
|
||||
}
|
||||
}
|
||||
const getAccessById = this.accessService.getById.bind(this.accessService);
|
||||
const accessGetter = new AccessGetter(userId, projectId, getAccessById, this.runtimeDepsService);
|
||||
const accessGetter = new AccessGetter(userId, projectId, getAccessById);
|
||||
const serviceGetter = this.taskServiceBuilder.create({ userId, projectId });
|
||||
const accessContext = {
|
||||
http,
|
||||
logger,
|
||||
utils,
|
||||
accessService: accessGetter,
|
||||
serviceGetter,
|
||||
define: undefined,
|
||||
} as any;
|
||||
const access = await newAccess(body.typeName, inputAccess, accessGetter, accessContext);
|
||||
|
||||
Reference in New Issue
Block a user