MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / authenticate

Method authenticate

crates/openshell-server/src/auth/authenticator.rs:71–82  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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
85impl std::fmt::Debug for AuthenticatorChain {

Callers 5

callMethod · 0.45
empty_chain_returns_noneFunction · 0.45

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected