pub struct XetProvenanceStore { /* private fields */ }Expand description
Persisted (merkle_hex → {repo_id}) provenance mapping for XET CAS content.
Lives alongside the registry metadata (<base_dir>/.registry/) so it shares
the registry’s durability and 0600 permission posture.
Implementations§
Source§impl XetProvenanceStore
impl XetProvenanceStore
Sourcepub async fn load(base_dir: &Path) -> Result<Self>
pub async fn load(base_dir: &Path) -> Result<Self>
Load the provenance store from <base_dir>/.registry/xet_provenance.json,
creating an empty in-memory store if the file does not yet exist.
A missing file is the expected first-run state and yields an empty
store — which, combined with the fail-closed read gate, denies all
XetMerkle getBlob requests until provenance is recorded. That is the
intended secure default.
Sourcepub async fn record(&self, merkle_hex: &str, repo_id: &str) -> Result<()>
pub async fn record(&self, merkle_hex: &str, repo_id: &str) -> Result<()>
Record that repo_id legitimately contributed the bytes behind
merkle_hex, persisting the mapping.
SECURITY: callers MUST have authenticated the pushing repo’s identity server-side before invoking this. Never pass caller-supplied identity. The mapping is additive (global dedup means the same bytes may be uploaded by multiple repos; each legitimately gets a binding).
Auto Trait Implementations§
impl !Freeze for XetProvenanceStore
impl !RefUnwindSafe for XetProvenanceStore
impl Send for XetProvenanceStore
impl Sync for XetProvenanceStore
impl Unpin for XetProvenanceStore
impl UnsafeUnpin for XetProvenanceStore
impl !UnwindSafe for XetProvenanceStore
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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