-
Notifications
You must be signed in to change notification settings - Fork 719
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2058 from yaklang/yj/feature/audit-code-scan-done
Yj/feature/audit code scan done
- Loading branch information
Showing
129 changed files
with
13,856 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
const {ipcMain} = require("electron"); | ||
|
||
module.exports = (win, getClient) => { | ||
const asyncQuerySyntaxFlowRuleGroup = (params) => { | ||
return new Promise((resolve, reject) => { | ||
getClient().QuerySyntaxFlowRuleGroup(params, (err, data) => { | ||
if (err) { | ||
reject(err) | ||
return | ||
} | ||
resolve(data) | ||
}) | ||
}) | ||
} | ||
// 获取规则组数据 | ||
ipcMain.handle("QuerySyntaxFlowRuleGroup", async (e, params) => { | ||
return await asyncQuerySyntaxFlowRuleGroup(params) | ||
}) | ||
|
||
const asyncQuerySyntaxFlowRule = (params) => { | ||
return new Promise((resolve, reject) => { | ||
getClient().QuerySyntaxFlowRule(params, (err, data) => { | ||
if (err) { | ||
reject(err) | ||
return | ||
} | ||
resolve(data) | ||
}) | ||
}) | ||
} | ||
// 获取规则组所含规则 | ||
ipcMain.handle("QuerySyntaxFlowRule", async (e, params) => { | ||
return await asyncQuerySyntaxFlowRule(params) | ||
}) | ||
|
||
// 规则执行 | ||
const handlerHelper = require("./handleStreamWithContext"); | ||
const streamSyntaxFlowScanMap = new Map(); | ||
ipcMain.handle("cancel-SyntaxFlowScan", handlerHelper.cancelHandler(streamSyntaxFlowScanMap)); | ||
ipcMain.handle("SyntaxFlowScan", (e, params, token) => { | ||
let stream = streamSyntaxFlowScanMap.get(token) | ||
if (stream) { | ||
stream.write(params) | ||
return | ||
} | ||
stream = getClient().SyntaxFlowScan(); | ||
stream.write(params) | ||
handlerHelper.registerHandler(win, stream, streamSyntaxFlowScanMap, token) | ||
}) | ||
|
||
const asyncQuerySyntaxFlowResult = (params) => { | ||
return new Promise((resolve, reject) => { | ||
getClient().QuerySyntaxFlowResult(params, (err, data) => { | ||
if (err) { | ||
reject(err) | ||
return | ||
} | ||
resolve(data) | ||
}) | ||
}) | ||
} | ||
// 获取审计结果 | ||
ipcMain.handle("QuerySyntaxFlowResult", async (e, params) => { | ||
return await asyncQuerySyntaxFlowResult(params) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import {CodeScanPageInfoProps} from "@/store/pageInfo" | ||
|
||
export const defaultCodeScanPageInfo: CodeScanPageInfoProps = { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.