1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278
// This file is @generated by prost-build.
/// A ScanRun is a output-only resource representing an actual run of the scan.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScanRun {
/// The resource name of the ScanRun. The name follows the format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
/// The ScanRun IDs are generated by the system.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The execution state of the ScanRun.
#[prost(enumeration = "scan_run::ExecutionState", tag = "2")]
pub execution_state: i32,
/// The result state of the ScanRun. This field is only available after the
/// execution state reaches "FINISHED".
#[prost(enumeration = "scan_run::ResultState", tag = "3")]
pub result_state: i32,
/// The time at which the ScanRun started.
#[prost(message, optional, tag = "4")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
/// The time at which the ScanRun reached termination state - that the ScanRun
/// is either finished or stopped by user.
#[prost(message, optional, tag = "5")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
/// The number of URLs crawled during this ScanRun. If the scan is in progress,
/// the value represents the number of URLs crawled up to now.
#[prost(int64, tag = "6")]
pub urls_crawled_count: i64,
/// The number of URLs tested during this ScanRun. If the scan is in progress,
/// the value represents the number of URLs tested up to now. The number of
/// URLs tested is usually larger than the number URLS crawled because
/// typically a crawled URL is tested with multiple test payloads.
#[prost(int64, tag = "7")]
pub urls_tested_count: i64,
/// Whether the scan run has found any vulnerabilities.
#[prost(bool, tag = "8")]
pub has_vulnerabilities: bool,
/// The percentage of total completion ranging from 0 to 100.
/// If the scan is in queue, the value is 0.
/// If the scan is running, the value ranges from 0 to 100.
/// If the scan is finished, the value is 100.
#[prost(int32, tag = "9")]
pub progress_percent: i32,
}
/// Nested message and enum types in `ScanRun`.
pub mod scan_run {
/// Types of ScanRun execution state.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ExecutionState {
/// Represents an invalid state caused by internal server error. This value
/// should never be returned.
Unspecified = 0,
/// The scan is waiting in the queue.
Queued = 1,
/// The scan is in progress.
Scanning = 2,
/// The scan is either finished or stopped by user.
Finished = 3,
}
impl ExecutionState {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ExecutionState::Unspecified => "EXECUTION_STATE_UNSPECIFIED",
ExecutionState::Queued => "QUEUED",
ExecutionState::Scanning => "SCANNING",
ExecutionState::Finished => "FINISHED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"QUEUED" => Some(Self::Queued),
"SCANNING" => Some(Self::Scanning),
"FINISHED" => Some(Self::Finished),
_ => None,
}
}
}
/// Types of ScanRun result state.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ResultState {
/// Default value. This value is returned when the ScanRun is not yet
/// finished.
Unspecified = 0,
/// The scan finished without errors.
Success = 1,
/// The scan finished with errors.
Error = 2,
/// The scan was terminated by user.
Killed = 3,
}
impl ResultState {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ResultState::Unspecified => "RESULT_STATE_UNSPECIFIED",
ResultState::Success => "SUCCESS",
ResultState::Error => "ERROR",
ResultState::Killed => "KILLED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RESULT_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"SUCCESS" => Some(Self::Success),
"ERROR" => Some(Self::Error),
"KILLED" => Some(Self::Killed),
_ => None,
}
}
}
}
/// Information reported for an outdated library.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutdatedLibrary {
/// The name of the outdated library.
#[prost(string, tag = "1")]
pub library_name: ::prost::alloc::string::String,
/// The version number.
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
/// URLs to learn more information about the vulnerabilities in the library.
#[prost(string, repeated, tag = "3")]
pub learn_more_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Information regarding any resource causing the vulnerability such
/// as JavaScript sources, image, audio files, etc.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ViolatingResource {
/// The MIME type of this resource.
#[prost(string, tag = "1")]
pub content_type: ::prost::alloc::string::String,
/// URL of this violating resource.
#[prost(string, tag = "2")]
pub resource_url: ::prost::alloc::string::String,
}
/// Information about vulnerable request parameters.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VulnerableParameters {
/// The vulnerable parameter names.
#[prost(string, repeated, tag = "1")]
pub parameter_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Information about vulnerable or missing HTTP Headers.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VulnerableHeaders {
/// List of vulnerable headers.
#[prost(message, repeated, tag = "1")]
pub headers: ::prost::alloc::vec::Vec<vulnerable_headers::Header>,
/// List of missing headers.
#[prost(message, repeated, tag = "2")]
pub missing_headers: ::prost::alloc::vec::Vec<vulnerable_headers::Header>,
}
/// Nested message and enum types in `VulnerableHeaders`.
pub mod vulnerable_headers {
/// Describes a HTTP Header.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Header {
/// Header name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Header value.
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
}
/// Information reported for an XSS.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Xss {
/// Stack traces leading to the point where the XSS occurred.
#[prost(string, repeated, tag = "1")]
pub stack_traces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// An error message generated by a javascript breakage.
#[prost(string, tag = "2")]
pub error_message: ::prost::alloc::string::String,
}
/// A ScanConfig resource contains the configurations to launch a scan.
/// next id: 12
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScanConfig {
/// The resource name of the ScanConfig. The name follows the format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
/// generated by the system.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Required. The user provided display name of the ScanConfig.
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
/// The maximum QPS during scanning. A valid value ranges from 5 to 20
/// inclusively. If the field is unspecified or its value is set 0, server will
/// default to 15. Other values outside of \[5, 20\] range will be rejected with
/// INVALID_ARGUMENT error.
#[prost(int32, tag = "3")]
pub max_qps: i32,
/// Required. The starting URLs from which the scanner finds site pages.
#[prost(string, repeated, tag = "4")]
pub starting_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The authentication configuration. If specified, service will use the
/// authentication configuration during scanning.
#[prost(message, optional, tag = "5")]
pub authentication: ::core::option::Option<scan_config::Authentication>,
/// The user agent used during scanning.
#[prost(enumeration = "scan_config::UserAgent", tag = "6")]
pub user_agent: i32,
/// The blacklist URL patterns as described in
/// <https://cloud.google.com/security-scanner/docs/excluded-urls>
#[prost(string, repeated, tag = "7")]
pub blacklist_patterns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The schedule of the ScanConfig.
#[prost(message, optional, tag = "8")]
pub schedule: ::core::option::Option<scan_config::Schedule>,
/// Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be
/// used as a default.
#[prost(enumeration = "scan_config::TargetPlatform", repeated, tag = "9")]
pub target_platforms: ::prost::alloc::vec::Vec<i32>,
/// Latest ScanRun if available.
#[prost(message, optional, tag = "11")]
pub latest_run: ::core::option::Option<ScanRun>,
}
/// Nested message and enum types in `ScanConfig`.
pub mod scan_config {
/// Scan authentication configuration.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Authentication {
/// Required.
/// Authentication configuration
#[prost(oneof = "authentication::Authentication", tags = "1, 2")]
pub authentication: ::core::option::Option<authentication::Authentication>,
}
/// Nested message and enum types in `Authentication`.
pub mod authentication {
/// Describes authentication configuration that uses a Google account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GoogleAccount {
/// Required. The user name of the Google account.
#[prost(string, tag = "1")]
pub username: ::prost::alloc::string::String,
/// Required. Input only. The password of the Google account. The credential is stored encrypted
/// and not returned in any response nor included in audit logs.
#[prost(string, tag = "2")]
pub password: ::prost::alloc::string::String,
}
/// Describes authentication configuration that uses a custom account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CustomAccount {
/// Required. The user name of the custom account.
#[prost(string, tag = "1")]
pub username: ::prost::alloc::string::String,
/// Required. Input only. The password of the custom account. The credential is stored encrypted
/// and not returned in any response nor included in audit logs.
#[prost(string, tag = "2")]
pub password: ::prost::alloc::string::String,
/// Required. The login form URL of the website.
#[prost(string, tag = "3")]
pub login_url: ::prost::alloc::string::String,
}
/// Required.
/// Authentication configuration
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Authentication {
/// Authentication using a Google account.
#[prost(message, tag = "1")]
GoogleAccount(GoogleAccount),
/// Authentication using a custom account.
#[prost(message, tag = "2")]
CustomAccount(CustomAccount),
}
}
/// Scan schedule configuration.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Schedule {
/// A timestamp indicates when the next run will be scheduled. The value is
/// refreshed by the server after each run. If unspecified, it will default
/// to current server time, which means the scan will be scheduled to start
/// immediately.
#[prost(message, optional, tag = "1")]
pub schedule_time: ::core::option::Option<::prost_types::Timestamp>,
/// Required. The duration of time between executions in days.
#[prost(int32, tag = "2")]
pub interval_duration_days: i32,
}
/// Type of user agents used for scanning.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum UserAgent {
/// The user agent is unknown. Service will default to CHROME_LINUX.
Unspecified = 0,
/// Chrome on Linux. This is the service default if unspecified.
ChromeLinux = 1,
/// Chrome on Android.
ChromeAndroid = 2,
/// Safari on IPhone.
SafariIphone = 3,
}
impl UserAgent {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
UserAgent::Unspecified => "USER_AGENT_UNSPECIFIED",
UserAgent::ChromeLinux => "CHROME_LINUX",
UserAgent::ChromeAndroid => "CHROME_ANDROID",
UserAgent::SafariIphone => "SAFARI_IPHONE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"USER_AGENT_UNSPECIFIED" => Some(Self::Unspecified),
"CHROME_LINUX" => Some(Self::ChromeLinux),
"CHROME_ANDROID" => Some(Self::ChromeAndroid),
"SAFARI_IPHONE" => Some(Self::SafariIphone),
_ => None,
}
}
}
/// Cloud platforms supported by Cloud Web Security Scanner.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TargetPlatform {
/// The target platform is unknown. Requests with this enum value will be
/// rejected with INVALID_ARGUMENT error.
Unspecified = 0,
/// Google App Engine service.
AppEngine = 1,
/// Google Compute Engine service.
Compute = 2,
}
impl TargetPlatform {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TargetPlatform::Unspecified => "TARGET_PLATFORM_UNSPECIFIED",
TargetPlatform::AppEngine => "APP_ENGINE",
TargetPlatform::Compute => "COMPUTE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TARGET_PLATFORM_UNSPECIFIED" => Some(Self::Unspecified),
"APP_ENGINE" => Some(Self::AppEngine),
"COMPUTE" => Some(Self::Compute),
_ => None,
}
}
}
}
/// A Finding resource represents a vulnerability instance identified during a
/// ScanRun.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Finding {
/// The resource name of the Finding. The name follows the format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
/// The finding IDs are generated by the system.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The type of the Finding.
#[prost(enumeration = "finding::FindingType", tag = "2")]
pub finding_type: i32,
/// The http method of the request that triggered the vulnerability, in
/// uppercase.
#[prost(string, tag = "3")]
pub http_method: ::prost::alloc::string::String,
/// The URL produced by the server-side fuzzer and used in the request that
/// triggered the vulnerability.
#[prost(string, tag = "4")]
pub fuzzed_url: ::prost::alloc::string::String,
/// The body of the request that triggered the vulnerability.
#[prost(string, tag = "5")]
pub body: ::prost::alloc::string::String,
/// The description of the vulnerability.
#[prost(string, tag = "6")]
pub description: ::prost::alloc::string::String,
/// The URL containing human-readable payload that user can leverage to
/// reproduce the vulnerability.
#[prost(string, tag = "7")]
pub reproduction_url: ::prost::alloc::string::String,
/// If the vulnerability was originated from nested IFrame, the immediate
/// parent IFrame is reported.
#[prost(string, tag = "8")]
pub frame_url: ::prost::alloc::string::String,
/// The URL where the browser lands when the vulnerability is detected.
#[prost(string, tag = "9")]
pub final_url: ::prost::alloc::string::String,
/// The tracking ID uniquely identifies a vulnerability instance across
/// multiple ScanRuns.
#[prost(string, tag = "10")]
pub tracking_id: ::prost::alloc::string::String,
/// An addon containing information about outdated libraries.
#[prost(message, optional, tag = "11")]
pub outdated_library: ::core::option::Option<OutdatedLibrary>,
/// An addon containing detailed information regarding any resource causing the
/// vulnerability such as JavaScript sources, image, audio files, etc.
#[prost(message, optional, tag = "12")]
pub violating_resource: ::core::option::Option<ViolatingResource>,
/// An addon containing information about vulnerable or missing HTTP headers.
#[prost(message, optional, tag = "15")]
pub vulnerable_headers: ::core::option::Option<VulnerableHeaders>,
/// An addon containing information about request parameters which were found
/// to be vulnerable.
#[prost(message, optional, tag = "13")]
pub vulnerable_parameters: ::core::option::Option<VulnerableParameters>,
/// An addon containing information reported for an XSS, if any.
#[prost(message, optional, tag = "14")]
pub xss: ::core::option::Option<Xss>,
}
/// Nested message and enum types in `Finding`.
pub mod finding {
/// Types of Findings.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum FindingType {
/// The invalid finding type.
Unspecified = 0,
/// A page that was served over HTTPS also resources over HTTP. A
/// man-in-the-middle attacker could tamper with the HTTP resource and gain
/// full access to the website that loads the resource or to monitor the
/// actions taken by the user.
MixedContent = 1,
/// The version of an included library is known to contain a security issue.
/// The scanner checks the version of library in use against a known list of
/// vulnerable libraries. False positives are possible if the version
/// detection fails or if the library has been manually patched.
OutdatedLibrary = 2,
/// This type of vulnerability occurs when the value of a request parameter
/// is reflected at the beginning of the response, for example, in requests
/// using JSONP. Under certain circumstances, an attacker may be able to
/// supply an alphanumeric-only Flash file in the vulnerable parameter
/// causing the browser to execute the Flash file as if it originated on the
/// vulnerable server.
RosettaFlash = 5,
/// A cross-site scripting (XSS) bug is found via JavaScript callback. For
/// detailed explanations on XSS, see
/// <https://www.google.com/about/appsecurity/learning/xss/.>
XssCallback = 3,
/// A potential cross-site scripting (XSS) bug due to JavaScript breakage.
/// In some circumstances, the application under test might modify the test
/// string before it is parsed by the browser. When the browser attempts to
/// runs this modified test string, it will likely break and throw a
/// JavaScript execution error, thus an injection issue is occurring.
/// However, it may not be exploitable. Manual verification is needed to see
/// if the test string modifications can be evaded and confirm that the issue
/// is in fact an XSS vulnerability. For detailed explanations on XSS, see
/// <https://www.google.com/about/appsecurity/learning/xss/.>
XssError = 4,
/// An application appears to be transmitting a password field in clear text.
/// An attacker can eavesdrop network traffic and sniff the password field.
ClearTextPassword = 6,
/// An application returns sensitive content with an invalid content type,
/// or without an 'X-Content-Type-Options: nosniff' header.
InvalidContentType = 7,
/// A cross-site scripting (XSS) vulnerability in AngularJS module that
/// occurs when a user-provided string is interpolated by Angular.
XssAngularCallback = 8,
/// A malformed or invalid valued header.
InvalidHeader = 9,
/// Misspelled security header name.
MisspelledSecurityHeaderName = 10,
/// Mismatching values in a duplicate security header.
MismatchingSecurityHeaderValues = 11,
}
impl FindingType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
FindingType::Unspecified => "FINDING_TYPE_UNSPECIFIED",
FindingType::MixedContent => "MIXED_CONTENT",
FindingType::OutdatedLibrary => "OUTDATED_LIBRARY",
FindingType::RosettaFlash => "ROSETTA_FLASH",
FindingType::XssCallback => "XSS_CALLBACK",
FindingType::XssError => "XSS_ERROR",
FindingType::ClearTextPassword => "CLEAR_TEXT_PASSWORD",
FindingType::InvalidContentType => "INVALID_CONTENT_TYPE",
FindingType::XssAngularCallback => "XSS_ANGULAR_CALLBACK",
FindingType::InvalidHeader => "INVALID_HEADER",
FindingType::MisspelledSecurityHeaderName => {
"MISSPELLED_SECURITY_HEADER_NAME"
}
FindingType::MismatchingSecurityHeaderValues => {
"MISMATCHING_SECURITY_HEADER_VALUES"
}
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FINDING_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"MIXED_CONTENT" => Some(Self::MixedContent),
"OUTDATED_LIBRARY" => Some(Self::OutdatedLibrary),
"ROSETTA_FLASH" => Some(Self::RosettaFlash),
"XSS_CALLBACK" => Some(Self::XssCallback),
"XSS_ERROR" => Some(Self::XssError),
"CLEAR_TEXT_PASSWORD" => Some(Self::ClearTextPassword),
"INVALID_CONTENT_TYPE" => Some(Self::InvalidContentType),
"XSS_ANGULAR_CALLBACK" => Some(Self::XssAngularCallback),
"INVALID_HEADER" => Some(Self::InvalidHeader),
"MISSPELLED_SECURITY_HEADER_NAME" => {
Some(Self::MisspelledSecurityHeaderName)
}
"MISMATCHING_SECURITY_HEADER_VALUES" => {
Some(Self::MismatchingSecurityHeaderValues)
}
_ => None,
}
}
}
}
/// A FindingTypeStats resource represents stats regarding a specific FindingType
/// of Findings under a given ScanRun.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FindingTypeStats {
/// The finding type associated with the stats.
#[prost(enumeration = "finding::FindingType", tag = "1")]
pub finding_type: i32,
/// The count of findings belonging to this finding type.
#[prost(int32, tag = "2")]
pub finding_count: i32,
}
/// A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web
/// Security Scanner Service crawls the web applications, following all links
/// within the scope of sites, to find the URLs to test against.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CrawledUrl {
/// Output only. The http method of the request that was used to visit the URL, in
/// uppercase.
#[prost(string, tag = "1")]
pub http_method: ::prost::alloc::string::String,
/// Output only. The URL that was crawled.
#[prost(string, tag = "2")]
pub url: ::prost::alloc::string::String,
/// Output only. The body of the request that was used to visit the URL.
#[prost(string, tag = "3")]
pub body: ::prost::alloc::string::String,
}
/// Request for the `CreateScanConfig` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateScanConfigRequest {
/// Required. The parent resource name where the scan is created, which should be a
/// project resource name in the format 'projects/{projectId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Required. The ScanConfig to be created.
#[prost(message, optional, tag = "2")]
pub scan_config: ::core::option::Option<ScanConfig>,
}
/// Request for the `DeleteScanConfig` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteScanConfigRequest {
/// Required. The resource name of the ScanConfig to be deleted. The name follows the
/// format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `GetScanConfig` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetScanConfigRequest {
/// Required. The resource name of the ScanConfig to be returned. The name follows the
/// format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `ListScanConfigs` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListScanConfigsRequest {
/// Required. The parent resource name, which should be a project resource name in the
/// format 'projects/{projectId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// A token identifying a page of results to be returned. This should be a
/// `next_page_token` value returned from a previous List request.
/// If unspecified, the first page of results is returned.
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
/// The maximum number of ScanConfigs to return, can be limited by server.
/// If not specified or not positive, the implementation will select a
/// reasonable value.
#[prost(int32, tag = "3")]
pub page_size: i32,
}
/// Request for the `UpdateScanConfigRequest` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateScanConfigRequest {
/// Required. The ScanConfig to be updated. The name field must be set to identify the
/// resource to be updated. The values of fields not covered by the mask
/// will be ignored.
#[prost(message, optional, tag = "2")]
pub scan_config: ::core::option::Option<ScanConfig>,
/// Required. The update mask applies to the resource. For the `FieldMask` definition,
/// see
/// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask>
#[prost(message, optional, tag = "3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Response for the `ListScanConfigs` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListScanConfigsResponse {
/// The list of ScanConfigs returned.
#[prost(message, repeated, tag = "1")]
pub scan_configs: ::prost::alloc::vec::Vec<ScanConfig>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for the `StartScanRun` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartScanRunRequest {
/// Required. The resource name of the ScanConfig to be used. The name follows the
/// format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `GetScanRun` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetScanRunRequest {
/// Required. The resource name of the ScanRun to be returned. The name follows the
/// format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `ListScanRuns` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListScanRunsRequest {
/// Required. The parent resource name, which should be a scan resource name in the
/// format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// A token identifying a page of results to be returned. This should be a
/// `next_page_token` value returned from a previous List request.
/// If unspecified, the first page of results is returned.
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
/// The maximum number of ScanRuns to return, can be limited by server.
/// If not specified or not positive, the implementation will select a
/// reasonable value.
#[prost(int32, tag = "3")]
pub page_size: i32,
}
/// Response for the `ListScanRuns` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListScanRunsResponse {
/// The list of ScanRuns returned.
#[prost(message, repeated, tag = "1")]
pub scan_runs: ::prost::alloc::vec::Vec<ScanRun>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for the `StopScanRun` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopScanRunRequest {
/// Required. The resource name of the ScanRun to be stopped. The name follows the
/// format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `ListCrawledUrls` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCrawledUrlsRequest {
/// Required. The parent resource name, which should be a scan run resource name in the
/// format
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// A token identifying a page of results to be returned. This should be a
/// `next_page_token` value returned from a previous List request.
/// If unspecified, the first page of results is returned.
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
/// The maximum number of CrawledUrls to return, can be limited by server.
/// If not specified or not positive, the implementation will select a
/// reasonable value.
#[prost(int32, tag = "3")]
pub page_size: i32,
}
/// Response for the `ListCrawledUrls` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCrawledUrlsResponse {
/// The list of CrawledUrls returned.
#[prost(message, repeated, tag = "1")]
pub crawled_urls: ::prost::alloc::vec::Vec<CrawledUrl>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for the `GetFinding` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFindingRequest {
/// Required. The resource name of the Finding to be returned. The name follows the
/// format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `ListFindings` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFindingsRequest {
/// Required. The parent resource name, which should be a scan run resource name in the
/// format
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Required. The filter expression. The expression must be in the format: <field>
/// <operator> <value>.
/// Supported field: 'finding_type'.
/// Supported operator: '='.
#[prost(string, tag = "2")]
pub filter: ::prost::alloc::string::String,
/// A token identifying a page of results to be returned. This should be a
/// `next_page_token` value returned from a previous List request.
/// If unspecified, the first page of results is returned.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// The maximum number of Findings to return, can be limited by server.
/// If not specified or not positive, the implementation will select a
/// reasonable value.
#[prost(int32, tag = "4")]
pub page_size: i32,
}
/// Response for the `ListFindings` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFindingsResponse {
/// The list of Findings returned.
#[prost(message, repeated, tag = "1")]
pub findings: ::prost::alloc::vec::Vec<Finding>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for the `ListFindingTypeStats` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFindingTypeStatsRequest {
/// Required. The parent resource name, which should be a scan run resource name in the
/// format
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
}
/// Response for the `ListFindingTypeStats` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFindingTypeStatsResponse {
/// The list of FindingTypeStats returned.
#[prost(message, repeated, tag = "1")]
pub finding_type_stats: ::prost::alloc::vec::Vec<FindingTypeStats>,
}
/// Generated client implementations.
pub mod web_security_scanner_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Cloud Web Security Scanner Service identifies security vulnerabilities in web
/// applications hosted on Google Cloud Platform. It crawls your application, and
/// attempts to exercise as many user inputs and event handlers as possible.
#[derive(Debug, Clone)]
pub struct WebSecurityScannerClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> WebSecurityScannerClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> WebSecurityScannerClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
WebSecurityScannerClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Creates a new ScanConfig.
pub async fn create_scan_config(
&mut self,
request: impl tonic::IntoRequest<super::CreateScanConfigRequest>,
) -> std::result::Result<tonic::Response<super::ScanConfig>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/CreateScanConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"CreateScanConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes an existing ScanConfig and its child resources.
pub async fn delete_scan_config(
&mut self,
request: impl tonic::IntoRequest<super::DeleteScanConfigRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/DeleteScanConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"DeleteScanConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets a ScanConfig.
pub async fn get_scan_config(
&mut self,
request: impl tonic::IntoRequest<super::GetScanConfigRequest>,
) -> std::result::Result<tonic::Response<super::ScanConfig>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/GetScanConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"GetScanConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists ScanConfigs under a given project.
pub async fn list_scan_configs(
&mut self,
request: impl tonic::IntoRequest<super::ListScanConfigsRequest>,
) -> std::result::Result<
tonic::Response<super::ListScanConfigsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/ListScanConfigs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"ListScanConfigs",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates a ScanConfig. This method support partial update of a ScanConfig.
pub async fn update_scan_config(
&mut self,
request: impl tonic::IntoRequest<super::UpdateScanConfigRequest>,
) -> std::result::Result<tonic::Response<super::ScanConfig>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/UpdateScanConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"UpdateScanConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Start a ScanRun according to the given ScanConfig.
pub async fn start_scan_run(
&mut self,
request: impl tonic::IntoRequest<super::StartScanRunRequest>,
) -> std::result::Result<tonic::Response<super::ScanRun>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/StartScanRun",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"StartScanRun",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets a ScanRun.
pub async fn get_scan_run(
&mut self,
request: impl tonic::IntoRequest<super::GetScanRunRequest>,
) -> std::result::Result<tonic::Response<super::ScanRun>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/GetScanRun",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"GetScanRun",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
/// stop time.
pub async fn list_scan_runs(
&mut self,
request: impl tonic::IntoRequest<super::ListScanRunsRequest>,
) -> std::result::Result<
tonic::Response<super::ListScanRunsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/ListScanRuns",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"ListScanRuns",
),
);
self.inner.unary(req, path, codec).await
}
/// Stops a ScanRun. The stopped ScanRun is returned.
pub async fn stop_scan_run(
&mut self,
request: impl tonic::IntoRequest<super::StopScanRunRequest>,
) -> std::result::Result<tonic::Response<super::ScanRun>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/StopScanRun",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"StopScanRun",
),
);
self.inner.unary(req, path, codec).await
}
/// List CrawledUrls under a given ScanRun.
pub async fn list_crawled_urls(
&mut self,
request: impl tonic::IntoRequest<super::ListCrawledUrlsRequest>,
) -> std::result::Result<
tonic::Response<super::ListCrawledUrlsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/ListCrawledUrls",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"ListCrawledUrls",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets a Finding.
pub async fn get_finding(
&mut self,
request: impl tonic::IntoRequest<super::GetFindingRequest>,
) -> std::result::Result<tonic::Response<super::Finding>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/GetFinding",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"GetFinding",
),
);
self.inner.unary(req, path, codec).await
}
/// List Findings under a given ScanRun.
pub async fn list_findings(
&mut self,
request: impl tonic::IntoRequest<super::ListFindingsRequest>,
) -> std::result::Result<
tonic::Response<super::ListFindingsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/ListFindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"ListFindings",
),
);
self.inner.unary(req, path, codec).await
}
/// List all FindingTypeStats under a given ScanRun.
pub async fn list_finding_type_stats(
&mut self,
request: impl tonic::IntoRequest<super::ListFindingTypeStatsRequest>,
) -> std::result::Result<
tonic::Response<super::ListFindingTypeStatsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/ListFindingTypeStats",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1alpha.WebSecurityScanner",
"ListFindingTypeStats",
),
);
self.inner.unary(req, path, codec).await
}
}
}