| 13 | /// Interface for a handler of authentication requests for all methods. |
| 14 | #[async_trait] |
| 15 | pub 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. |
nothing calls this directly
no outgoing calls
no test coverage detected