mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-21 00:38:14 +08:00
feat(ql3): establish 3.0 incubation baseline
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import type { CompletionReceipt } from '../../domain/completionReceipt';
|
||||
import { matchesWorkerExecutionCompletionReceiptAuthentication } from '../../domain/workerExecutionCompletionReceiptAuthentication';
|
||||
import type { WorkerExecutionOfferJournalRecord } from '../../domain/workerExecutionOffer';
|
||||
import type { WorkerExecutionCompletionReceiptAuthenticator } from '../../ports/workerExecutionCompletionReceiptAuthenticator';
|
||||
|
||||
export class Sha256WorkerExecutionCompletionReceiptAuthenticator
|
||||
implements WorkerExecutionCompletionReceiptAuthenticator
|
||||
{
|
||||
authenticate(
|
||||
receipt: CompletionReceipt,
|
||||
record: WorkerExecutionOfferJournalRecord,
|
||||
): boolean {
|
||||
if (
|
||||
record.completionReceiptCallbackSequence === undefined ||
|
||||
record.completionReceiptTokenDigest === undefined
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return matchesWorkerExecutionCompletionReceiptAuthentication(receipt, {
|
||||
callbackSequence: record.completionReceiptCallbackSequence,
|
||||
tokenDigest: record.completionReceiptTokenDigest,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user