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
///命令 marker、完整参数与成功响应。
pub mod commands;
///事件 marker 和拥有型事件参数。
pub mod events;
///命名协议类型;不包含连接状态。
pub mod types;
///薄 Domain 视图,仅借用 Session;创建不发送数据。协议来源:WebAuthn。
///
///协议原文:
///
///<pre>This domain allows configuring virtual authenticators to test the WebAuthn
///API.</pre>
///
///此项为 experimental,端点可能不支持。
pub struct Domain<'a> {
///借用的通信路由,生命周期不超过 Session。
pub(super) session: &'a ydp_core::Session,
}
impl<'a> Domain<'a> {
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.addCredential。
///
///协议原文:
///
///<pre>Adds the credential to the specified authenticator.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::AddCredentialParams) -> ydp_core::Result<()> {
///let response = session.web_authn().add_credential(params).await?;
///# Ok(())
///# }
///```
pub fn add_credential(
&self,
params: commands::AddCredentialParams,
) -> ydp_core::Request<commands::AddCredential> {
self.session.send::<commands::AddCredential>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.addVirtualAuthenticator。
///
///协议原文:
///
///<pre>Creates and adds a virtual authenticator.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::AddVirtualAuthenticatorParams) -> ydp_core::Result<()> {
///let response = session.web_authn().add_virtual_authenticator(params).await?;
///# Ok(())
///# }
///```
pub fn add_virtual_authenticator(
&self,
params: commands::AddVirtualAuthenticatorParams,
) -> ydp_core::Request<commands::AddVirtualAuthenticator> {
self.session
.send::<commands::AddVirtualAuthenticator>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.clearCredentials。
///
///协议原文:
///
///<pre>Clears all the credentials from the specified device.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::ClearCredentialsParams) -> ydp_core::Result<()> {
///let response = session.web_authn().clear_credentials(params).await?;
///# Ok(())
///# }
///```
pub fn clear_credentials(
&self,
params: commands::ClearCredentialsParams,
) -> ydp_core::Request<commands::ClearCredentials> {
self.session.send::<commands::ClearCredentials>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.disable。
///
///协议原文:
///
///<pre>Disable the WebAuthn domain.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::DisableParams) -> ydp_core::Result<()> {
///let response = session.web_authn().disable(params).await?;
///# Ok(())
///# }
///```
pub fn disable(&self, params: commands::DisableParams) -> ydp_core::Request<commands::Disable> {
self.session.send::<commands::Disable>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.enable。
///
///协议原文:
///
///<pre>Enable the WebAuthn domain and start intercepting credential storage and
///retrieval with a virtual authenticator.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::EnableParams) -> ydp_core::Result<()> {
///let response = session.web_authn().enable(params).await?;
///# Ok(())
///# }
///```
pub fn enable(&self, params: commands::EnableParams) -> ydp_core::Request<commands::Enable> {
self.session.send::<commands::Enable>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.getCredential。
///
///协议原文:
///
///<pre>Returns a single credential stored in the given virtual authenticator that
///matches the credential ID.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::GetCredentialParams) -> ydp_core::Result<()> {
///let response = session.web_authn().get_credential(params).await?;
///# Ok(())
///# }
///```
pub fn get_credential(
&self,
params: commands::GetCredentialParams,
) -> ydp_core::Request<commands::GetCredential> {
self.session.send::<commands::GetCredential>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.getCredentials。
///
///协议原文:
///
///<pre>Returns all the credentials stored in the given virtual authenticator.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::GetCredentialsParams) -> ydp_core::Result<()> {
///let response = session.web_authn().get_credentials(params).await?;
///# Ok(())
///# }
///```
pub fn get_credentials(
&self,
params: commands::GetCredentialsParams,
) -> ydp_core::Request<commands::GetCredentials> {
self.session.send::<commands::GetCredentials>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.removeCredential。
///
///协议原文:
///
///<pre>Removes a credential from the authenticator.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::RemoveCredentialParams) -> ydp_core::Result<()> {
///let response = session.web_authn().remove_credential(params).await?;
///# Ok(())
///# }
///```
pub fn remove_credential(
&self,
params: commands::RemoveCredentialParams,
) -> ydp_core::Request<commands::RemoveCredential> {
self.session.send::<commands::RemoveCredential>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.removeVirtualAuthenticator。
///
///协议原文:
///
///<pre>Removes the given authenticator.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::RemoveVirtualAuthenticatorParams) -> ydp_core::Result<()> {
///let response = session.web_authn().remove_virtual_authenticator(params).await?;
///# Ok(())
///# }
///```
pub fn remove_virtual_authenticator(
&self,
params: commands::RemoveVirtualAuthenticatorParams,
) -> ydp_core::Request<commands::RemoveVirtualAuthenticator> {
self.session
.send::<commands::RemoveVirtualAuthenticator>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.setAutomaticPresenceSimulation。
///
///协议原文:
///
///<pre>Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator.
///The default is true.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::SetAutomaticPresenceSimulationParams) -> ydp_core::Result<()> {
///let response = session.web_authn().set_automatic_presence_simulation(params).await?;
///# Ok(())
///# }
///```
pub fn set_automatic_presence_simulation(
&self,
params: commands::SetAutomaticPresenceSimulationParams,
) -> ydp_core::Request<commands::SetAutomaticPresenceSimulation> {
self.session
.send::<commands::SetAutomaticPresenceSimulation>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.setCredentialProperties。
///
///协议原文:
///
///<pre>Allows setting credential properties.
///https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::SetCredentialPropertiesParams) -> ydp_core::Result<()> {
///let response = session.web_authn().set_credential_properties(params).await?;
///# Ok(())
///# }
///```
pub fn set_credential_properties(
&self,
params: commands::SetCredentialPropertiesParams,
) -> ydp_core::Request<commands::SetCredentialProperties> {
self.session
.send::<commands::SetCredentialProperties>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.setResponseOverrideBits。
///
///协议原文:
///
///<pre>Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::SetResponseOverrideBitsParams) -> ydp_core::Result<()> {
///let response = session.web_authn().set_response_override_bits(params).await?;
///# Ok(())
///# }
///```
pub fn set_response_override_bits(
&self,
params: commands::SetResponseOverrideBitsParams,
) -> ydp_core::Request<commands::SetResponseOverrideBits> {
self.session
.send::<commands::SetResponseOverrideBits>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:WebAuthn.command.setUserVerified。
///
///协议原文:
///
///<pre>Sets whether User Verification succeeds or fails for an authenticator.
///The default is true.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::web_authn::commands::SetUserVerifiedParams) -> ydp_core::Result<()> {
///let response = session.web_authn().set_user_verified(params).await?;
///# Ok(())
///# }
///```
pub fn set_user_verified(
&self,
params: commands::SetUserVerifiedParams,
) -> ydp_core::Request<commands::SetUserVerified> {
self.session.send::<commands::SetUserVerified>(params)
}
}