use std::sync::Arc;
use webgates::accounts::Account;
use webgates::authz::access_hierarchy::AccessHierarchy;
use webgates::codecs::Codec;
use webgates::codecs::jwt::JwtClaims;
pub mod bearer;
pub mod remote_jwks_bearer;
#[derive(Clone, Debug)]
pub struct Gate;
impl Gate {
pub fn bearer<C, R, G>(
issuer: &str,
codec: Arc<C>,
) -> bearer::BearerGate<C, R, G, bearer::JwtConfig<R, G>>
where
C: Codec<Payload = JwtClaims<Account<R, G>>>,
R: AccessHierarchy + Eq + std::fmt::Display + Default + Clone + Send + Sync + 'static,
G: Eq + Clone + Send + Sync + 'static,
{
bearer::BearerGate::new_with_codec(issuer, codec)
}
}