1use crate::{
2 http_client,
3 wasm_compat::{WasmBoxedFuture, WasmCompatSend},
4};
5use thiserror::Error;
6
7#[derive(Debug, Error)]
8pub enum VerifyError {
9 #[error("invalid authentication")]
10 InvalidAuthentication,
11 #[error("provider error: {0}")]
12 ProviderError(String),
13 #[error("http error: {0}")]
14 HttpError(
15 #[from]
16 #[source]
17 http_client::Error,
18 ),
19}
20
21pub trait VerifyClient {
24 fn verify(&self) -> impl Future<Output = Result<(), VerifyError>> + WasmCompatSend;
26}
27
28#[deprecated(
29 since = "0.25.0",
30 note = "`DynClientBuilder` and related features have been deprecated and will be removed in a future release. In this case, use `VerifyClient` instead."
31)]
32pub trait VerifyClientDyn {
33 fn verify(&self) -> WasmBoxedFuture<'_, Result<(), VerifyError>>;
35}
36
37#[allow(deprecated)]
38impl<T> VerifyClientDyn for T
39where
40 T: VerifyClient,
41{
42 fn verify(&self) -> WasmBoxedFuture<'_, Result<(), VerifyError>> {
43 Box::pin(self.verify())
44 }
45}