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

Method authenticate

crates/openshell-server/src/auth/sandbox_jwt.rs:206–219  ·  view source on GitHub ↗
(
        &self,
        headers: &http::HeaderMap,
        _path: &str,
    )

Source from the content-addressed store, hash-verified

204#[async_trait]
205impl Authenticator for SandboxJwtAuthenticator {
206 async fn authenticate(
207 &self,
208 headers: &http::HeaderMap,
209 _path: &str,
210 ) -> Result<Option<Principal>, Status> {
211 let Some(token) = headers
212 .get("authorization")
213 .and_then(|v| v.to_str().ok())
214 .and_then(|v| v.strip_prefix("Bearer "))
215 else {
216 return Ok(None);
217 };
218 self.validate_bearer(token)
219 }
220}
221
222#[allow(clippy::result_large_err)]

Calls 2

validate_bearerMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected