fix(core): update
This commit is contained in:
parent
e59ca8efca
commit
82800ec56f
@ -3,7 +3,7 @@ import * as plugins from './sl.receiver.plugins';
|
|||||||
import {
|
import {
|
||||||
ILogPackage,
|
ILogPackage,
|
||||||
ILogPackageAuthenticated,
|
ILogPackageAuthenticated,
|
||||||
ILogDestination
|
ILogDestination,
|
||||||
} from '@pushrocks/smartlog-interfaces';
|
} from '@pushrocks/smartlog-interfaces';
|
||||||
|
|
||||||
export type TValidatorFunction = (logPackage: ILogPackage) => boolean;
|
export type TValidatorFunction = (logPackage: ILogPackage) => boolean;
|
||||||
@ -36,7 +36,11 @@ export class SmartlogReceiver {
|
|||||||
const logPackage = authenticatedLogPackageArg.logPackage;
|
const logPackage = authenticatedLogPackageArg.logPackage;
|
||||||
|
|
||||||
if (authString === plugins.smarthash.sha256FromStringSync(this.passphrase)) {
|
if (authString === plugins.smarthash.sha256FromStringSync(this.passphrase)) {
|
||||||
// this.smartlogInstance.log('ok', 'Message accepted');
|
// Message authenticated lets clean up.
|
||||||
|
logPackage.correlation ? null : (logPackage.correlation = { id: '123', type: 'none' });
|
||||||
|
logPackage.correlation.id ? null : (logPackage.correlation.id = '123');
|
||||||
|
logPackage.correlation.type ? null : (logPackage.correlation.type = 'none');
|
||||||
|
|
||||||
this.smartlogInstance.handleLog(logPackage);
|
this.smartlogInstance.handleLog(logPackage);
|
||||||
return { status: 'ok' };
|
return { status: 'ok' };
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user