Skip to content

cf workers secrets bulk silently no-ops on the plain body shape; secrets update accepts invalid names #102

Open

Description

@joeblew999

cf version: 1.0.0-beta.5, macOS

1. cf workers secrets bulk silently does nothing with the plain (RFC 7396 merge-patch) body.

cf workers secrets bulk --worker W --body '{"API_KEY":{"type":"secret_text","text":"v"}}'

This returns 200 and exits 0, and the response lists the bindings, but the secret's value doesn't change (checked for 20 s). Only the wrapped shape {"secrets":{"API_KEY":{...}}} applies it.

  • --file with the plain shape: the same silent no-op.
  • --file with a .env file: [10026] Could not parse request body.
  • --help doesn't show the body shape, and cf schema workers secrets bulk shows requestBodyFields: [].

2. cf workers secrets update accepts invalid names. cf workers secrets update "bad-name!" --worker W --type secret_text --text v creates the secret (exit 0), although the help says the name must be "A JavaScript variable name". It can only be removed with delete "bad-name!" -f.

Expected: reject a body that won't apply, or accept the plain shape; document the body in --help and the schema; validate secret names locally.

Related, but a different problem: #96 (secrets update replaces the whole set).

Found while evaluating cf for a dev workflow: https://github.com/joeblew999/cf-cli-test (FINDINGS.md, findings/).

Activity

  1. MattieTK commented on Oct 9, 2026

    @MattieTK
    Member

    AI-authored follow-up: Prepared by OpenAI Codex at the user's request; commands were executed on a dedicated test Worker with dummy secrets on October 9, 2026.

    Reconfirmed the unwrapped --body silent no-op on [email protected] (npm latest when checked today), from a fresh beta.13 cf init project. This tests both creation and deletion using secret-name lists, not just an attempted value change:

    Step Exit status Canary present afterward
    Wrapped reset/delete; list confirms clean baseline 0 No
    Flat create with name, type, and text 0 No
    Wrapped create with the same secret object 0 Yes
    Flat delete using null 0 Yes
    Wrapped delete using null 0 No

    Commands, with a disposable Worker name substituted:

    cf workers secrets bulk --worker test-worker --body '{"secrets":{"AI_BULK_CANARY_20261009":null}}'
    cf workers secrets list --worker test-worker
    
    cf workers secrets bulk --worker test-worker --body '{"AI_BULK_CANARY_20261009":{"name":"AI_BULK_CANARY_20261009","type":"secret_text","text":"dummy-canary"}}'
    cf workers secrets list --worker test-worker
    
    cf workers secrets bulk --worker test-worker --body '{"secrets":{"AI_BULK_CANARY_20261009":{"name":"AI_BULK_CANARY_20261009","type":"secret_text","text":"dummy-canary"}}}'
    cf workers secrets list --worker test-worker
    
    cf workers secrets bulk --worker test-worker --body '{"AI_BULK_CANARY_20261009":null}'
    cf workers secrets list --worker test-worker
    
    cf workers secrets bulk --worker test-worker --body '{"secrets":{"AI_BULK_CANARY_20261009":null}}'
    cf workers secrets list --worker test-worker

    Both flat requests returned a bindings map and exit 0 without applying the requested canary change. Wrapped requests applied it. The unrelated BOOTSTRAP/FIRST/SECOND secrets remained present, and the canary was removed at the end.

    cf workers secrets bulk --help still describes JSON Merge Patch generically without showing the secrets wrapper, and cf schema workers secrets bulk still reports requestBodyFields: [].

    The wrapped payload is documented at https://developers.cloudflare.com/changelog/post/2026-06-03-bulk-secrets-api/. This is a validation/help issue for malformed unwrapped input returning success, not evidence of a valid wrapped request deleting unrelated secrets.

    Related: #201 already covers overlapping bulk no-op behavior. This follow-up does not retest --file, deployment/version side effects, or invalid-name validation. No duplicate ticket was opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions