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

Interface Authenticator

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

Source from the content-addressed store, hash-verified

28/// `Arc<dyn Authenticator>` inside an [`AuthenticatorChain`]).
29#[async_trait]
30pub trait Authenticator: Send + Sync + 'static {
31 /// Inspect an inbound request and return the authenticated principal.
32 ///
33 /// - `Ok(Some(principal))` — this authenticator recognized the caller.
34 /// The chain stops and the principal is inserted into request
35 /// extensions.
36 /// - `Ok(None)` — this authenticator does not apply (e.g. no Bearer
37 /// token for an OIDC authenticator). The chain falls through to
38 /// the next authenticator.
39 /// - `Err(status)` — this authenticator applies but rejected the
40 /// caller. The chain terminates and the status is returned to the
41 /// client. Fail-closed.
42 async fn authenticate(
43 &self,
44 headers: &http::HeaderMap,
45 path: &str,
46 ) -> Result<Option<Principal>, Status>;
47}
48
49/// First-match-wins authenticator chain.
50///

Callers

nothing calls this directly

Implementers 4

sandbox_jwt.rscrates/openshell-server/src/auth/sandb
k8s_sa.rscrates/openshell-server/src/auth/k8s_s
authenticator.rscrates/openshell-server/src/auth/authe
oidc.rscrates/openshell-server/src/auth/oidc.

Calls

no outgoing calls

Tested by

no test coverage detected