public class ScannerFacade
extends java.lang.Object
| Constructor and Description |
|---|
ScannerFacade(VulnerabilitiesRepository repo)
For testing purpose only
|
| Modifier and Type | Method and Description |
|---|---|
static ScannerFacade |
getInstance()
Obtain the singleton instance.
|
static ScannerFacade |
loadInstance(VulnerabilitiesRepository repo) |
java.util.List<JsLibraryResult> |
scanHtml(byte[] respBytes,
int offset)
Look for potential script in the HTML code <script src="//cdn.server.com/jquery/1.3.3.7.js"></script>
|
java.util.List<JsLibraryResult> |
scanPath(java.lang.String path)
Analyze a script with only its path is available.
|
java.util.List<JsLibraryResult> |
scanScript(java.lang.String path,
byte[] respBytes,
int offset)
Analyze script with the JavaScript file is loaded.
|
public ScannerFacade(VulnerabilitiesRepository repo) throws java.io.IOException
repo - Mock repository (For testing purpose)java.io.IOException - Unable to load the repositorypublic static ScannerFacade getInstance() throws java.io.IOException, org.json.JSONException
java.io.IOException - Unable to load the repositoryorg.json.JSONExceptionpublic static ScannerFacade loadInstance(VulnerabilitiesRepository repo) throws java.io.IOException
java.io.IOExceptionpublic java.util.List<JsLibraryResult> scanHtml(byte[] respBytes, int offset)
respBytes - Content of the JavaScript file (exclude HTTP headers)offset - The body of the response starts at this offsetpublic java.util.List<JsLibraryResult> scanPath(java.lang.String path)
path - File path (ie: /js/jquery/jquery-1.3.3.7.js)public java.util.List<JsLibraryResult> scanScript(java.lang.String path, byte[] respBytes, int offset)
path - File path (ie: /js/jquery/jquery-1.3.3.7.js)respBytes - Content of the JavaScript file (exclude HTTP headers)offset - The body of the response starts at this offsetCopyright © 2022. All rights reserved.