Skip to main content

elemental_core/auth/providers/
offline.rs

1use async_trait::async_trait;
2
3use crate::auth::accounts::offline::{OFFLINE_AUTHORIZER_ID, OfflineAccount};
4use crate::auth::error::Result;
5use crate::auth::providers::TypedAccountProvider;
6
7#[derive(Debug, Clone, Copy, Default)]
8pub struct OfflineAccountProvider;
9
10#[async_trait]
11impl TypedAccountProvider for OfflineAccountProvider {
12    type Account = OfflineAccount;
13
14    fn authorizer_id(&self) -> &'static str {
15        OFFLINE_AUTHORIZER_ID
16    }
17
18    async fn refresh(&self, account: &Self::Account) -> Result<Self::Account> {
19        Ok(account.clone())
20    }
21}