Skip to main content

tokn_router/
lib.rs

1use anyhow::{anyhow, Result};
2
3pub mod api;
4pub mod pipeline;
5pub mod proxy;
6
7pub use tokn_accounts as accounts;
8pub use tokn_config as config;
9pub use tokn_convert as convert;
10pub use tokn_core::{db, provider, util};
11
12/// Read-only view of the router's intercept-host allow-list. Exposed so the
13/// `tokn-accounts` registry coverage test (now living in
14/// `crates/router/tests/intercept_hosts_coverage.rs`) can verify that every
15/// descriptor host is intercepted without making the constant itself `pub`.
16pub fn proxy_intercept_hosts() -> &'static [&'static str] {
17  proxy::INTERCEPT_HOSTS
18}
19
20pub fn install_rustls_crypto_provider() -> Result<()> {
21  rustls::crypto::ring::default_provider()
22    .install_default()
23    .map_err(|_| anyhow!("failed to install rustls ring crypto provider"))?;
24  Ok(())
25}