vendor/github.com/go-rod/rod/lib/proto/security.go
331 lines · 12291 bytes
1// This file is generated by "./lib/proto/generate"
2
3package proto
4
5/*
6
7Security
8
9Security
10
11*/
12
13// SecurityCertificateID An internal certificate ID value.
14type SecurityCertificateID int
15
16// SecurityMixedContentType A description of mixed content (HTTP resources on HTTPS pages), as defined by
17// https://www.w3.org/TR/mixed-content/#categories
18type SecurityMixedContentType string
19
20const (
21 // SecurityMixedContentTypeBlockable enum const.
22 SecurityMixedContentTypeBlockable SecurityMixedContentType = "blockable"
23
24 // SecurityMixedContentTypeOptionallyBlockable enum const.
25 SecurityMixedContentTypeOptionallyBlockable SecurityMixedContentType = "optionally-blockable"
26
27 // SecurityMixedContentTypeNone enum const.
28 SecurityMixedContentTypeNone SecurityMixedContentType = "none"
29)
30
31// SecuritySecurityState The security level of a page or resource.
32type SecuritySecurityState string
33
34const (
35 // SecuritySecurityStateUnknown enum const.
36 SecuritySecurityStateUnknown SecuritySecurityState = "unknown"
37
38 // SecuritySecurityStateNeutral enum const.
39 SecuritySecurityStateNeutral SecuritySecurityState = "neutral"
40
41 // SecuritySecurityStateInsecure enum const.
42 SecuritySecurityStateInsecure SecuritySecurityState = "insecure"
43
44 // SecuritySecurityStateSecure enum const.
45 SecuritySecurityStateSecure SecuritySecurityState = "secure"
46
47 // SecuritySecurityStateInfo enum const.
48 SecuritySecurityStateInfo SecuritySecurityState = "info"
49
50 // SecuritySecurityStateInsecureBroken enum const.
51 SecuritySecurityStateInsecureBroken SecuritySecurityState = "insecure-broken"
52)
53
54// SecurityCertificateSecurityState (experimental) Details about the security state of the page certificate.
55type SecurityCertificateSecurityState struct {
56 // Protocol name (e.g. "TLS 1.2" or "QUIC").
57 Protocol string `json:"protocol"`
58
59 // KeyExchange Key Exchange used by the connection, or the empty string if not applicable.
60 KeyExchange string `json:"keyExchange"`
61
62 // KeyExchangeGroup (optional) (EC)DH group used by the connection, if applicable.
63 KeyExchangeGroup string `json:"keyExchangeGroup,omitempty"`
64
65 // Cipher name.
66 Cipher string `json:"cipher"`
67
68 // Mac (optional) TLS MAC. Note that AEAD ciphers do not have separate MACs.
69 Mac string `json:"mac,omitempty"`
70
71 // Certificate Page certificate.
72 Certificate []string `json:"certificate"`
73
74 // SubjectName Certificate subject name.
75 SubjectName string `json:"subjectName"`
76
77 // Issuer Name of the issuing CA.
78 Issuer string `json:"issuer"`
79
80 // ValidFrom Certificate valid from date.
81 ValidFrom TimeSinceEpoch `json:"validFrom"`
82
83 // ValidTo Certificate valid to (expiration) date
84 ValidTo TimeSinceEpoch `json:"validTo"`
85
86 // CertificateNetworkError (optional) The highest priority network error code, if the certificate has an error.
87 CertificateNetworkError string `json:"certificateNetworkError,omitempty"`
88
89 // CertificateHasWeakSignature True if the certificate uses a weak signature algorithm.
90 CertificateHasWeakSignature bool `json:"certificateHasWeakSignature"`
91
92 // CertificateHasSha1Signature True if the certificate has a SHA1 signature in the chain.
93 CertificateHasSha1Signature bool `json:"certificateHasSha1Signature"`
94
95 // ModernSSL True if modern SSL
96 ModernSSL bool `json:"modernSSL"`
97
98 // ObsoleteSslProtocol True if the connection is using an obsolete SSL protocol.
99 ObsoleteSslProtocol bool `json:"obsoleteSslProtocol"`
100
101 // ObsoleteSslKeyExchange True if the connection is using an obsolete SSL key exchange.
102 ObsoleteSslKeyExchange bool `json:"obsoleteSslKeyExchange"`
103
104 // ObsoleteSslCipher True if the connection is using an obsolete SSL cipher.
105 ObsoleteSslCipher bool `json:"obsoleteSslCipher"`
106
107 // ObsoleteSslSignature True if the connection is using an obsolete SSL signature.
108 ObsoleteSslSignature bool `json:"obsoleteSslSignature"`
109}
110
111// SecuritySafetyTipStatus (experimental) ...
112type SecuritySafetyTipStatus string
113
114const (
115 // SecuritySafetyTipStatusBadReputation enum const.
116 SecuritySafetyTipStatusBadReputation SecuritySafetyTipStatus = "badReputation"
117
118 // SecuritySafetyTipStatusLookalike enum const.
119 SecuritySafetyTipStatusLookalike SecuritySafetyTipStatus = "lookalike"
120)
121
122// SecuritySafetyTipInfo (experimental) ...
123type SecuritySafetyTipInfo struct {
124 // SafetyTipStatus Describes whether the page triggers any safety tips or reputation warnings. Default is unknown.
125 SafetyTipStatus SecuritySafetyTipStatus `json:"safetyTipStatus"`
126
127 // SafeURL (optional) The URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches.
128 SafeURL string `json:"safeUrl,omitempty"`
129}
130
131// SecurityVisibleSecurityState (experimental) Security state information about the page.
132type SecurityVisibleSecurityState struct {
133 // SecurityState The security level of the page.
134 SecurityState SecuritySecurityState `json:"securityState"`
135
136 // CertificateSecurityState (optional) Security state details about the page certificate.
137 CertificateSecurityState *SecurityCertificateSecurityState `json:"certificateSecurityState,omitempty"`
138
139 // SafetyTipInfo (optional) The type of Safety Tip triggered on the page. Note that this field will be set even if the Safety Tip UI was not actually shown.
140 SafetyTipInfo *SecuritySafetyTipInfo `json:"safetyTipInfo,omitempty"`
141
142 // SecurityStateIssueIDs Array of security state issues ids.
143 SecurityStateIssueIDs []string `json:"securityStateIssueIds"`
144}
145
146// SecuritySecurityStateExplanation An explanation of an factor contributing to the security state.
147type SecuritySecurityStateExplanation struct {
148 // SecurityState Security state representing the severity of the factor being explained.
149 SecurityState SecuritySecurityState `json:"securityState"`
150
151 // Title describing the type of factor.
152 Title string `json:"title"`
153
154 // Summary Short phrase describing the type of factor.
155 Summary string `json:"summary"`
156
157 // Description Full text explanation of the factor.
158 Description string `json:"description"`
159
160 // MixedContentType The type of mixed content described by the explanation.
161 MixedContentType SecurityMixedContentType `json:"mixedContentType"`
162
163 // Certificate Page certificate.
164 Certificate []string `json:"certificate"`
165
166 // Recommendations (optional) Recommendations to fix any issues.
167 Recommendations []string `json:"recommendations,omitempty"`
168}
169
170// SecurityInsecureContentStatus (deprecated) Information about insecure content on the page.
171type SecurityInsecureContentStatus struct {
172 // RanMixedContent Always false.
173 RanMixedContent bool `json:"ranMixedContent"`
174
175 // DisplayedMixedContent Always false.
176 DisplayedMixedContent bool `json:"displayedMixedContent"`
177
178 // ContainedMixedForm Always false.
179 ContainedMixedForm bool `json:"containedMixedForm"`
180
181 // RanContentWithCertErrors Always false.
182 RanContentWithCertErrors bool `json:"ranContentWithCertErrors"`
183
184 // DisplayedContentWithCertErrors Always false.
185 DisplayedContentWithCertErrors bool `json:"displayedContentWithCertErrors"`
186
187 // RanInsecureContentStyle Always set to unknown.
188 RanInsecureContentStyle SecuritySecurityState `json:"ranInsecureContentStyle"`
189
190 // DisplayedInsecureContentStyle Always set to unknown.
191 DisplayedInsecureContentStyle SecuritySecurityState `json:"displayedInsecureContentStyle"`
192}
193
194// SecurityCertificateErrorAction The action to take when a certificate error occurs. continue will continue processing the
195// request and cancel will cancel the request.
196type SecurityCertificateErrorAction string
197
198const (
199 // SecurityCertificateErrorActionContinue enum const.
200 SecurityCertificateErrorActionContinue SecurityCertificateErrorAction = "continue"
201
202 // SecurityCertificateErrorActionCancel enum const.
203 SecurityCertificateErrorActionCancel SecurityCertificateErrorAction = "cancel"
204)
205
206// SecurityDisable Disables tracking security state changes.
207type SecurityDisable struct{}
208
209// ProtoReq name.
210func (m SecurityDisable) ProtoReq() string { return "Security.disable" }
211
212// Call sends the request.
213func (m SecurityDisable) Call(c Client) error {
214 return call(m.ProtoReq(), m, nil, c)
215}
216
217// SecurityEnable Enables tracking security state changes.
218type SecurityEnable struct{}
219
220// ProtoReq name.
221func (m SecurityEnable) ProtoReq() string { return "Security.enable" }
222
223// Call sends the request.
224func (m SecurityEnable) Call(c Client) error {
225 return call(m.ProtoReq(), m, nil, c)
226}
227
228// SecuritySetIgnoreCertificateErrors Enable/disable whether all certificate errors should be ignored.
229type SecuritySetIgnoreCertificateErrors struct {
230 // Ignore If true, all certificate errors will be ignored.
231 Ignore bool `json:"ignore"`
232}
233
234// ProtoReq name.
235func (m SecuritySetIgnoreCertificateErrors) ProtoReq() string {
236 return "Security.setIgnoreCertificateErrors"
237}
238
239// Call sends the request.
240func (m SecuritySetIgnoreCertificateErrors) Call(c Client) error {
241 return call(m.ProtoReq(), m, nil, c)
242}
243
244// SecurityHandleCertificateError (deprecated) Handles a certificate error that fired a certificateError event.
245type SecurityHandleCertificateError struct {
246 // EventID The ID of the event.
247 EventID int `json:"eventId"`
248
249 // Action The action to take on the certificate error.
250 Action SecurityCertificateErrorAction `json:"action"`
251}
252
253// ProtoReq name.
254func (m SecurityHandleCertificateError) ProtoReq() string { return "Security.handleCertificateError" }
255
256// Call sends the request.
257func (m SecurityHandleCertificateError) Call(c Client) error {
258 return call(m.ProtoReq(), m, nil, c)
259}
260
261// SecuritySetOverrideCertificateErrors (deprecated) Enable/disable overriding certificate errors. If enabled, all certificate error events need to
262// be handled by the DevTools client and should be answered with `handleCertificateError` commands.
263type SecuritySetOverrideCertificateErrors struct {
264 // Override If true, certificate errors will be overridden.
265 Override bool `json:"override"`
266}
267
268// ProtoReq name.
269func (m SecuritySetOverrideCertificateErrors) ProtoReq() string {
270 return "Security.setOverrideCertificateErrors"
271}
272
273// Call sends the request.
274func (m SecuritySetOverrideCertificateErrors) Call(c Client) error {
275 return call(m.ProtoReq(), m, nil, c)
276}
277
278// SecurityCertificateError (deprecated) There is a certificate error. If overriding certificate errors is enabled, then it should be
279// handled with the `handleCertificateError` command. Note: this event does not fire if the
280// certificate error has been allowed internally. Only one client per target should override
281// certificate errors at the same time.
282type SecurityCertificateError struct {
283 // EventID The ID of the event.
284 EventID int `json:"eventId"`
285
286 // ErrorType The type of the error.
287 ErrorType string `json:"errorType"`
288
289 // RequestURL The url that was requested.
290 RequestURL string `json:"requestURL"`
291}
292
293// ProtoEvent name.
294func (evt SecurityCertificateError) ProtoEvent() string {
295 return "Security.certificateError"
296}
297
298// SecurityVisibleSecurityStateChanged (experimental) The security state of the page changed.
299type SecurityVisibleSecurityStateChanged struct {
300 // VisibleSecurityState Security state information about the page.
301 VisibleSecurityState *SecurityVisibleSecurityState `json:"visibleSecurityState"`
302}
303
304// ProtoEvent name.
305func (evt SecurityVisibleSecurityStateChanged) ProtoEvent() string {
306 return "Security.visibleSecurityStateChanged"
307}
308
309// SecuritySecurityStateChanged (deprecated) The security state of the page changed. No longer being sent.
310type SecuritySecurityStateChanged struct {
311 // SecurityState Security state.
312 SecurityState SecuritySecurityState `json:"securityState"`
313
314 // SchemeIsCryptographic (deprecated) True if the page was loaded over cryptographic transport such as HTTPS.
315 SchemeIsCryptographic bool `json:"schemeIsCryptographic"`
316
317 // Explanations (deprecated) Previously a list of explanations for the security state. Now always
318 // empty.
319 Explanations []*SecuritySecurityStateExplanation `json:"explanations"`
320
321 // InsecureContentStatus (deprecated) Information about insecure content on the page.
322 InsecureContentStatus *SecurityInsecureContentStatus `json:"insecureContentStatus"`
323
324 // Summary (deprecated) (optional) Overrides user-visible description of the state. Always omitted.
325 Summary string `json:"summary,omitempty"`
326}
327
328// ProtoEvent name.
329func (evt SecuritySecurityStateChanged) ProtoEvent() string {
330 return "Security.securityStateChanged"
331}