MCPcopy Create free account
hub / github.com/chipsenkbeil/distant / AuthHandler

Interface AuthHandler

distant-auth/src/handler.rs:15–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13/// Interface for a handler of authentication requests for all methods.
14#[async_trait]
15pub trait AuthHandler: AuthMethodHandler + Send {
16 /// Callback when authentication is beginning, providing available authentication methods and
17 /// returning selected authentication methods to pursue.
18 async fn on_initialization(
19 &mut self,
20 initialization: Initialization,
21 ) -> io::Result<InitializationResponse> {
22 Ok(InitializationResponse {
23 methods: initialization.methods,
24 })
25 }
26
27 /// Callback when authentication starts for a specific method.
28 #[allow(unused_variables)]
29 async fn on_start_method(&mut self, start_method: StartMethod) -> io::Result<()> {
30 Ok(())
31 }
32
33 /// Callback when authentication is finished and no more requests will be received.
34 async fn on_finished(&mut self) -> io::Result<()> {
35 Ok(())
36 }
37}
38
39/// Dummy implementation of [`AuthHandler`] where any challenge or verification request will
40/// instantly fail.

Callers

nothing calls this directly

Implementers 2

handler.rsdistant-auth/src/handler.rs
client.rssrc/cli/common/client.rs

Calls

no outgoing calls

Tested by

no test coverage detected