Add packaged DLP broker and protected Windows service foundation
This commit is contained in:
1 parent
95d23f4e0b
commit
7b5057901a
140 files changed
+11215
-60
No files matched your search
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
const {GateError}=require('./http-request-gate.cjs');
|
||||
// A separate, server-global control budget prevents an unresponsive scan from
|
||||
// starving its terminal audit while still bounding all unfinished commits.
|
||||
async function recordLifecycle({admission,deadlineMs,context,code,facts,scope}){
|
||||
if(!context)return;
|
||||
let timer;
|
||||
try {
|
||||
const original=admission.run(()=>context.reject(code,facts,scope));
|
||||
return await Promise.race([original,new Promise((_,reject)=>{timer=setTimeout(()=>reject(new GateError('audit-deadline')),deadlineMs);})]);
|
||||
} finally {clearTimeout(timer);}
|
||||
}
|
||||
module.exports={recordLifecycle};
|
||||
Reference in new issue
Block a user