pub struct WebSecurityScanner { /* private fields */ }Expand description
Implements a client for the Web Security Scanner API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = WebSecurityScanner::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_findings()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
Web Security Scanner Service identifies security vulnerabilities in web applications hosted on Google Cloud. It crawls your application, and attempts to exercise as many user inputs and event handlers as possible.
§Configuration
To configure WebSecurityScanner use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://websecurityscanner.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
WebSecurityScanner holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap WebSecurityScanner in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl WebSecurityScanner
impl WebSecurityScanner
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for WebSecurityScanner.
let client = WebSecurityScanner::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: WebSecurityScanner + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: WebSecurityScanner + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_scan_config(&self) -> CreateScanConfig
pub fn create_scan_config(&self) -> CreateScanConfig
Creates a new ScanConfig.
§Example
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let response = client.create_scan_config()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_scan_config(&self) -> DeleteScanConfig
pub fn delete_scan_config(&self) -> DeleteScanConfig
Deletes an existing ScanConfig and its child resources.
§Example
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
client.delete_scan_config()
/* set fields */
.send().await?;
Ok(())
}Sourcepub fn get_scan_config(&self) -> GetScanConfig
pub fn get_scan_config(&self) -> GetScanConfig
Gets a ScanConfig.
§Example
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let response = client.get_scan_config()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_scan_configs(&self) -> ListScanConfigs
pub fn list_scan_configs(&self) -> ListScanConfigs
Lists ScanConfigs under a given project.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let mut list = client.list_scan_configs()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn update_scan_config(&self) -> UpdateScanConfig
pub fn update_scan_config(&self) -> UpdateScanConfig
Updates a ScanConfig. This method support partial update of a ScanConfig.
§Example
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let response = client.update_scan_config()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn start_scan_run(&self) -> StartScanRun
pub fn start_scan_run(&self) -> StartScanRun
Start a ScanRun according to the given ScanConfig.
§Example
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let response = client.start_scan_run()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_scan_run(&self) -> GetScanRun
pub fn get_scan_run(&self) -> GetScanRun
Gets a ScanRun.
§Example
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let response = client.get_scan_run()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_scan_runs(&self) -> ListScanRuns
pub fn list_scan_runs(&self) -> ListScanRuns
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let mut list = client.list_scan_runs()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn stop_scan_run(&self) -> StopScanRun
pub fn stop_scan_run(&self) -> StopScanRun
Stops a ScanRun. The stopped ScanRun is returned.
§Example
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let response = client.stop_scan_run()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_crawled_urls(&self) -> ListCrawledUrls
pub fn list_crawled_urls(&self) -> ListCrawledUrls
List CrawledUrls under a given ScanRun.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let mut list = client.list_crawled_urls()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_finding(&self) -> GetFinding
pub fn get_finding(&self) -> GetFinding
Gets a Finding.
§Example
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let response = client.get_finding()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_findings(&self) -> ListFindings
pub fn list_findings(&self) -> ListFindings
List Findings under a given ScanRun.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner, parent: &str
) -> Result<()> {
let mut list = client.list_findings()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn list_finding_type_stats(&self) -> ListFindingTypeStats
pub fn list_finding_type_stats(&self) -> ListFindingTypeStats
List all FindingTypeStats under a given ScanRun.
§Example
use google_cloud_websecurityscanner_v1::Result;
async fn sample(
client: &WebSecurityScanner
) -> Result<()> {
let response = client.list_finding_type_stats()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Trait Implementations§
Source§impl Clone for WebSecurityScanner
impl Clone for WebSecurityScanner
Source§fn clone(&self) -> WebSecurityScanner
fn clone(&self) -> WebSecurityScanner
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more