Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 1994d96

Browse files
docs: Add documentation for enums (#256)
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent bcdc5c7 commit 1994d96

File tree

21 files changed

+698
-21
lines changed

21 files changed

+698
-21
lines changed

google/cloud/websecurityscanner_v1/services/web_security_scanner/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ def sample_list_finding_type_stats():
15541554
# Done; return the response.
15551555
return response
15561556

1557-
def __enter__(self):
1557+
def __enter__(self) -> "WebSecurityScannerClient":
15581558
return self
15591559

15601560
def __exit__(self, type, value, traceback):

google/cloud/websecurityscanner_v1/types/finding.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,20 @@ class Finding(proto.Message):
101101
"""
102102

103103
class Severity(proto.Enum):
104-
r"""The severity level of a vulnerability."""
104+
r"""The severity level of a vulnerability.
105+
106+
Values:
107+
SEVERITY_UNSPECIFIED (0):
108+
No severity specified. The default value.
109+
CRITICAL (1):
110+
Critical severity.
111+
HIGH (2):
112+
High severity.
113+
MEDIUM (3):
114+
Medium severity.
115+
LOW (4):
116+
Low severity.
117+
"""
105118
SEVERITY_UNSPECIFIED = 0
106119
CRITICAL = 1
107120
HIGH = 2

google/cloud/websecurityscanner_v1/types/finding_addon.py

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,57 @@ class Xss(proto.Message):
175175
"""
176176

177177
class AttackVector(proto.Enum):
178-
r"""Types of XSS attack vector."""
178+
r"""Types of XSS attack vector.
179+
180+
Values:
181+
ATTACK_VECTOR_UNSPECIFIED (0):
182+
Unknown attack vector.
183+
LOCAL_STORAGE (1):
184+
The attack comes from fuzzing the browser's
185+
localStorage.
186+
SESSION_STORAGE (2):
187+
The attack comes from fuzzing the browser's
188+
sessionStorage.
189+
WINDOW_NAME (3):
190+
The attack comes from fuzzing the window's
191+
name property.
192+
REFERRER (4):
193+
The attack comes from fuzzing the referrer
194+
property.
195+
FORM_INPUT (5):
196+
The attack comes from fuzzing an input
197+
element.
198+
COOKIE (6):
199+
The attack comes from fuzzing the browser's
200+
cookies.
201+
POST_MESSAGE (7):
202+
The attack comes from hijacking the post
203+
messaging mechanism.
204+
GET_PARAMETERS (8):
205+
The attack comes from fuzzing parameters in
206+
the url.
207+
URL_FRAGMENT (9):
208+
The attack comes from fuzzing the fragment in
209+
the url.
210+
HTML_COMMENT (10):
211+
The attack comes from fuzzing the HTML
212+
comments.
213+
POST_PARAMETERS (11):
214+
The attack comes from fuzzing the POST
215+
parameters.
216+
PROTOCOL (12):
217+
The attack comes from fuzzing the protocol.
218+
STORED_XSS (13):
219+
The attack comes from the server side and is
220+
stored.
221+
SAME_ORIGIN (14):
222+
The attack is a Same-Origin Method Execution
223+
attack via a GET parameter.
224+
USER_CONTROLLABLE_URL (15):
225+
The attack payload is received from a
226+
third-party host via a URL that is
227+
user-controllable
228+
"""
179229
ATTACK_VECTOR_UNSPECIFIED = 0
180230
LOCAL_STORAGE = 1
181231
SESSION_STORAGE = 2
@@ -226,7 +276,15 @@ class Xxe(proto.Message):
226276
"""
227277

228278
class Location(proto.Enum):
229-
r"""Locations within a request where XML was substituted."""
279+
r"""Locations within a request where XML was substituted.
280+
281+
Values:
282+
LOCATION_UNSPECIFIED (0):
283+
Unknown Location.
284+
COMPLETE_REQUEST_BODY (1):
285+
The XML payload replaced the complete request
286+
body.
287+
"""
230288
LOCATION_UNSPECIFIED = 0
231289
COMPLETE_REQUEST_BODY = 1
232290

google/cloud/websecurityscanner_v1/types/scan_config.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,20 @@ class ScanConfig(proto.Message):
7777
"""
7878

7979
class UserAgent(proto.Enum):
80-
r"""Type of user agents used for scanning."""
80+
r"""Type of user agents used for scanning.
81+
82+
Values:
83+
USER_AGENT_UNSPECIFIED (0):
84+
The user agent is unknown. Service will default to
85+
CHROME_LINUX.
86+
CHROME_LINUX (1):
87+
Chrome on Linux. This is the service default
88+
if unspecified.
89+
CHROME_ANDROID (2):
90+
Chrome on Android.
91+
SAFARI_IPHONE (3):
92+
Safari on IPhone.
93+
"""
8194
USER_AGENT_UNSPECIFIED = 0
8295
CHROME_LINUX = 1
8396
CHROME_ANDROID = 2
@@ -88,6 +101,14 @@ class RiskLevel(proto.Enum):
88101
impact scanning will minimize requests with the potential to
89102
modify data. To achieve the maximum scan coverage, NORMAL risk
90103
level is recommended.
104+
105+
Values:
106+
RISK_LEVEL_UNSPECIFIED (0):
107+
Use default, which is NORMAL.
108+
NORMAL (1):
109+
Normal scanning (Recommended)
110+
LOW (2):
111+
Lower impact scanning
91112
"""
92113
RISK_LEVEL_UNSPECIFIED = 0
93114
NORMAL = 1
@@ -96,6 +117,16 @@ class RiskLevel(proto.Enum):
96117
class ExportToSecurityCommandCenter(proto.Enum):
97118
r"""Controls export of scan configurations and results to
98119
Security Command Center.
120+
121+
Values:
122+
EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED (0):
123+
Use default, which is ENABLED.
124+
ENABLED (1):
125+
Export results of this scan to Security
126+
Command Center.
127+
DISABLED (2):
128+
Do not export results of this scan to
129+
Security Command Center.
99130
"""
100131
EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0
101132
ENABLED = 1

google/cloud/websecurityscanner_v1/types/scan_config_error.py

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,140 @@ class Code(proto.Enum):
4646
r"""Output only.
4747
Defines an error reason code.
4848
Next id: 44
49+
50+
Values:
51+
CODE_UNSPECIFIED (0):
52+
There is no error.
53+
OK (0):
54+
There is no error.
55+
INTERNAL_ERROR (1):
56+
Indicates an internal server error.
57+
Please DO NOT USE THIS ERROR CODE unless the
58+
root cause is truly unknown.
59+
APPENGINE_API_BACKEND_ERROR (2):
60+
One of the seed URLs is an App Engine URL but
61+
we cannot validate the scan settings due to an
62+
App Engine API backend error.
63+
APPENGINE_API_NOT_ACCESSIBLE (3):
64+
One of the seed URLs is an App Engine URL but
65+
we cannot access the App Engine API to validate
66+
scan settings.
67+
APPENGINE_DEFAULT_HOST_MISSING (4):
68+
One of the seed URLs is an App Engine URL but
69+
the Default Host of the App Engine is not set.
70+
CANNOT_USE_GOOGLE_COM_ACCOUNT (6):
71+
Google corporate accounts can not be used for
72+
scanning.
73+
CANNOT_USE_OWNER_ACCOUNT (7):
74+
The account of the scan creator can not be
75+
used for scanning.
76+
COMPUTE_API_BACKEND_ERROR (8):
77+
This scan targets Compute Engine, but we
78+
cannot validate scan settings due to a Compute
79+
Engine API backend error.
80+
COMPUTE_API_NOT_ACCESSIBLE (9):
81+
This scan targets Compute Engine, but we
82+
cannot access the Compute Engine API to validate
83+
the scan settings.
84+
CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT (10):
85+
The Custom Login URL does not belong to the
86+
current project.
87+
CUSTOM_LOGIN_URL_MALFORMED (11):
88+
The Custom Login URL is malformed (can not be
89+
parsed).
90+
CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS (12):
91+
The Custom Login URL is mapped to a
92+
non-routable IP address in DNS.
93+
CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS (13):
94+
The Custom Login URL is mapped to an IP
95+
address which is not reserved for the current
96+
project.
97+
CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS (14):
98+
The Custom Login URL has a non-routable IP
99+
address.
100+
CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS (15):
101+
The Custom Login URL has an IP address which
102+
is not reserved for the current project.
103+
DUPLICATE_SCAN_NAME (16):
104+
Another scan with the same name
105+
(case-sensitive) already exists.
106+
INVALID_FIELD_VALUE (18):
107+
A field is set to an invalid value.
108+
FAILED_TO_AUTHENTICATE_TO_TARGET (19):
109+
There was an error trying to authenticate to
110+
the scan target.
111+
FINDING_TYPE_UNSPECIFIED (20):
112+
Finding type value is not specified in the
113+
list findings request.
114+
FORBIDDEN_TO_SCAN_COMPUTE (21):
115+
Scan targets Compute Engine, yet current
116+
project was not whitelisted for Google Compute
117+
Engine Scanning Alpha access.
118+
FORBIDDEN_UPDATE_TO_MANAGED_SCAN (43):
119+
User tries to update managed scan
120+
MALFORMED_FILTER (22):
121+
The supplied filter is malformed. For
122+
example, it can not be parsed, does not have a
123+
filter type in expression, or the same filter
124+
type appears more than once.
125+
MALFORMED_RESOURCE_NAME (23):
126+
The supplied resource name is malformed (can
127+
not be parsed).
128+
PROJECT_INACTIVE (24):
129+
The current project is not in an active
130+
state.
131+
REQUIRED_FIELD (25):
132+
A required field is not set.
133+
RESOURCE_NAME_INCONSISTENT (26):
134+
Project id, scanconfig id, scanrun id, or
135+
finding id are not consistent with each other in
136+
resource name.
137+
SCAN_ALREADY_RUNNING (27):
138+
The scan being requested to start is already
139+
running.
140+
SCAN_NOT_RUNNING (28):
141+
The scan that was requested to be stopped is
142+
not running.
143+
SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT (29):
144+
One of the seed URLs does not belong to the
145+
current project.
146+
SEED_URL_MALFORMED (30):
147+
One of the seed URLs is malformed (can not be
148+
parsed).
149+
SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS (31):
150+
One of the seed URLs is mapped to a
151+
non-routable IP address in DNS.
152+
SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS (32):
153+
One of the seed URLs is mapped to an IP
154+
address which is not reserved for the current
155+
project.
156+
SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS (33):
157+
One of the seed URLs has on-routable IP
158+
address.
159+
SEED_URL_HAS_UNRESERVED_IP_ADDRESS (35):
160+
One of the seed URLs has an IP address that
161+
is not reserved for the current project.
162+
SERVICE_ACCOUNT_NOT_CONFIGURED (36):
163+
The Web Security Scanner service account is
164+
not configured under the project.
165+
TOO_MANY_SCANS (37):
166+
A project has reached the maximum number of
167+
scans.
168+
UNABLE_TO_RESOLVE_PROJECT_INFO (38):
169+
Resolving the details of the current project
170+
fails.
171+
UNSUPPORTED_BLACKLIST_PATTERN_FORMAT (39):
172+
One or more blacklist patterns were in the
173+
wrong format.
174+
UNSUPPORTED_FILTER (40):
175+
The supplied filter is not supported.
176+
UNSUPPORTED_FINDING_TYPE (41):
177+
The supplied finding type is not supported.
178+
For example, we do not provide findings of the
179+
given finding type.
180+
UNSUPPORTED_URL_SCHEME (42):
181+
The URL scheme of one or more of the supplied
182+
URLs is not supported.
49183
"""
50184
_pb_options = {"allow_alias": True}
51185
CODE_UNSPECIFIED = 0

google/cloud/websecurityscanner_v1/types/scan_run.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,40 @@ class ScanRun(proto.Message):
8787
"""
8888

8989
class ExecutionState(proto.Enum):
90-
r"""Types of ScanRun execution state."""
90+
r"""Types of ScanRun execution state.
91+
92+
Values:
93+
EXECUTION_STATE_UNSPECIFIED (0):
94+
Represents an invalid state caused by
95+
internal server error. This value should never
96+
be returned.
97+
QUEUED (1):
98+
The scan is waiting in the queue.
99+
SCANNING (2):
100+
The scan is in progress.
101+
FINISHED (3):
102+
The scan is either finished or stopped by
103+
user.
104+
"""
91105
EXECUTION_STATE_UNSPECIFIED = 0
92106
QUEUED = 1
93107
SCANNING = 2
94108
FINISHED = 3
95109

96110
class ResultState(proto.Enum):
97-
r"""Types of ScanRun result state."""
111+
r"""Types of ScanRun result state.
112+
113+
Values:
114+
RESULT_STATE_UNSPECIFIED (0):
115+
Default value. This value is returned when
116+
the ScanRun is not yet finished.
117+
SUCCESS (1):
118+
The scan finished without errors.
119+
ERROR (2):
120+
The scan finished with errors.
121+
KILLED (3):
122+
The scan was terminated by user.
123+
"""
98124
RESULT_STATE_UNSPECIFIED = 0
99125
SUCCESS = 1
100126
ERROR = 2

google/cloud/websecurityscanner_v1/types/scan_run_error_trace.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,33 @@ class Code(proto.Enum):
5252
r"""Output only.
5353
Defines an error reason code.
5454
Next id: 8
55+
56+
Values:
57+
CODE_UNSPECIFIED (0):
58+
Default value is never used.
59+
INTERNAL_ERROR (1):
60+
Indicates that the scan run failed due to an
61+
internal server error.
62+
SCAN_CONFIG_ISSUE (2):
63+
Indicates a scan configuration error, usually due to
64+
outdated ScanConfig settings, such as starting_urls or the
65+
DNS configuration.
66+
AUTHENTICATION_CONFIG_ISSUE (3):
67+
Indicates an authentication error, usually
68+
due to outdated ScanConfig authentication
69+
settings.
70+
TIMED_OUT_WHILE_SCANNING (4):
71+
Indicates a scan operation timeout, usually
72+
caused by a very large site.
73+
TOO_MANY_REDIRECTS (5):
74+
Indicates that a scan encountered excessive
75+
redirects, either to authentication or some
76+
other page outside of the scan scope.
77+
TOO_MANY_HTTP_ERRORS (6):
78+
Indicates that a scan encountered numerous errors from the
79+
web site pages. When available, most_common_http_error_code
80+
field indicates the most common HTTP error code encountered
81+
during the scan.
5582
"""
5683
CODE_UNSPECIFIED = 0
5784
INTERNAL_ERROR = 1

0 commit comments

Comments
 (0)