15
15
16
16
//! Helper Structs to interact with the Sigstore TUF repository.
17
17
//!
18
- //! The main interaction point is [`SigstoreRootTrust `], which fetches Rekor's
18
+ //! The main interaction point is [`SigstoreTrustRoot `], which fetches Rekor's
19
19
//! public key and Fulcio's certificate.
20
20
//!
21
21
//! These can later be given to [`cosign::ClientBuilder`](crate::cosign::ClientBuilder)
22
22
//! to enable Fulcio and Rekor integrations.
23
23
//!
24
24
//! # Example
25
25
//!
26
- //! The `SigstoreRootTrust` instance can be created via the [`SigstoreRootTrust ::prefetch`]
26
+ //! The `SigstoreRootTrust` instance can be created via the [`SigstoreTrustRoot ::prefetch`]
27
27
//! method.
28
28
//!
29
29
//! ```rust,no_run
30
- //! use sigstore::trust::sigstore::SigstoreRootTrust ;
31
- //! let repo = SigstoreRootTrust ::new(None).unwrap().prefetch().unwrap();
30
+ //! use sigstore::trust::sigstore::SigstoreTrustRoot ;
31
+ //! let repo = SigstoreTrustRoot ::new(None).unwrap().prefetch().unwrap();
32
32
//! ```
33
33
use std:: {
34
34
cell:: OnceCell ,
@@ -53,13 +53,13 @@ pub use crate::trust::{ManualTrustRoot, TrustRoot};
53
53
54
54
/// Securely fetches Rekor public key and Fulcio certificates from Sigstore's TUF repository.
55
55
#[ derive( Debug ) ]
56
- pub struct SigstoreRootTrust {
56
+ pub struct SigstoreTrustRoot {
57
57
repository : tough:: Repository ,
58
58
checkout_dir : Option < PathBuf > ,
59
59
trusted_root : OnceCell < TrustedRoot > ,
60
60
}
61
61
62
- impl SigstoreRootTrust {
62
+ impl SigstoreTrustRoot {
63
63
/// Constructs a new trust repository established by a [tough::Repository].
64
64
pub fn new ( checkout_dir : Option < & Path > ) -> Result < Self > {
65
65
// These are statically defined and should always parse correctly.
@@ -108,17 +108,17 @@ impl SigstoreRootTrust {
108
108
109
109
/// Prefetches trust materials.
110
110
///
111
- /// [TrustRoot::fulcio_certs()] and [TrustRoot::rekor_keys()] on [SigstoreRootTrust ] lazily
111
+ /// [TrustRoot::fulcio_certs()] and [TrustRoot::rekor_keys()] on [SigstoreTrustRoot ] lazily
112
112
/// fetches the requested data, which is problematic for async callers. Those callers should
113
113
/// use this method to fetch the trust root ahead of time.
114
114
///
115
115
/// ```rust
116
116
/// # use tokio::task::spawn_blocking;
117
- /// # use sigstore::trust::sigstore::SigstoreRootTrust ;
117
+ /// # use sigstore::trust::sigstore::SigstoreTrustRoot ;
118
118
/// # use sigstore::errors::Result;
119
119
/// # #[tokio::main]
120
120
/// # async fn main() -> std::result::Result<(), anyhow::Error> {
121
- /// let repo: Result<SigstoreRootTrust > = spawn_blocking(|| Ok(SigstoreRootTrust ::new(None)?.prefetch()?)).await?;
121
+ /// let repo: Result<SigstoreTrustRoot > = spawn_blocking(|| Ok(SigstoreTrustRoot ::new(None)?.prefetch()?)).await?;
122
122
/// // Now, get Fulcio and Rekor trust roots with the returned `SigstoreRootTrust`
123
123
/// # Ok(())
124
124
/// # }
@@ -149,7 +149,7 @@ impl SigstoreRootTrust {
149
149
}
150
150
}
151
151
152
- impl crate :: trust:: TrustRoot for SigstoreRootTrust {
152
+ impl crate :: trust:: TrustRoot for SigstoreTrustRoot {
153
153
/// Fetch Fulcio certificates from the given TUF repository or reuse
154
154
/// the local cache if its contents are not outdated.
155
155
///
0 commit comments