pub enum CloneTrust {
Trusted,
Untrusted,
}Expand description
Trust posture for a clone/fetch operation.
Untrusted is the mode required for any repository whose remote or
contents are not first-party-controlled — concretely, a PR head fetched by
a merge gate. Selecting it clamps three independently-dangerous properties
together (issue #1430), rather than requiring the caller to remember all
three every time:
SubmoduleModeis forced toSubmoduleMode::Disabledregardless of what the caller configured —.gitmodulesis attacker-controlled content, and initializing a declared submodule means fetching from an arbitrary attacker-chosen remote URL.FilterModeis forced toFilterMode::Passthroughregardless of what the caller configured — a.gitattributes-declared content filter (XET/LFS smudge) would resolve attacker-controlled pointer content against a real endpoint during checkout.- Auth is required to be
AuthMode::ExplicitOnly(already theCallbackConfig/AuthManagerdefault per B2/#1429) with no unscoped (host: None)crate::auth::AuthStrategy::Tokenpresent — seeCloneOptions::validate_trust.
This is deliberately the only notion of “untrusted” in git2db — it
composes the ambient-vs-explicit auth split B2 already established rather
than introducing a second, parallel trust concept.
Variants§
Trusted
First-party, operator-controlled repository. The caller-selected
SubmoduleMode, FilterMode, and auth configuration are honored
as configured — this is the default, matching today’s behavior.
Untrusted
Arbitrary or attacker-influenced repository (PR heads, forge-facing
fetches, anything the merge gate builds). See CloneTrust docs for
exactly what this clamps.
Trait Implementations§
Source§impl Clone for CloneTrust
impl Clone for CloneTrust
Source§fn clone(&self) -> CloneTrust
fn clone(&self) -> CloneTrust
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CloneTrust
impl Debug for CloneTrust
Source§impl Default for CloneTrust
impl Default for CloneTrust
Source§fn default() -> CloneTrust
fn default() -> CloneTrust
Source§impl PartialEq for CloneTrust
impl PartialEq for CloneTrust
Source§fn eq(&self, other: &CloneTrust) -> bool
fn eq(&self, other: &CloneTrust) -> bool
self and other values to be equal, and is used by ==.impl Copy for CloneTrust
impl Eq for CloneTrust
impl StructuralPartialEq for CloneTrust
Auto Trait Implementations§
impl Freeze for CloneTrust
impl RefUnwindSafe for CloneTrust
impl Send for CloneTrust
impl Sync for CloneTrust
impl Unpin for CloneTrust
impl UnsafeUnpin for CloneTrust
impl UnwindSafe for CloneTrust
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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 more