pub struct AuthHandler { /* private fields */ }Expand description
Handler for HTTP authentication challenges.
Implementations§
Source§impl AuthHandler
impl AuthHandler
Sourcepub fn new(connection: Arc<CdpConnection>, session_id: String) -> Self
pub fn new(connection: Arc<CdpConnection>, session_id: String) -> Self
Create a new auth handler.
Sourcepub fn with_credentials(
connection: Arc<CdpConnection>,
session_id: String,
credentials: HttpCredentials,
) -> Self
pub fn with_credentials( connection: Arc<CdpConnection>, session_id: String, credentials: HttpCredentials, ) -> Self
Create an auth handler with pre-configured credentials.
Sourcepub async fn set_credentials(&self, credentials: HttpCredentials)
pub async fn set_credentials(&self, credentials: HttpCredentials)
Set HTTP credentials.
Sourcepub fn set_credentials_sync(&self, credentials: HttpCredentials)
pub fn set_credentials_sync(&self, credentials: HttpCredentials)
Set HTTP credentials synchronously (for use during construction).
This uses blocking_write which should only be called from non-async contexts.
Sourcepub async fn clear_credentials(&self)
pub async fn clear_credentials(&self)
Clear HTTP credentials.
Sourcepub async fn handle_auth_challenge(
&self,
event: &AuthRequiredEvent,
) -> Result<bool, NetworkError>
pub async fn handle_auth_challenge( &self, event: &AuthRequiredEvent, ) -> Result<bool, NetworkError>
Handle an authentication challenge.
Returns true if the challenge was handled, false if no credentials available.
§Errors
Returns an error if the CDP command to continue with authentication fails, such as when the connection is closed or the browser rejects the request.
Sourcepub async fn reset_retries(&self, origin: &str)
pub async fn reset_retries(&self, origin: &str)
Reset retry counts (call after successful auth).
Sourcepub async fn reset_all_retries(&self)
pub async fn reset_all_retries(&self)
Reset all retry counts.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AuthHandler
impl !RefUnwindSafe for AuthHandler
impl Send for AuthHandler
impl Sync for AuthHandler
impl Unpin for AuthHandler
impl !UnwindSafe for AuthHandler
Blanket Implementations§
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
Mutably borrows from an owned value. Read more