Skip to content

Commit bb0ac73

Browse files
[Secrets Store] Review for consistency and clarity in examples and limits (#21795)
* Fix access-control info about Account Super Admins * Revise examples so bindings vs secret names are not mixed up * Touch up example secret name in commands.mdx * Make prereqs and local dev callouts clearer * Fix typo and add monospaced h3s for consistency * Fix order to match list at the top of the page * Improve context and cross-linking * Clarify maximum of 20 secrets only apply to production * Use placeholder for binding variable and apply throughout
1 parent e482323 commit bb0ac73

File tree

5 files changed

+93
-89
lines changed

5 files changed

+93
-89
lines changed

src/content/docs/secrets-store/access-control.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ While all Cloudflare accounts will have access to the Secrets Store section on t
1717

1818
Refer to the list below for default role definitions.
1919

20-
- **Super Administrator**: Can create, edit, duplicate, delete, and view secrets metadata.
20+
- **Super Administrator**: Can create, edit, duplicate, delete, and view secrets metadata. Can also [add a Secrets Store binding to a Worker](/secrets-store/integrations/workers/).
2121
- **Secrets Store Admin**: Can create, edit, duplicate, delete, and view secrets metadata.
2222
- **Secrets Store Deployer**: Can view secrets metadata but cannot create, edit, duplicate, nor delete secrets. Can also [add a Secrets Store binding to a Worker](/secrets-store/integrations/workers/).
2323
- **Secrets Store Reporter**: Can view secrets metadata. Cannot perform any actions (create, edit, duplicate, delete secrets), nor add a Secrets Store binding to a Worker.

src/content/docs/secrets-store/integrations/workers.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ This is different from Workers [Variables and Secrets](/workers/configuration/se
1919

2020
- If [using the Dashboard](#via-dashboard), make sure you already have a Workers application. Refer to the [Workers get started](/workers/get-started/dashboard/) for guidance.
2121

22-
- You should also have a store created under the Secrets Store tab on the Dashboard.
23-
- The first store in your account is created automatically when a user with [Super Administrator or Secrets Store Admin role](/secrets-store/access-control/) interacts with it.
24-
- You can also use the [Wrangler command](/workers/wrangler/commands/#secrets-store-store) `secrets-store store create <name> --remote` to create your first store.
22+
- You should also have a store created under the **Secrets Store** tab on the Dashboard. The first store in your account is created automatically when a user with [Super Administrator or Secrets Store Admin role](/secrets-store/access-control/) interacts with it.
23+
24+
- If no store exists in your account yet and you have the necessary permissions, you can use the [Wrangler command](/workers/wrangler/commands/#secrets-store-store) `secrets-store store create <name> --remote` to create your first store.
2525

2626
:::caution[Local development mode]
27-
This guide assumes you are working in production. To use Secrets Store locally, you must use `secrets-store` [Wrangler commands](/workers/wrangler/commands/) without the `--remote` flag.
27+
This guide assumes you are working in production. To use Secrets Store locally, you must use `secrets-store secret` [Wrangler commands](/workers/wrangler/commands/) without the `--remote` flag.
2828
:::
2929

3030
## 1. Set up account secrets in Secrets Store
3131

32-
If there are no secrets in the store yet, follow the steps below. You must have a [Super Administrator or a Secrets Store Admin role](/secrets-store/access-control/) within your Cloudflare account.
32+
Follow the steps below to create secrets. You must have a [Super Administrator or a Secrets Store Admin role](/secrets-store/access-control/) within your Cloudflare account.
3333

3434
:::note
3535
You may also add account secrets directly from the Workers settings on the dashboard. You can skip to [step 2](#via-dashboard) to do that.
@@ -112,7 +112,7 @@ To bind an account secret to your Worker, you must have one of the following [ro
112112
```toml
113113
main = "./src/index.js"
114114
secrets_store_secrets = [
115-
{ binding = "MY_SECRETS_STORE_SECRET", store_id= "<STORE_ID>", secret_name = "<MY_SECRET_NAME>" }
115+
{ binding = "<BINDING_VARIABLE>", store_id= "<STORE_ID>", secret_name = "<MY_SECRET_NAME>" }
116116
]
117117
```
118118

@@ -140,14 +140,14 @@ secrets_store_secrets = [
140140
### Call `get()` on the binding variable
141141

142142
:::caution[Local development mode]
143-
You cannot access production secrets (created on the dashboard, via API, or with the `--remote` flag) from your local development setup. To use Secrets Store locally, you must use [secrets-store Wrangler commands](/workers/wrangler/commands/) without the `--remote` flag.
143+
You cannot access production secrets (created on the dashboard, via API, or with the `--remote` flag) from your local development setup. To use Secrets Store locally, you must use `secrets-store secret` [Wrangler commands](/workers/wrangler/commands/) without the `--remote` flag.
144144
:::
145145

146146
```js
147147
export default {
148148
async fetch(request, env) {
149149
// Example of using the secret safely in an API request
150-
const APIkey = await env.MY_SECRETS_STORE_SECRET.get()
150+
const APIkey = await env.<BINDING_VARIABLE>.get()
151151

152152
const response = await fetch("https://api.example.com/data", {
153153
headers: { "Authorization": `Bearer ${APIKey}` },

src/content/docs/secrets-store/manage-secrets/how-to.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You must have a [Super Administrator or Secrets Store Admin role](/secrets-store
1313

1414
## Manage via Wrangler
1515

16-
For Wrangler commands, refer to [Cloudflare Workers](/workers/wrangler/commands/#secrets-store-secret) documentation.
16+
[Wrangler](/workers/wrangler/) is a command-line interface (CLI) that allows you to manage [Cloudflare Workers](/workers/) projects. Refer to [Wrangler commands](/workers/wrangler/commands/#secrets-store-secret) for guidance on how to use it with Secrets Store.
1717

1818
## Create a secret
1919

src/content/docs/secrets-store/manage-secrets/index.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ Once a secret is added to the Secrets Store, it can no longer be decrypted or ac
1414

1515
## Limits
1616

17-
Customers who create a secrets store in the open beta can have up to 20 secrets per account.
17+
Customers who create a secrets store in the open beta can have up to 20 secrets per account. Also, there can only be one store per account.
18+
19+
:::note[Production secrets]
20+
If you use [Wrangler](/secrets-store/manage-secrets/how-to/#manage-via-wrangler), there is a difference between production secrets and secrets that are only created locally (without the `--remote` flag). The limit of 20 secrets per account only considers production secrets.
21+
:::
1822

1923
## Resources
2024

src/content/docs/workers/wrangler/commands.mdx

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -517,81 +517,6 @@ Finished processing secrets JSON file:
517517
🚨 1 secrets failed to upload
518518
```
519519

520-
## `secrets-store store`
521-
522-
You can use the following commands to manage your store.
523-
524-
:::note[Store limitation]
525-
Each account only supports one store in beta.
526-
:::
527-
528-
### create
529-
530-
Create a store within Secrets Store.
531-
532-
```txt
533-
wrangler secerets-store store create <name>
534-
```
535-
536-
- `name` <Type text="string" /> <MetaInfo text="required" />
537-
- A descriptive name for the account-level secret. Cannot contain spaces.
538-
539-
The following is an example of using the `create` command to create a store.
540-
541-
```txt
542-
wrangler secrets-store store create default --remote
543-
```
544-
545-
```sh output
546-
🔐 Creating store... (Name: default)
547-
✅ Created store! (Name: default, ID: 2e2a82d317134506b58defbe16982d54)
548-
```
549-
550-
### delete
551-
552-
Delete a store within Secrets Store.
553-
554-
```txt
555-
wrangler secerets-store store delete <STORE_ID>
556-
```
557-
558-
- `STORE_ID` <Type text="string" /> <MetaInfo text="required" />
559-
- The secret store public ID. You can find it and copy from the [Secrets Store tab](https://dash.cloudflare.com/?to=/:account/secrets-store/) on the dashboard.
560-
561-
The following is an example of using the `delete` command to delete a store.
562-
563-
```sh
564-
npx wrangler secrets-store store delete d2dafaeac9434de2b6d08b292ce08211
565-
```
566-
567-
```sh output
568-
🔐 Deleting store... (Name: d2dafaeac9434de2b6d08b292ce08211)
569-
✅ Deleted store! (ID: d2dafaeac9434de2b6d08b292ce08211)
570-
```
571-
572-
### list
573-
574-
List the stores within an account.
575-
576-
```txt
577-
wrangler secrets-store store list
578-
```
579-
580-
The following is an example of using the `list` command to list stores.
581-
582-
```sh
583-
npx wrangler secrets-store store list
584-
```
585-
586-
```sh output
587-
🔐 Listing stores...
588-
┌─────────┬──────────────────────────────────┬──────────────────────────────────┬──────────────────────┬──────────────────────┐
589-
│ Name │ ID │ AccountID │ Created │ Modified │
590-
├─────────┼──────────────────────────────────┼──────────────────────────────────┼──────────────────────┼──────────────────────┤
591-
│ default │ 8876bad33f164462bf0743fe8adf98f4 │ REDACTED │ 4/9/2025, 1:11:48 PM │ 4/9/2025, 1:11:48 PM │
592-
└─────────┴──────────────────────────────────┴──────────────────────────────────┴──────────────────────┴──────────────────────┘
593-
```
594-
595520
## `secrets-store secret`
596521

597522
With the release of [Secrets Store](/secrets-store/) in open beta, you can use the following commands to manage your account secrets.
@@ -627,13 +552,13 @@ wrangler secrets-store secret create <STORE_ID> [OPTIONS]
627552
The following is an example of using the `create` command to create an account-level secret.
628553

629554
```sh
630-
npx wrangler secrets-store secret create 8f7a1cdced6342c18d223ece462fd88d --name MY_SECRETS_STORE_SECRET --scopes workers --remote
555+
npx wrangler secrets-store secret create 8f7a1cdced6342c18d223ece462fd88d --name ServiceA_key-1 --scopes workers --remote
631556
```
632557

633558
```sh output
634559
✓ Enter a secret value: › ***
635560

636-
🔐 Creating secret... (Name: MY_SECRETS_STORE_SECRET, Value: REDACTED, Scopes: workers, Comment: undefined)
561+
🔐 Creating secret... (Name: ServiceA_key-1, Value: REDACTED, Scopes: workers, Comment: undefined)
637562
✓ Select an account: › My account
638563
✅ Created secret! (ID: 13bc7498c6374a4e9d13be091c3c65f1)
639564
```
@@ -709,7 +634,7 @@ npx wrangler secrets-store secret get 8f7a1cdced6342c18d223ece462fd88d --secret-
709634
✓ Select an account: › My account
710635
| Name | ID | StoreID | Comment | Scopes | Status | Created | Modified |
711636
|-----------------------------|-------------------------------------|-------------------------------------|---------|---------|---------|------------------------|------------------------|
712-
| MY_SECRETS_STORE_SECRET | 13bc7498c6374a4e9d13be091c3c65f1 | 8f7a1cdced6342c18d223ece462fd88d | | workers | active | 4/9/2025, 10:06:01 PM | 4/15/2025, 09:13:05 AM |
637+
| ServiceA_key-1 | 13bc7498c6374a4e9d13be091c3c65f1 | 8f7a1cdced6342c18d223ece462fd88d | | workers | active | 4/9/2025, 10:06:01 PM | 4/15/2025, 09:13:05 AM |
713638
```
714639

715640
### `delete`
@@ -742,6 +667,81 @@ wrangler secrets-store secret list <STORE_ID>
742667
- `STORE_ID` <Type text="string" /> <MetaInfo text="required" />
743668
- The secret store public ID. You can find it and copy from the [Secrets Store tab](https://dash.cloudflare.com/?to=/:account/secrets-store/) on the dashboard.
744669

670+
## `secrets-store store`
671+
672+
Use the following commands to manage your store.
673+
674+
:::note[Store limitation]
675+
[Secrets Store](/secrets-store/) is in open beta. Currently, you can only have one store per Cloudflare account.
676+
:::
677+
678+
### `create`
679+
680+
Create a store within Secrets Store.
681+
682+
```txt
683+
wrangler secrets-store store create <name>
684+
```
685+
686+
- `name` <Type text="string" /> <MetaInfo text="required" />
687+
- A descriptive name for the account-level secret. Cannot contain spaces.
688+
689+
The following is an example of using the `create` command to create a store.
690+
691+
```txt
692+
wrangler secrets-store store create default --remote
693+
```
694+
695+
```sh output
696+
🔐 Creating store... (Name: default)
697+
✅ Created store! (Name: default, ID: 2e2a82d317134506b58defbe16982d54)
698+
```
699+
700+
### `delete`
701+
702+
Delete a store within Secrets Store.
703+
704+
```txt
705+
wrangler secrets-store store delete <STORE_ID>
706+
```
707+
708+
- `STORE_ID` <Type text="string" /> <MetaInfo text="required" />
709+
- The secret store public ID. You can find it and copy from the [Secrets Store tab](https://dash.cloudflare.com/?to=/:account/secrets-store/) on the dashboard.
710+
711+
The following is an example of using the `delete` command to delete a store.
712+
713+
```sh
714+
npx wrangler secrets-store store delete d2dafaeac9434de2b6d08b292ce08211
715+
```
716+
717+
```sh output
718+
🔐 Deleting store... (Name: d2dafaeac9434de2b6d08b292ce08211)
719+
✅ Deleted store! (ID: d2dafaeac9434de2b6d08b292ce08211)
720+
```
721+
722+
### `list`
723+
724+
List the stores within an account.
725+
726+
```txt
727+
wrangler secrets-store store list
728+
```
729+
730+
The following is an example of using the `list` command to list stores.
731+
732+
```sh
733+
npx wrangler secrets-store store list
734+
```
735+
736+
```sh output
737+
🔐 Listing stores...
738+
┌─────────┬──────────────────────────────────┬──────────────────────────────────┬──────────────────────┬──────────────────────┐
739+
│ Name │ ID │ AccountID │ Created │ Modified │
740+
├─────────┼──────────────────────────────────┼──────────────────────────────────┼──────────────────────┼──────────────────────┤
741+
│ default │ 8876bad33f164462bf0743fe8adf98f4 │ REDACTED │ 4/9/2025, 1:11:48 PM │ 4/9/2025, 1:11:48 PM │
742+
└─────────┴──────────────────────────────────┴──────────────────────────────────┴──────────────────────┴──────────────────────┘
743+
```
744+
745745
## `workflows`
746746

747747
:::note

0 commit comments

Comments
 (0)