ic_auth_client/
auth_client.rs1use crate::storage::DecodeError;
2use thiserror::Error;
3
4#[cfg(feature = "native")]
5mod native;
6#[cfg(feature = "wasm-js")]
7mod wasm_js;
8
9#[cfg(feature = "native")]
10pub use native::{NativeAuthClient, NativeLoginError};
11#[cfg(feature = "wasm-js")]
12pub use wasm_js::AuthClient;
13
14#[derive(Error, Debug)]
16pub enum AuthClientError {
17 #[error("Storage error: {0}")]
19 Storage(#[from] crate::storage::StorageError),
20 #[error("Delegation error: {0}")]
22 Delegation(#[from] ic_agent::identity::DelegationError),
23 #[cfg(feature = "pem")]
25 #[error("PEM error: {0}")]
26 Pem(#[from] ic_agent::identity::PemError),
27}
28
29impl From<DecodeError> for AuthClientError {
30 fn from(err: DecodeError) -> Self {
31 AuthClientError::Storage(err.into())
32 }
33}