pub struct Registry { /* private fields */ }Expand description
The registry’s content-addressed store.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn put_blob(&self, bytes: &[u8]) -> Result<String>
pub fn put_blob(&self, bytes: &[u8]) -> Result<String>
Store bytes under their own digest.
The digest is computed here and never taken from the caller: a registry that trusts a supplied digest is one where a client chooses what its bytes are called, which is the whole attack content addressing exists to prevent.
Sourcepub fn get_blob(&self, digest: &str) -> Result<Option<Vec<u8>>>
pub fn get_blob(&self, digest: &str) -> Result<Option<Vec<u8>>>
Read a blob back, verifying it still hashes to its own name.
The check is not paranoia: a content-addressed store whose reads are not verified is a store where bit rot becomes a supply-chain event, and the cost is one hash of bytes already in memory.
Sourcepub fn put_manifest(
&self,
stores: &ServerStores,
name: &str,
reference: &str,
manifest: &[u8],
) -> Result<Result<Landed, Refusal>>
pub fn put_manifest( &self, stores: &ServerStores, name: &str, reference: &str, manifest: &[u8], ) -> Result<Result<Landed, Refusal>>
Land a manifest — if the image it names was built and attested.
This is crate::registry::admit at the one place bytes become
pullable. A manifest whose digest no signed, logged build record names is
refused, and the refusal says which of the four things is missing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request