#![allow(clippy::expect_used)]
#![allow(clippy::panic)]
#![allow(clippy::unwrap_used)]
mod claim_aggregation;
#[cfg(not(target_arch = "wasm32"))]
mod embeddable_signing;
mod examples;
pub(crate) mod fixtures;
mod validation_method;
pub(crate) const ICA_FIXTURE_JWK_ISSUER: &str = "did:jwk:eyJhbGciOiJFZERTQSIsImt0eSI6Ik9LUCIsImNydiI6IkVkMjU1MTkiLCJ4IjoiTXA1LTBlODNuTmdRaGRoQlc4UnNoa2p5OTBzYTFBOUpJemtJdGNEcUN1SSJ9";
pub(crate) const ICA_FIXTURE_WEB_ISSUER: &str =
"did:web:connected-identities.identity-stage.adobe.com";
pub(crate) fn ica_test_context() -> crate::Context {
let mut settings = crate::settings::Settings::default();
if let Some(anchors) = &mut settings.trust.anchors {
let mut cawg_anchor = anchors[0].clone();
cawg_anchor.trust_kind = crate::settings::TrustListKind::CAWG;
cawg_anchor.trusted_ica_issuers = Some(vec![
ICA_FIXTURE_JWK_ISSUER.to_string(),
ICA_FIXTURE_WEB_ISSUER.to_string(),
]);
cawg_anchor.trust_uri = Some("cawg_trust".to_string());
anchors.push(cawg_anchor);
}
crate::Context::new().with_settings(settings).unwrap()
}
pub(crate) async fn read_manifest<R: std::io::Read + std::io::Seek + Send>(
format: &str,
source: &mut R,
) -> crate::Reader {
let settings = crate::settings::Settings::default()
.with_value("core.decode_identity_assertions", false)
.unwrap();
let context = crate::Context::new()
.with_settings(settings)
.unwrap()
.into_shared();
crate::Reader::from_shared_context(&context)
.with_stream_async(format, source)
.await
.unwrap()
}