Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wrangler): Add Secrets Store support #8382

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

jvaughan-cloudflare
Copy link
Contributor

@jvaughan-cloudflare jvaughan-cloudflare commented Mar 6, 2025

This PR introduces the Secrets Store API to the Wrangler CLI. It adds commands namespaces for wrangler secrets-store with sub-namespaces of wrangler secrets-store store and wrangler secrets-store secret for acting upon store and secret resources respectively. The intent here is to be able to fully manage the stores+secrets for an account's Secret Store, from wrangler.

Changes:

  • Added wrangler secrets-store store list|create|delete commands
  • Added wrangler secrets-store secret list|get|create|update|delete|duplicate commands
  • All commands default to local dev, need to pass --remote for acting on remote

Todo:

  • Will implement local dev version of commands (specifically create/delete secret), in a subsequent change
  • Fix e2e test runner, what do I need to do for API tokens to get the test runner to have the right permissions? Add new api token role to bach, and then update the api token in the github ci to include that role/permissions?

  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • Wrangler E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: Waiting on public documentation until the Secrets Store is released as a product.

Sorry, something went wrong.

@jvaughan-cloudflare jvaughan-cloudflare requested a review from a team as a code owner March 6, 2025 16:04
Copy link

changeset-bot bot commented Mar 6, 2025

🦋 Changeset detected

Latest commit: 7da09b0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
wrangler Minor
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jvaughan-cloudflare jvaughan-cloudflare force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch from 4ede4dd to d427605 Compare March 6, 2025 16:18
Copy link
Contributor

github-actions bot commented Mar 6, 2025

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-wrangler-8382

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8382/npm-package-wrangler-8382

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-wrangler-8382 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-cloudflare-workers-bindings-extension-8382 -O ./cloudflare-workers-bindings-extension.0.0.0-v09a32cb08.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v09a32cb08.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-create-cloudflare-8382 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-cloudflare-kv-asset-handler-8382

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-miniflare-8382

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-cloudflare-pages-shared-8382

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-cloudflare-unenv-preset-8382

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-cloudflare-vite-plugin-8382

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-cloudflare-vitest-pool-workers-8382

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-cloudflare-workers-editor-shared-8382

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-cloudflare-workers-shared-8382

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13978624980/npm-package-cloudflare-workflows-shared-8382

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@4.2.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 4.20250317.1
workerd 1.20250319.0 1.20250319.0
workerd --version 1.20250319.0 2025-03-19

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@jvaughan-cloudflare jvaughan-cloudflare force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch 3 times, most recently from fa84e2b to e5ef969 Compare March 10, 2025 15:47
@jvaughan-cloudflare jvaughan-cloudflare added the e2e Run wrangler e2e tests on a PR label Mar 10, 2025
@jvaughan-cloudflare jvaughan-cloudflare force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch 3 times, most recently from e86c698 to bccbc18 Compare March 11, 2025 20:17
@jvaughan-cloudflare jvaughan-cloudflare force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch 3 times, most recently from dce3453 to bb8703e Compare March 17, 2025 15:47
@jvaughan-cloudflare jvaughan-cloudflare force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch 6 times, most recently from bed87c4 to cbca2d5 Compare March 19, 2025 03:46
@jvaughan-cloudflare jvaughan-cloudflare added the skip-v3-pr Skip validation of presence of a v3 backport PR label Mar 19, 2025
@penalosa penalosa force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch from cbca2d5 to 3f48772 Compare March 19, 2025 11:40
@jvaughan-cloudflare jvaughan-cloudflare force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch 3 times, most recently from 1e11708 to fb4654f Compare March 19, 2025 18:16
@penalosa penalosa added the skip-pr-description-validation Skip validation of the required PR description format label Mar 19, 2025
@jvaughan-cloudflare jvaughan-cloudflare force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch from fb4654f to 3f95bba Compare March 19, 2025 18:32
@penalosa penalosa changed the title WIP: feat(wrangler): Add Secrets Store support feat(wrangler): Add Secrets Store support Mar 19, 2025
@penalosa penalosa force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch from 3f95bba to eeb0837 Compare March 19, 2025 19:52
@jvaughan-cloudflare jvaughan-cloudflare force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch from eeb0837 to 8cb53f5 Compare March 19, 2025 21:00
@jvaughan-cloudflare jvaughan-cloudflare force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch 3 times, most recently from 9c4dcf3 to 13d143b Compare March 20, 2025 15:02
@jvaughan-cloudflare jvaughan-cloudflare force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch 4 times, most recently from fc80201 to 755e517 Compare March 20, 2025 17:42
@penalosa penalosa force-pushed the jvaughan-cloudflare/add-secrets-store-to-wrangler branch from 755e517 to 7da09b0 Compare March 20, 2025 20:21
@penalosa penalosa merged commit 0d1240b into main Mar 20, 2025
23 of 27 checks passed
@penalosa penalosa deleted the jvaughan-cloudflare/add-secrets-store-to-wrangler branch March 20, 2025 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run wrangler e2e tests on a PR skip-pr-description-validation Skip validation of the required PR description format skip-v3-pr Skip validation of presence of a v3 backport PR
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants