saml-mdq 0.1.0

A Rust client for the SAML Metadata Query (MDQ) Protocol (IETF draft-young-md-query-saml)
docs.rs failed to build saml-mdq-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

saml-mdq

A Rust client for the SAML Metadata Query (MDQ) Protocol, used to fetch SAML metadata for individual entities from an MDQ server.

Usage

use saml_mdq::MdqClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = MdqClient::builder("https://mdq.incommon.org").build()?;

    let metadata = client
        .fetch_entity("https://login.cmu.edu/idp/shibboleth")
        .await?;

    println!("Entity ID: {:?}", metadata.entity_id);
    Ok(())
}

Caching

An optional in-memory cache can be configured to avoid redundant network requests:

use saml_mdq::{MdqCache, MdqClient};
use std::time::Duration;

let cache = MdqCache::new(1000, Duration::from_secs(3600));
let client = MdqClient::builder("https://mdq.incommon.org")
    .cache(cache)
    .build()?;

License

Licensed under either of

at your option.