Sandbox skill: three gaps in the `defineSandboxProxy` `allow` section
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- documentation
Direzione di ricerca
Leggi la sezione “Forward Matching Requests to a Proxy” in skills/sandbox/SKILL.md (righe 638–674) e confronta gli esempi con il changelog della versione 5.0.0 e packages/vercel-sandbox/src/proxy.ts citati nell’issue. Chiarisci il requisito di versione e il caso in cui manca la variabile d’ambiente, poi modifica il secondo esempio in modo che non avvolga un proxy già creato. Il lavoro è completato quando tutti e tre i punti fuorvianti sono stati corretti nello skill.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The "Forward Matching Requests to a Proxy" section of the sandbox skill (skills/sandbox/SKILL.md, lines 638 to 674) was updated for @vercel/sandbox 5.0.0. Three things in it can mislead a reader.
1. It does not say which version it needs
The own-project rule and the allow option are new in 5.0.0, released on November 25. The skill describes them as if every version had them.
In 4.1.0 and earlier:
defineSandboxProxydoes not check the project at all. Any sandbox with a valid token can use the proxy.- The second argument is the invalid-request handler, not an options object:
defineSandboxProxy(handler, invalidRequestHandler?)(dist/proxy.d.tsin@vercel/[email protected]).
So on 4.x, defineSandboxProxy(handler, { allow }) never calls allow. TypeScript reports a type error, but plain JavaScript runs without complaint, and the proxy stays open to every sandbox with a valid token.
Suggested text: "The own-project rule and allow need @vercel/sandbox 5.0.0 or later. Earlier versions accept any sandbox."
2. One case is missing
Line 673 says a proxy outside Vercel has no VERCEL_PROJECT_ID. A project on Vercel that has system environment variables turned off is in the same position: it rejects every sandbox with 403. The 5.0.0 changelog and the error message both mention this case.
Suggested text, from the changelog: "A proxy with no VERCEL_PROJECT_ID, such as one outside Vercel or in a project with system environment variables disabled, rejects every sandbox until it has an allow."
3. handler means two different things
In the first snippet (line 646), handler is the finished proxy: const handler = defineSandboxProxy(...). The second snippet (line 667) then calls defineSandboxProxy(handler, { allow }).
Read together, the second snippet wraps the proxy a second time. From reading proxy.ts, the outer proxy removes the forwarding headers before it calls the inner one, so the inner one would reject every request with "Missing required proxy headers". I have not run this.
Suggested fix: show the whole call in the second snippet with the handler written inline, or give the inner function its own name.
Found while syncing the sandbox skill into vercel/vercel-plugin (vercel/vercel-plugin#467).
- Lingua principale
- TypeScript
- Stelle
- 227
- Fork
- 53
- Merge medio
- 2g 8h
- PR unite (30g)
- 38
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vercel/sandbox
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
I maintainer di solito rispondono entro 1 giorno
-
Discussion: Potential Excessive Authorization Across Independent Executions in Vercel SandboxesAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
I maintainer di solito rispondono entro 1 giorno
-
fs.rename() moves the source inside an existing directory instead of replacing itForse già presa @RaphaelFakhri l’ha presa 35 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 71/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
I maintainer di solito rispondono entro 1 giorno
-
readdir output parsing is ambiguous for filenames containing a newline or a pipeForse già presa @mmarufov l’ha presa 44 giorni fa. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vercel/sandbox
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
posit-dev/positron-sas-extension#196 ·
I maintainer di solito rispondono entro 1 giorno
-
bug composer
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
inmanta/web-console#8037 ·
I maintainer di solito rispondono entro 1 giorno
-
Add: AlFajer Palestine FHDApertacheck:passed streams:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
bug: v5 dist/types/components.d.ts imports @stencil/core/runtime instead of ./stencil-public-runtimeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno