#[cfg(feature = "biome-credentials")]
pub mod biome;
#[cfg(feature = "cylinder-jwt")]
pub mod cylinder;
#[cfg(feature = "oauth")]
pub mod oauth;
use crate::error::InternalError;
use super::AuthorizationHeader;
#[derive(Debug, PartialEq)]
pub enum Identity {
Custom(String),
Key(String),
User(String),
}
pub trait IdentityProvider: Send + Sync {
fn get_identity(
&self,
authorization: &AuthorizationHeader,
) -> Result<Option<Identity>, InternalError>;
fn clone_box(&self) -> Box<dyn IdentityProvider>;
}
impl Clone for Box<dyn IdentityProvider> {
fn clone(&self) -> Box<dyn IdentityProvider> {
self.clone_box()
}
}