Harden Windows DLP enforcement and Electron runtime packaging
This commit is contained in:
1 parent
e7d778aeac
commit
8a253eda89
120 files changed
+3569
-135
No files matched your search
@@ -139,7 +139,7 @@ function createAgentAdapters({getContext,getSessions,contextCurrent,navigate,his
|
||||
};
|
||||
const dom = mode => async (args,{signal}={}) => {
|
||||
const initial = snapshot(args,signal,mode);
|
||||
if (mode!=='read' && (typeof args.selector!=='string' || args.selector.length>512 || !/^[a-zA-Z0-9_#.*\[\]="' >+~-]+$/.test(args.selector))) throw Error('Invalid selector');
|
||||
if (mode!=='read' && (typeof args.selector!=='string' || args.selector.length>512 || !/^[a-zA-Z0-9_#.*[\]="' >+~-]+$/.test(args.selector))) throw Error('Invalid selector');
|
||||
if (mode==='type' && (typeof args.text!=='string' || args.text.length>16384)) throw Error('Invalid text');
|
||||
if (mode==='select' && (typeof args.value!=='string' || args.value.length>16384)) throw Error('Invalid value');
|
||||
if (mode==='check' && typeof args.checked!=='boolean') throw Error('Invalid checked state');
|
||||
@@ -200,6 +200,7 @@ await onInteraction({action:'click',sessionId:initial.sessionId,pageUrl:initial.
|
||||
for(const [id,item] of historySnapshots)if(item.expires<=Date.now())historySnapshots.delete(id);
|
||||
while(historySnapshots.size>=32)historySnapshots.delete(historySnapshots.keys().next().value);
|
||||
const snapshotId=randomUUID();historySnapshots.set(snapshotId,{initial,binding,actorBinding,entries,expires:Date.now()+60000});
|
||||
// eslint-disable-next-line no-unused-vars -- Strip private native indexes and navigation flags from released metadata.
|
||||
return {snapshotId,entries:entries.map(({index,navigable,...row})=>row)};
|
||||
},
|
||||
'history:go':async(args={}, {signal}={})=>{
|
||||
@@ -237,7 +238,7 @@ await onInteraction({action:'click',sessionId:initial.sessionId,pageUrl:initial.
|
||||
...appAdapters,
|
||||
...historyAdapters,
|
||||
...historyAdaptersExtra,
|
||||
sessions:async(args={}, {signal}={})=>{
|
||||
sessions:async(_args={}, {signal}={})=>{
|
||||
const c=getContext();
|
||||
if(signal?.aborted || !c?.ready || !c.policy?.agents?.enabled || !c.policy.agents.scopes?.includes('sessions') || (c.policy.expiresAt && Date.parse(c.policy.expiresAt)<=Date.now())) throw Error('Managed session unavailable');
|
||||
const version=c.policyVersion??c.policy.version;
|
||||
|
||||
Reference in new issue
Block a user