Run the chain. Returns the first principal produced. If every authenticator returns `Ok(None)`, the result is `Ok(None)` — the router translates that to `unauthenticated`.
(
&self,
headers: &http::HeaderMap,
path: &str,
)
| 69 | /// authenticator returns `Ok(None)`, the result is `Ok(None)` — the |
| 70 | /// router translates that to `unauthenticated`. |
| 71 | pub async fn authenticate( |
| 72 | &self, |
| 73 | headers: &http::HeaderMap, |
| 74 | path: &str, |
| 75 | ) -> Result<Option<Principal>, Status> { |
| 76 | for authenticator in self.authenticators.iter() { |
| 77 | if let Some(principal) = authenticator.authenticate(headers, path).await? { |
| 78 | return Ok(Some(principal)); |
| 79 | } |
| 80 | } |
| 81 | Ok(None) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | impl std::fmt::Debug for AuthenticatorChain { |
no test coverage detected