同步抛出验签失败异常
This commit is contained in:
parent
51c93a9402
commit
464ac88ed7
|
|
@ -566,7 +566,7 @@ class Synchronizer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!verify(publicKey, JSON.stringify(body), syncTs, syncNonce, syncSign)) {
|
if (!verify(publicKey, JSON.stringify(body), syncTs, syncNonce, syncSign)) {
|
||||||
throw new Error('sync验签失败');
|
throw new types_1.OakSignatureVerificationException('同步验签失败');
|
||||||
}
|
}
|
||||||
const opers = body;
|
const opers = body;
|
||||||
const ids = opers.map(ele => ele.id);
|
const ids = opers.map(ele => ele.id);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { createSign, createVerify } from 'crypto';
|
||||||
import {
|
import {
|
||||||
EntityDict, StorageSchema, EndpointItem, RemotePullInfo, SelfEncryptInfo,
|
EntityDict, StorageSchema, EndpointItem, RemotePullInfo, SelfEncryptInfo,
|
||||||
RemotePushInfo, PushEntityDef, PullEntityDef, SyncConfig, TriggerDataAttribute, TriggerUuidAttribute,
|
RemotePushInfo, PushEntityDef, PullEntityDef, SyncConfig, TriggerDataAttribute, TriggerUuidAttribute,
|
||||||
SyncRemoteConfig, OakPartialSuccess, OakRequestTimeoutException, OakClockDriftException
|
SyncRemoteConfig, OakPartialSuccess, OakRequestTimeoutException, OakClockDriftException, OakSignatureVerificationException
|
||||||
} from 'oak-domain/lib/types';
|
} from 'oak-domain/lib/types';
|
||||||
import { VolatileTrigger } from 'oak-domain/lib/types/Trigger';
|
import { VolatileTrigger } from 'oak-domain/lib/types/Trigger';
|
||||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
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)) {
|
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'][];
|
const opers = body as ED['oper']['Schema'][];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue