(sandbox: &DriverSandbox)
| 515 | } |
| 516 | |
| 517 | fn validate_sandbox_auth(sandbox: &DriverSandbox) -> Result<(), Status> { |
| 518 | let token_present = sandbox |
| 519 | .spec |
| 520 | .as_ref() |
| 521 | .is_some_and(|spec| !spec.sandbox_token.trim().is_empty()); |
| 522 | if token_present { |
| 523 | return Ok(()); |
| 524 | } |
| 525 | |
| 526 | Err(Status::failed_precondition( |
| 527 | "docker sandboxes require gateway JWT auth; configure [openshell.gateway.gateway_jwt]", |
| 528 | )) |
| 529 | } |
| 530 | |
| 531 | fn validate_gpu_request( |
| 532 | gpu_requirements: Option<&GpuResourceRequirements>, |