1use super::network;
3#[allow(unused_imports)]
4use super::types::*;
5#[allow(unused_imports)]
6use serde::{Deserialize, Serialize};
7#[allow(unused_imports)]
8use serde_json::Value as Json;
9pub type CertificateId = JsUInt;
10#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
11pub enum MixedContentType {
12 #[serde(rename = "blockable")]
13 Blockable,
14 #[serde(rename = "optionally-blockable")]
15 OptionallyBlockable,
16 #[serde(rename = "none")]
17 None,
18}
19#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
20pub enum SecurityState {
21 #[serde(rename = "unknown")]
22 Unknown,
23 #[serde(rename = "neutral")]
24 Neutral,
25 #[serde(rename = "insecure")]
26 Insecure,
27 #[serde(rename = "secure")]
28 Secure,
29 #[serde(rename = "info")]
30 Info,
31 #[serde(rename = "insecure-broken")]
32 InsecureBroken,
33}
34#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
35pub enum SafetyTipStatus {
36 #[serde(rename = "badReputation")]
37 BadReputation,
38 #[serde(rename = "lookalike")]
39 Lookalike,
40}
41#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
42pub enum CertificateErrorAction {
43 #[serde(rename = "continue")]
44 Continue,
45 #[serde(rename = "cancel")]
46 Cancel,
47}
48#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
49pub struct CertificateSecurityState {
50 #[serde(default)]
51 #[serde(rename = "protocol")]
52 pub protocol: String,
53 #[serde(default)]
54 #[serde(rename = "keyExchange")]
55 pub key_exchange: String,
56 #[serde(skip_serializing_if = "Option::is_none")]
57 #[serde(default)]
58 #[serde(rename = "keyExchangeGroup")]
59 pub key_exchange_group: Option<String>,
60 #[serde(default)]
61 #[serde(rename = "cipher")]
62 pub cipher: String,
63 #[serde(skip_serializing_if = "Option::is_none")]
64 #[serde(default)]
65 #[serde(rename = "mac")]
66 pub mac: Option<String>,
67 #[serde(default)]
68 #[serde(rename = "certificate")]
69 pub certificate: Vec<String>,
70 #[serde(default)]
71 #[serde(rename = "subjectName")]
72 pub subject_name: String,
73 #[serde(default)]
74 #[serde(rename = "issuer")]
75 pub issuer: String,
76 #[serde(rename = "validFrom")]
77 pub valid_from: network::TimeSinceEpoch,
78 #[serde(rename = "validTo")]
79 pub valid_to: network::TimeSinceEpoch,
80 #[serde(skip_serializing_if = "Option::is_none")]
81 #[serde(default)]
82 #[serde(rename = "certificateNetworkError")]
83 pub certificate_network_error: Option<String>,
84 #[serde(default)]
85 #[serde(rename = "certificateHasWeakSignature")]
86 pub certificate_has_weak_signature: bool,
87 #[serde(default)]
88 #[serde(rename = "certificateHasSha1Signature")]
89 pub certificate_has_sha_1_signature: bool,
90 #[serde(default)]
91 #[serde(rename = "modernSSL")]
92 pub modern_ssl: bool,
93 #[serde(default)]
94 #[serde(rename = "obsoleteSslProtocol")]
95 pub obsolete_ssl_protocol: bool,
96 #[serde(default)]
97 #[serde(rename = "obsoleteSslKeyExchange")]
98 pub obsolete_ssl_key_exchange: bool,
99 #[serde(default)]
100 #[serde(rename = "obsoleteSslCipher")]
101 pub obsolete_ssl_cipher: bool,
102 #[serde(default)]
103 #[serde(rename = "obsoleteSslSignature")]
104 pub obsolete_ssl_signature: bool,
105}
106#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
107pub struct SafetyTipInfo {
108 #[serde(rename = "safetyTipStatus")]
109 pub safety_tip_status: SafetyTipStatus,
110 #[serde(skip_serializing_if = "Option::is_none")]
111 #[serde(default)]
112 #[serde(rename = "safeUrl")]
113 pub safe_url: Option<String>,
114}
115#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
116pub struct VisibleSecurityState {
117 #[serde(rename = "securityState")]
118 pub security_state: SecurityState,
119 #[serde(skip_serializing_if = "Option::is_none")]
120 #[serde(rename = "certificateSecurityState")]
121 pub certificate_security_state: Option<CertificateSecurityState>,
122 #[serde(skip_serializing_if = "Option::is_none")]
123 #[serde(rename = "safetyTipInfo")]
124 pub safety_tip_info: Option<SafetyTipInfo>,
125 #[serde(default)]
126 #[serde(rename = "securityStateIssueIds")]
127 pub security_state_issue_ids: Vec<String>,
128}
129#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
130pub struct SecurityStateExplanation {
131 #[serde(rename = "securityState")]
132 pub security_state: SecurityState,
133 #[serde(default)]
134 #[serde(rename = "title")]
135 pub title: String,
136 #[serde(default)]
137 #[serde(rename = "summary")]
138 pub summary: String,
139 #[serde(default)]
140 #[serde(rename = "description")]
141 pub description: String,
142 #[serde(rename = "mixedContentType")]
143 pub mixed_content_type: MixedContentType,
144 #[serde(default)]
145 #[serde(rename = "certificate")]
146 pub certificate: Vec<String>,
147 #[serde(skip_serializing_if = "Option::is_none")]
148 #[serde(default)]
149 #[serde(rename = "recommendations")]
150 pub recommendations: Option<Vec<String>>,
151}
152#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
153pub struct InsecureContentStatus {
154 #[serde(default)]
155 #[serde(rename = "ranMixedContent")]
156 pub ran_mixed_content: bool,
157 #[serde(default)]
158 #[serde(rename = "displayedMixedContent")]
159 pub displayed_mixed_content: bool,
160 #[serde(default)]
161 #[serde(rename = "containedMixedForm")]
162 pub contained_mixed_form: bool,
163 #[serde(default)]
164 #[serde(rename = "ranContentWithCertErrors")]
165 pub ran_content_with_cert_errors: bool,
166 #[serde(default)]
167 #[serde(rename = "displayedContentWithCertErrors")]
168 pub displayed_content_with_cert_errors: bool,
169 #[serde(rename = "ranInsecureContentStyle")]
170 pub ran_insecure_content_style: SecurityState,
171 #[serde(rename = "displayedInsecureContentStyle")]
172 pub displayed_insecure_content_style: SecurityState,
173}
174#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
175#[serde(rename_all = "camelCase")]
176pub struct Disable(pub Option<serde_json::Value>);
177#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
178#[serde(rename_all = "camelCase")]
179pub struct Enable(pub Option<serde_json::Value>);
180#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
181pub struct SetIgnoreCertificateErrors {
182 #[serde(default)]
183 #[serde(rename = "ignore")]
184 pub ignore: bool,
185}
186#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
187pub struct HandleCertificateError {
188 #[serde(default)]
189 #[serde(rename = "eventId")]
190 pub event_id: JsUInt,
191 #[serde(rename = "action")]
192 pub action: CertificateErrorAction,
193}
194#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
195pub struct SetOverrideCertificateErrors {
196 #[serde(default)]
197 #[serde(rename = "override")]
198 pub r#override: bool,
199}
200#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
201#[serde(rename_all = "camelCase")]
202pub struct DisableReturnObject {}
203#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
204#[serde(rename_all = "camelCase")]
205pub struct EnableReturnObject {}
206#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
207#[serde(rename_all = "camelCase")]
208pub struct SetIgnoreCertificateErrorsReturnObject {}
209#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
210#[serde(rename_all = "camelCase")]
211pub struct HandleCertificateErrorReturnObject {}
212#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
213#[serde(rename_all = "camelCase")]
214pub struct SetOverrideCertificateErrorsReturnObject {}
215impl Method for Disable {
216 const NAME: &'static str = "Security.disable";
217 type ReturnObject = DisableReturnObject;
218}
219impl Method for Enable {
220 const NAME: &'static str = "Security.enable";
221 type ReturnObject = EnableReturnObject;
222}
223impl Method for SetIgnoreCertificateErrors {
224 const NAME: &'static str = "Security.setIgnoreCertificateErrors";
225 type ReturnObject = SetIgnoreCertificateErrorsReturnObject;
226}
227impl Method for HandleCertificateError {
228 const NAME: &'static str = "Security.handleCertificateError";
229 type ReturnObject = HandleCertificateErrorReturnObject;
230}
231impl Method for SetOverrideCertificateErrors {
232 const NAME: &'static str = "Security.setOverrideCertificateErrors";
233 type ReturnObject = SetOverrideCertificateErrorsReturnObject;
234}
235pub mod events {
236 #[allow(unused_imports)]
237 use super::super::types::*;
238 #[allow(unused_imports)]
239 use serde::{Deserialize, Serialize};
240 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
241 pub struct CertificateErrorEvent {
242 pub params: CertificateErrorEventParams,
243 }
244 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
245 pub struct CertificateErrorEventParams {
246 #[serde(default)]
247 #[serde(rename = "eventId")]
248 pub event_id: JsUInt,
249 #[serde(default)]
250 #[serde(rename = "errorType")]
251 pub error_type: String,
252 #[serde(default)]
253 #[serde(rename = "requestURL")]
254 pub request_url: String,
255 }
256 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
257 pub struct VisibleSecurityStateChangedEvent {
258 pub params: VisibleSecurityStateChangedEventParams,
259 }
260 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
261 pub struct VisibleSecurityStateChangedEventParams {
262 #[serde(rename = "visibleSecurityState")]
263 pub visible_security_state: super::VisibleSecurityState,
264 }
265 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
266 pub struct SecurityStateChangedEvent {
267 pub params: SecurityStateChangedEventParams,
268 }
269 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
270 pub struct SecurityStateChangedEventParams {
271 #[serde(rename = "securityState")]
272 pub security_state: super::SecurityState,
273 #[serde(default)]
274 #[serde(rename = "schemeIsCryptographic")]
275 pub scheme_is_cryptographic: bool,
276 #[serde(rename = "explanations")]
277 pub explanations: Vec<super::SecurityStateExplanation>,
278 #[serde(rename = "insecureContentStatus")]
279 pub insecure_content_status: super::InsecureContentStatus,
280 #[serde(skip_serializing_if = "Option::is_none")]
281 #[serde(default)]
282 #[serde(rename = "summary")]
283 pub summary: Option<String>,
284 }
285}