pub enum RedirectPolicy {
None,
Initial,
}Expand description
Off-site redirect policy for credential-bearing git operations.
libgit2’s default (Initial) allows an off-site redirect on the initial
request. Since the credential callback receives the original URL (not the
redirect target) in the pinned libgit2 1.9.x, this means a token bound to
host A can be offered to a redirect target host B (Sol P1 #1429). The
secure default is RedirectPolicy::None — no off-site redirects.
Variants§
None
Do not follow any off-site redirects at any stage. Secure default. Same-authority redirects (e.g. path changes on the same host) may still be followed by the transport.
Initial
Follow off-site redirects on the initial request only (libgit2’s default). Insecure with host-scoped credentials — the credential callback cannot verify the effective peer after redirect.
Implementations§
Source§impl RedirectPolicy
impl RedirectPolicy
Sourcepub fn to_git2(self) -> RemoteRedirect
pub fn to_git2(self) -> RemoteRedirect
Convert to the git2 crate’s redirect type.
Trait Implementations§
Source§impl Clone for RedirectPolicy
impl Clone for RedirectPolicy
Source§fn clone(&self) -> RedirectPolicy
fn clone(&self) -> RedirectPolicy
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 RedirectPolicy
impl Debug for RedirectPolicy
Source§impl Default for RedirectPolicy
impl Default for RedirectPolicy
Source§fn default() -> RedirectPolicy
fn default() -> RedirectPolicy
Source§impl PartialEq for RedirectPolicy
impl PartialEq for RedirectPolicy
Source§fn eq(&self, other: &RedirectPolicy) -> bool
fn eq(&self, other: &RedirectPolicy) -> bool
self and other values to be equal, and is used by ==.impl Copy for RedirectPolicy
impl Eq for RedirectPolicy
impl StructuralPartialEq for RedirectPolicy
Auto Trait Implementations§
impl Freeze for RedirectPolicy
impl RefUnwindSafe for RedirectPolicy
impl Send for RedirectPolicy
impl Sync for RedirectPolicy
impl Unpin for RedirectPolicy
impl UnsafeUnpin for RedirectPolicy
impl UnwindSafe for RedirectPolicy
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