Rust

Routing certificate calls by domain.

Contents

use utopia_cdn::certificates::proxy::Proxy;
Rust
pub struct Proxy

Routes each certificate call to the providers responsible for the domain: the network provider for site, network and redirect domains, the app domain's provider for the app domain itself, and every custom-domain provider for anything else (fails with Error::Configuration when there are none).

Over several providers, a certificate is instant only when every one is, needs renewing when any does, and is issued when every provider that is not instant reports it issued (else the first other status).

Rust
use std::sync::Arc;

use utopia_cdn::certificates::{Cloudflare, FastlyTls, Proxy};

let app = Arc::new(FastlyTls::new("token", "app-configuration"));
let network = Arc::new(FastlyTls::new("token", "edge-configuration"));
let custom = vec![Arc::new(Cloudflare::new("zone", "token")) as _, Arc::new(FastlyTls::new("token", "")) as _];
let proxy = Proxy::new("App.Example.com", app, network, custom)?;
assert_eq!(proxy.app_domain(), "app.example.com");
Also implements Debug.