Constructor
new WebSecurityScannerClient(optionsopt)
Construct an instance of WebSecurityScannerClient.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. The options accepted by the constructor are described in detail in this document. The common options are: Properties
|
Members
apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
port
The port for this API service.
scopes
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
The DNS address for this API service.
Methods
close() → {Promise}
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns:
| Type | Description |
|---|---|
| Promise |
A promise that resolves when the client is closed. |
createScanConfig(request, optionsopt) → {Promise}
Creates a new ScanConfig.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
deleteScanConfig(request, optionsopt) → {Promise}
Deletes an existing ScanConfig and its child resources.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
findingPath(project, scan_config, scan_run, finding) → {string}
Return a fully-qualified finding resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
string | |
scan_config |
string | |
scan_run |
string | |
finding |
string |
Returns:
| Type | Description |
|---|---|
| string |
Resource name string. |
getFinding(request, optionsopt) → {Promise}
Gets a Finding.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
getProjectId() → {Promise}
Return the project ID used by this class.
Returns:
| Type | Description |
|---|---|
| Promise |
A promise that resolves to string containing the project ID. |
getScanConfig(request, optionsopt) → {Promise}
Gets a ScanConfig.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
getScanRun(request, optionsopt) → {Promise}
Gets a ScanRun.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
initialize() → {Promise}
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns:
| Type | Description |
|---|---|
| Promise |
A promise that resolves to an authenticated service stub. |
listCrawledUrls(request, optionsopt) → {Promise}
List CrawledUrls under a given ScanRun.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
listCrawledUrlsAsync(request, optionsopt) → {Object}
Equivalent to listCrawledUrls, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing CrawledUrl. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
const iterable = client.listCrawledUrlsAsync(request);
for await (const response of iterable) {
// process response
}
listCrawledUrlsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing CrawledUrl on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listFindings(request, optionsopt) → {Promise}
List Findings under a given ScanRun.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
listFindingsAsync(request, optionsopt) → {Object}
Equivalent to listFindings, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Finding. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
const iterable = client.listFindingsAsync(request);
for await (const response of iterable) {
// process response
}
listFindingsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing Finding on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listFindingTypeStats(request, optionsopt) → {Promise}
List all FindingTypeStats under a given ScanRun.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
listScanConfigs(request, optionsopt) → {Promise}
Lists ScanConfigs under a given project.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
listScanConfigsAsync(request, optionsopt) → {Object}
Equivalent to listScanConfigs, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ScanConfig. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
const iterable = client.listScanConfigsAsync(request);
for await (const response of iterable) {
// process response
}
listScanConfigsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing ScanConfig on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listScanRuns(request, optionsopt) → {Promise}
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
listScanRunsAsync(request, optionsopt) → {Object}
Equivalent to listScanRuns, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ScanRun. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
const iterable = client.listScanRunsAsync(request);
for await (const response of iterable) {
// process response
}
listScanRunsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing ScanRun on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
matchFindingFromFindingName(findingName) → {string}
Parse the finding from Finding resource.
Parameters:
| Name | Type | Description |
|---|---|---|
findingName |
string |
A fully-qualified path representing Finding resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the finding. |
matchProjectFromFindingName(findingName) → {string}
Parse the project from Finding resource.
Parameters:
| Name | Type | Description |
|---|---|---|
findingName |
string |
A fully-qualified path representing Finding resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the project. |
matchProjectFromProjectName(projectName) → {string}
Parse the project from Project resource.
Parameters:
| Name | Type | Description |
|---|---|---|
projectName |
string |
A fully-qualified path representing Project resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the project. |
matchProjectFromScanConfigName(scanConfigName) → {string}
Parse the project from ScanConfig resource.
Parameters:
| Name | Type | Description |
|---|---|---|
scanConfigName |
string |
A fully-qualified path representing ScanConfig resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the project. |
matchProjectFromScanRunName(scanRunName) → {string}
Parse the project from ScanRun resource.
Parameters:
| Name | Type | Description |
|---|---|---|
scanRunName |
string |
A fully-qualified path representing ScanRun resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the project. |
matchScanConfigFromFindingName(findingName) → {string}
Parse the scan_config from Finding resource.
Parameters:
| Name | Type | Description |
|---|---|---|
findingName |
string |
A fully-qualified path representing Finding resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the scan_config. |
matchScanConfigFromScanConfigName(scanConfigName) → {string}
Parse the scan_config from ScanConfig resource.
Parameters:
| Name | Type | Description |
|---|---|---|
scanConfigName |
string |
A fully-qualified path representing ScanConfig resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the scan_config. |
matchScanConfigFromScanRunName(scanRunName) → {string}
Parse the scan_config from ScanRun resource.
Parameters:
| Name | Type | Description |
|---|---|---|
scanRunName |
string |
A fully-qualified path representing ScanRun resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the scan_config. |
matchScanRunFromFindingName(findingName) → {string}
Parse the scan_run from Finding resource.
Parameters:
| Name | Type | Description |
|---|---|---|
findingName |
string |
A fully-qualified path representing Finding resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the scan_run. |
matchScanRunFromScanRunName(scanRunName) → {string}
Parse the scan_run from ScanRun resource.
Parameters:
| Name | Type | Description |
|---|---|---|
scanRunName |
string |
A fully-qualified path representing ScanRun resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the scan_run. |
projectPath(project) → {string}
Return a fully-qualified project resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
string |
Returns:
| Type | Description |
|---|---|
| string |
Resource name string. |
scanConfigPath(project, scan_config) → {string}
Return a fully-qualified scanConfig resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
string | |
scan_config |
string |
Returns:
| Type | Description |
|---|---|
| string |
Resource name string. |
scanRunPath(project, scan_config, scan_run) → {string}
Return a fully-qualified scanRun resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
string | |
scan_config |
string | |
scan_run |
string |
Returns:
| Type | Description |
|---|---|
| string |
Resource name string. |
startScanRun(request, optionsopt) → {Promise}
Start a ScanRun according to the given ScanConfig.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
stopScanRun(request, optionsopt) → {Promise}
Stops a ScanRun. The stopped ScanRun is returned.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
updateScanConfig(request, optionsopt) → {Promise}
Updates a ScanConfig. This method support partial update of a ScanConfig.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|