#![warn(missing_docs)]
pub mod error;
pub mod introspection;
pub mod validator;
use std::sync::Arc;
use validator::extract::TokenType;
use validator::{AccessTokenValidator, ValidatedRequest};
#[doc(inline)]
pub use huskarl_core as core;
#[derive(Debug, Clone)]
pub struct DefaultJwsVerifierPlatform(Arc<dyn core::crypto::verifier::JwsVerifierPlatform>);
impl From<DefaultJwsVerifierPlatform> for Arc<dyn core::crypto::verifier::JwsVerifierPlatform> {
fn from(value: DefaultJwsVerifierPlatform) -> Self {
value.0
}
}
#[cfg(all(
feature = "default-jws-verifier-platform",
not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))
))]
impl Default for DefaultJwsVerifierPlatform {
fn default() -> Self {
Self(Arc::new(huskarl_crypto_native::NativeVerifierPlatform))
}
}
#[cfg(all(
feature = "default-jws-verifier-platform",
all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))
))]
impl Default for DefaultJwsVerifierPlatform {
fn default() -> Self {
Self(Arc::new(
huskarl_crypto_webcrypto::WebCryptoVerifierPlatform::default(),
))
}
}