ic_auth_client/option/wasm_js.rs
1//! Browser based authentication client configuration and options.
2
3use crate::{
4 ArcIdentity, IdleOptions, key::BaseKeyType, storage::async_storage::AuthClientStorage,
5};
6
7/// Options for creating a new [`AuthClient`].
8#[derive(Default, bon::Builder)]
9pub struct AuthClientCreateOptions {
10 /// An optional identity to use as the base. If not provided, an `Ed25519` key pair will be used.
11 pub identity: Option<ArcIdentity>,
12 /// Optional storage with get, set, and remove methods. Currently only `LocalStorage` is supported.
13 #[builder(into)]
14 pub storage: Option<Box<dyn AuthClientStorage>>,
15 /// The type of key to use for the base key. If not provided, `Ed25519` will be used by default.
16 pub key_type: Option<BaseKeyType>,
17 /// Options for handling idle timeouts. If not provided, default options will be used.
18 pub idle_options: Option<IdleOptions>,
19}