public class ScannerFacade extends 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) |
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>
|
List<JsLibraryResult> |
scanPath(String path)
Analyze a script with only its path is available.
|
List<JsLibraryResult> |
scanScript(String path,
byte[] respBytes,
int offset)
Analyze script with the JavaScript file is loaded.
|
public ScannerFacade(VulnerabilitiesRepository repo) throws IOException
repo - Mock repository (For testing purpose)IOException - Unable to load the repositorypublic static ScannerFacade getInstance() throws IOException
IOException - Unable to load the repositorypublic static ScannerFacade loadInstance(VulnerabilitiesRepository repo) throws IOException
IOExceptionpublic List<JsLibraryResult> scanHtml(byte[] respBytes, int offset)
respBytes - Content of the JavaScript file (exclude HTTP headers)offset - public List<JsLibraryResult> scanPath(String path)
path - File path (ie: /js/jquery/jquery-1.3.3.7.js)public List<JsLibraryResult> scanScript(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 - Copyright © 2018. All rights reserved.