cloudflare / cloudflare-rs

Rust library for the Cloudflare v4 API
256 stars 83 forks source link

Secret endpoints only show/update/delete `secret_text` #217

Open afrieirham opened 1 year ago

afrieirham commented 1 year ago

Description

Not sure what's going on here but all of these endpoints only seem to affect encrypted secrets. It works as expected when the secrets are encrypted but nothing happens when it's in plain text.

  1. List secrets – GET /accounts/{account_id}/workers/scripts/{script_name}/secrets
  2. Create secrets – PUT /accounts/{account_id}/workers/scripts/{script_name}/secrets
  3. Delete secrets – DELETE /accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}

Steps to reproduce:

  1. Create a cloudflare worker in the dashboard
  2. Add new environment variables to the project but don't encrypt it
  3. Make a GET request to the list secrets endpoint.

Expected result:

{
    "result": [
        {
            "name": "hello",
            "type": "plain_text"
        }
    ],
    "success": true,
    "errors": [],
    "messages": []
}

Actual result:

{
    "result": [],
    "success": true,
    "errors": [],
    "messages": []
}