Merge branch 'v2' of https://github.com/certd/certd into v2

This commit is contained in:
xiaojunnuo
2026-03-20 12:09:01 +08:00
43 changed files with 281 additions and 144 deletions
@@ -190,8 +190,10 @@ export class PipelineController extends CrudController<PipelineService> {
}
@Post('/update', { description: Constants.per.authOnly })
async update(@Body(ALL) bean) {
return await this.save(bean);
async update(@Body(ALL) bean:PipelineEntity) {
await this.checkOwner(this.getService(), bean.id,"write",true);
await this.service.update(bean as any);
return this.ok({});
}
@Post('/save', { description: Constants.per.authOnly, summary: '新增/更新流水线' })
@@ -230,9 +230,10 @@ export class PasskeyService extends BaseService<PasskeyEntity> {
throw new AuthException("Passkey不存在");
}
if (verification.counter <= passkey.counter) {
throw new AuthException("认证失败:计数器异常");
}
// 可同步密钥 各个客户端的计数器不是单调递增的,此规范基本上都不遵守了
// if (verification.counter <= passkey.counter && passkey.counter > 0) {
// throw new AuthException("认证失败:计数器异常");
// }
passkey.counter = verification.counter;
passkey.updateTime = new Date();
@@ -259,6 +259,9 @@ export class PipelineService extends BaseService<PipelineEntity> {
bean.order = old.order;
bean.userId = old.userId;
bean.projectId = old.projectId;
if (bean.content == null) {
bean.content = old.content;
}
}
if (!old || !old.webhookKey) {
bean.webhookKey = await this.genWebhookKey();