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

Function authorize_inference_bundle

crates/openshell-server/src/inference.rs:876–888  ·  view source on GitHub ↗
(
    principal: Option<&crate::auth::principal::Principal>,
)

Source from the content-addressed store, hash-verified

874}
875
876fn authorize_inference_bundle(
877 principal: Option<&crate::auth::principal::Principal>,
878) -> Result<(), Status> {
879 match principal {
880 Some(crate::auth::principal::Principal::Sandbox(_)) => Ok(()),
881 Some(crate::auth::principal::Principal::User(_)) => Err(Status::permission_denied(
882 "GetInferenceBundle requires a sandbox principal",
883 )),
884 Some(crate::auth::principal::Principal::Anonymous) | None => Err(Status::unauthenticated(
885 "GetInferenceBundle requires an authenticated sandbox principal",
886 )),
887 }
888}
889
890/// Resolve the inference bundle (all managed routes + revision hash).
891async fn resolve_inference_bundle(store: &Store) -> Result<GetInferenceBundleResponse, Status> {

Calls

no outgoing calls