同步抛出验签失败异常

This commit is contained in:
wkj 2025-04-16 09:35:28 +08:00
parent 51c93a9402
commit 464ac88ed7
2 changed files with 3 additions and 3 deletions

View File

@ -566,7 +566,7 @@ class Synchronizer {
}
}
if (!verify(publicKey, JSON.stringify(body), syncTs, syncNonce, syncSign)) {
throw new Error('sync验签失败');
throw new types_1.OakSignatureVerificationException('同步验签失败');
}
const opers = body;
const ids = opers.map(ele => ele.id);

View File

@ -2,7 +2,7 @@ import { createSign, createVerify } from 'crypto';
import {
EntityDict, StorageSchema, EndpointItem, RemotePullInfo, SelfEncryptInfo,
RemotePushInfo, PushEntityDef, PullEntityDef, SyncConfig, TriggerDataAttribute, TriggerUuidAttribute,
SyncRemoteConfig, OakPartialSuccess, OakRequestTimeoutException, OakClockDriftException
SyncRemoteConfig, OakPartialSuccess, OakRequestTimeoutException, OakClockDriftException, OakSignatureVerificationException
} from 'oak-domain/lib/types';
import { VolatileTrigger } from 'oak-domain/lib/types/Trigger';
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
@ -724,7 +724,7 @@ export default class Synchronizer<ED extends EntityDict & BaseEntityDict, Cxt ex
}
if (!verify(publicKey, JSON.stringify(body), syncTs as string, syncNonce as string, syncSign as string)) {
throw new Error('sync验签失败');
throw new OakSignatureVerificationException('同步验签失败');
}
const opers = body as ED['oper']['Schema'][];