feat(storage): sign Azure layer-file uploads with a SAS - #3634
michalsuba-e2b wants to merge 3 commits into
Conversation
…load headers
Azure's Put Blob requires the request header "x-ms-blob-type: BlockBlob". A SAS can
only pin response headers, so no signed URL alone can satisfy it and the provider
refused to issue one at all — every template build with a COPY instruction failed on
Azure at the get-signed-URL step.
UploadSignedURL now returns {URL, Headers} instead of a bare URL, and the header
travels with the URL through the gRPC and public API responses for the upload client
to apply. Azure mints a create+write blob SAS with whichever credential the provider
already authenticated with: a user delegation key for a token credential (the managed
identity path), or the shared key when one is configured. A SAS-only connection string
can sign neither and now says so at construction and at the call. GCS, S3 and the
filesystem provider return nil headers and byte-identical URLs.
The proto and OpenAPI additions are additive — url stays optional, and a client that
ignores the new field parses the response unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
CI attribution, for the reviewer (current run, after the main merge — 38 pass / 4 fail): The only failures are Everything else is green, including the two flakes from the previous run: |
|
Live-environment validation on an Azure BYOC env (miso9), dev |
…rance' into feat/azure-signed-upload-headers # Conflicts: # packages/api/internal/api/api.gen.go
Standing review rule: a comment states one constraint on one line; reasoning lives here, not at the fix site. No behavior change; tests unchanged and green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Moved to belt (source of truth): e2b-dev/belt#3308 (stacked on e2b-dev/belt#3307). Same diff, paths remapped; live miso9 evidence and review threads referenced from there. Closing. |
Azure template builds fail on every
COPY:Put Blobrequires thex-ms-blob-typerequest header, which a SAS cannot carry and the upload client never sent. The Azure provider now signs a real upload SAS, and the response carries the request headers the client must send.UploadSignedURLreturnsUploadURL{URL, Headers}; GCS/S3/fs return no headers — responses byte-identical, guard-tested (MinIO live for S3).InitLayerFileUploadResponse.uploadHeaders = 3+ OpenAPIheaders, both additive; the api handler passes them through only when non-empty.MissingRequiredHeader, with header → 201; SDK counterpart fix(sdk): apply the upload headers the API returns with a file upload link E2B#1870.Stacked on #3633. CI note:
validate-openapiis red onmainfor all three specs; this branch's +5 spec lines change nothing in its output.Sponsor: @michalsuba-e2b
🤖 Generated with Claude Code