Repository navigation
fix(cli): keep a service's Dockerfile inside its folder, and bound the SSE frame buffer - #6
Merged
Conversation
…e SSE frame buffer `link` checks the path `--dockerfile` gives, but `deploy` reads the path back from `.antelope/cloud.json` and packed whatever it named. That file is meant to be committed, so a change to it could make a deploy pack a file from outside the service folder, through `..` or a symlinked folder, into the upload. `createSourceArchive` now resolves the path and refuses one that leaves the folder with `service_path_outside_project`. `parseSse` appended to its buffer until a frame ended, without a limit. It now stops with `invalid_api_response` once one frame passes 1 MiB. The CLI and any server that relays a stream through the SDK share this parser. The release workflow's `validate` job only reads the repository, so it no longer inherits the workflow's write and OIDC permissions. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
deploy:linkchecks the path--dockerfilegives, butdeployreads the path back from.antelope/cloud.jsonand packed whatever it named.createSourceArchivenow resolves the path (symlinks included) and refuses one that leaves the service folder, with the existingservice_path_outside_projectproblem.parseSse: the frame buffer had no limit. Reading now stops withinvalid_api_responseonce a single frame passes 1 MiB.validatejob getscontents: readinstead of inheritingcontents: writeandid-token: write.Tests
cli/test/contracts.test.ts:.., and one through a linked folder, are refused;Run locally on Windows: the two new tests pass. One existing test, "Ctrl+C says the deployment keeps running and how to follow it", fails there (it sends a signal); CI on Linux is the reference.
Not changed
The default ignore list of the upload (
.git,node_modules,.antelope). Files such as.envare still uploaded unless.cloudignorenames them; excluding them by default would change what existing projects deploy, so that is left for a separate decision.