pub struct CallbackConfig {
pub auth: Vec<AuthStrategy>,
pub auth_mode: AuthMode,
pub progress: ProgressConfig,
pub certificates: CertificateConfig,
pub redirect_policy: RedirectPolicy,
pub pack_progress: bool,
pub push_update_reference: bool,
}Expand description
Send-safe callback configuration
This type captures the configuration for callbacks rather than the callbacks themselves. It can be safely sent across threads and used to create the actual callbacks when needed.
Fields§
§auth: Vec<AuthStrategy>Authentication strategies to try
auth_mode: AuthModeWhether ambient credential sources (AuthStrategy::Default) may be
consulted. Defaults to AuthMode::ExplicitOnly.
progress: ProgressConfigProgress reporting configuration
certificates: CertificateConfigCertificate validation configuration
redirect_policy: RedirectPolicyOff-site redirect policy. Defaults to RedirectPolicy::None (no
off-site redirects) to prevent credential exfiltration via redirect
when host-scoped credentials are present.
pack_progress: boolPack progress reporting
push_update_reference: boolPush update reference callback enabled
Implementations§
Source§impl CallbackConfig
impl CallbackConfig
Sourcepub fn with_auth(self, strategy: AuthStrategy) -> Self
pub fn with_auth(self, strategy: AuthStrategy) -> Self
Builder-style method to add authentication
Sourcepub fn with_auth_mode(self, mode: AuthMode) -> Self
pub fn with_auth_mode(self, mode: AuthMode) -> Self
Builder-style method to set the authentication provenance mode.
Sourcepub fn with_progress(self, progress: ProgressConfig) -> Self
pub fn with_progress(self, progress: ProgressConfig) -> Self
Builder-style method to set progress reporting
Sourcepub fn with_certificates(self, certs: CertificateConfig) -> Self
pub fn with_certificates(self, certs: CertificateConfig) -> Self
Builder-style method to set certificate validation
Sourcepub fn progress_reporter(&self) -> Option<Arc<dyn ProgressReporter>>
pub fn progress_reporter(&self) -> Option<Arc<dyn ProgressReporter>>
Extract the progress reporter (if using Channel config)
Sourcepub fn create_callbacks(&self) -> RemoteCallbacks<'_>
pub fn create_callbacks(&self) -> RemoteCallbacks<'_>
Create actual git2::RemoteCallbacks from this configuration
This is called within spawn_blocking where non-Send is acceptable
Sourcepub fn certificate_decision(
mode: &CertificateConfig,
hostkey: Option<(&str, &[u8])>,
) -> Result<CertificateCheckStatus, Error>
pub fn certificate_decision( mode: &CertificateConfig, hostkey: Option<(&str, &[u8])>, ) -> Result<CertificateCheckStatus, Error>
Pure certificate decision, separated from FFI cert inspection so the security boundary is unit-testable without a live TLS connection.
CertificateConfig::StrictreturnsCertificatePassthrough, which tells libgit2 to apply its built-in verification and reject on failure. It never returnsCertificateOk.CertificateConfig::AcceptAllreturnsCertificateOk— the explicit, insecure opt-in.CertificateConfig::PinnedreturnsOkonly when the resolved hostkey matches a pin, otherwise rejects. Never falls back toAcceptAll.
Trait Implementations§
Source§impl Clone for CallbackConfig
impl Clone for CallbackConfig
Source§fn clone(&self) -> CallbackConfig
fn clone(&self) -> CallbackConfig
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 CallbackConfig
impl Debug for CallbackConfig
Source§impl Default for CallbackConfig
impl Default for CallbackConfig
Source§fn default() -> CallbackConfig
fn default() -> CallbackConfig
Auto Trait Implementations§
impl Freeze for CallbackConfig
impl !RefUnwindSafe for CallbackConfig
impl Send for CallbackConfig
impl Sync for CallbackConfig
impl Unpin for CallbackConfig
impl UnsafeUnpin for CallbackConfig
impl !UnwindSafe for CallbackConfig
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<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