Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`workers secrets update` without `--text` exits 0 and deploys a version with no secret value; piped stdin is ignored

Aperta Adatta ai principianti
#344 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
cli, security

Direzione di ricerca

Inizia con l’implementazione e i test per il comando cf workers secrets update, poi esegui la riproduzione fornita con --dry-run per confermare che il valore manca nel corpo della richiesta. Verifica che sia lo stdin fornito tramite pipe sia un valore omesso siano gestiti secondo il comportamento previsto. Il lavoro è completo quando, se il valore è mancante, non viene effettuata alcuna richiesta API né alcun deployment del Worker, il comando termina con un codice di uscita diverso da zero e un messaggio chiaro e i test di regressione coprono questo caso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary of the issue

cf workers secrets update <name> doesn't require a value. If you leave out --text (or --key-base64/--body), it sends a request with no value, exits 0, and the API creates and deploys a new Worker version. Piped stdin is silently ignored, so this obvious way of keeping a secret out of shell history looks like it worked but didn't set the value:

echo "my-secret" | cf workers secrets update API_KEY --worker my-worker --type secret_text
# exit 0, prints {"name":"API_KEY","type":"secret_text"}; a new version is deployed

--dry-run shows the request has no value at all:

$ echo "piped-secret" | cf workers secrets update API_KEY --worker some-worker --type secret_text --dry-run
{
  "command": "cf workers secrets update",
  "method": "PUT",
  "url": "https://api.cloudflare.com/client/v4/accounts/<account-id>/workers/scripts/some-worker/secrets",
  "bodyKind": "json",
  "body": { "type": "secret_text", "name": "API_KEY" }
}

On a throwaway Worker, this call returned success and produced a new deployed version, just like a call with --text.

Expected behaviour

When --type secret_text has no value, the command should fail before sending anything (or use the hidden prompt / stdin input asked for in #150). Piped stdin should never be silently dropped. If it isn't read, the command should say so and exit non-zero.

Version of cf used

1.0.0-beta.16 (in the beta.18 source, --text is still optional with no check)

System information and package versions
cf 1.0.0-beta.16 (also checked in the beta.18 package source)
macOS 27.0 arm64, Node 26.8.2, npm 11.19.1
Reproduction (optional)
echo "value" | cf workers secrets update API_KEY --worker <worker> --type secret_text --dry-run   # body has no "text"
echo "value" | cf workers secrets update API_KEY --worker <worker> --type secret_text             # exit 0, new version deployed
Relevant error logs (optional)

None. That's the problem. Related: #150 (stdin/prompt input, a feature request), #102 (secrets update accepts invalid names).

Lingua principale
TypeScript
Stelle
916
Fork
53
Merge medio
18h 26m
PR unite (30g)
177

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudflare/cf

Tutte le issue di cloudflare/cf

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.