Sandbox preview on Google Cloud
Sandbox preview works on Google Cloud, next to AWS, Azure, Kubernetes and Local.
Your own bearer token goes in the header the preview names, and the service
receives it as Authorization, over HTTP and WebSocket:
const preview = await box.preview(sandboxId, 8080)
await fetch(preview.endpoint, {
headers: { ...preview.headers, [preview.callerAuthorizationHeader]: `Bearer ${token}` },
})- Who can preview: on Google Cloud, preview access equals command access. Only a caller that can run commands in the sandbox gets a preview, and a declaration with preview ports that no permission profile can run commands in is refused at plan time.
- Credentials: last at most 5 minutes. Call
previewagain for a fresh one. - WebSocket: offer
preview.subprotocolsafter your own, and send the headers too. Open it from server code. - Needs: the Alien CLI and SDK 3.3.68 or later. Initial setup creates one signing identity per sandbox resource with preview ports.