1#![deny(missing_docs)]
3
4use sha2::Digest;
5
6pub mod annotations;
7mod blob;
8pub mod client;
9pub mod config;
10pub(crate) mod digest;
11pub mod errors;
12pub mod manifest;
13pub mod secrets;
14mod token_cache;
15
16#[doc(inline)]
17pub use client::Client;
18#[doc(inline)]
19pub use oci_spec::distribution::{ParseError, Reference};
20#[doc(inline)]
21pub use token_cache::RegistryOperation;
22
23pub(crate) fn sha256_digest(bytes: &[u8]) -> String {
25 format!("sha256:{}", hex::encode(sha2::Sha256::digest(bytes)))
26}
27
28#[cfg(test)]
29mod test_helpers {
30 use std::sync::OnceLock;
31
32 static PROVIDER_INIT: OnceLock<()> = OnceLock::new();
33
34 pub(crate) fn jsonwebtoken_install_default_crypto_provider() {
35 PROVIDER_INIT.get_or_init(|| {
36 let _ = jsonwebtoken::crypto::aws_lc::DEFAULT_PROVIDER.install_default();
37 });
38 }
39}