Skip to content

Commit 0d1240b

Browse files
authoredMar 20, 2025··
feat(wrangler): Add Secrets Store support (#8382)
1 parent c0d0cd0 commit 0d1240b

File tree

11 files changed

+1971
-5
lines changed

11 files changed

+1971
-5
lines changed
 

‎.changeset/soft-buses-sniff.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": minor
3+
---
4+
5+
Add Secrets Store command support to Wrangler CLI
+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
2+
import { WranglerE2ETestHelper } from "./helpers/e2e-wrangler-test";
3+
import { generateResourceName } from "./helpers/generate-resource-name";
4+
import { normalizeOutput } from "./helpers/normalize";
5+
6+
describe("secrets-store", async () => {
7+
let cachedStoreId = "";
8+
let cachedSecretId = "";
9+
10+
const storeName = generateResourceName("secrets-store-store");
11+
const secretName = generateResourceName("secrets-store-secret");
12+
const helper = new WranglerE2ETestHelper();
13+
14+
const originalColumns = process.stdout.columns;
15+
beforeAll(() => {
16+
process.stdout.columns = 180;
17+
});
18+
19+
afterAll(() => {
20+
process.stdout.columns = originalColumns;
21+
});
22+
23+
const normalize = (str: string) => {
24+
return normalizeOutput(str, {
25+
[storeName]: "tmp-e2e-secrets-store-store",
26+
[secretName]: "tmp-e2e-secrets-store-secret",
27+
[process.env.CLOUDFLARE_ACCOUNT_ID as string]: "CLOUDFLARE_ACCOUNT_ID",
28+
});
29+
};
30+
31+
it("creates a store", async () => {
32+
const output = await helper.run(
33+
`wrangler secrets-store store create ${storeName} --remote`
34+
);
35+
36+
const regex = /ID:\s*(\w{32})/;
37+
const match = output.stdout.match(regex);
38+
39+
if (match && match[1]) {
40+
cachedStoreId = match[1];
41+
} else {
42+
throw new Error("No uuid for store found.");
43+
}
44+
45+
expect(normalize(output.stdout)).toMatchInlineSnapshot(`
46+
"🔐 Creating store... (Name: tmp-e2e-secrets-store-store-00000000-0000-0000-0000-000000000000)
47+
✅ Created store! (Name: tmp-e2e-secrets-store-store-00000000-0000-0000-0000-000000000000, ID: 00000000000000000000000000000000)"
48+
`);
49+
});
50+
51+
it("lists stores", async () => {
52+
const output = await helper.run(
53+
`wrangler secrets-store store list --per-page 100 --remote`
54+
);
55+
56+
expect(normalize(output.stdout)).toContain(
57+
"tmp-e2e-secrets-store-store-00000000-0000-0000-0000-000000000000"
58+
);
59+
});
60+
61+
it("creates a secret", async () => {
62+
const output = await helper.run(
63+
`wrangler secrets-store secret create ${cachedStoreId} --name ${secretName} --value shh --scopes workers --comment test --remote`
64+
);
65+
66+
const regex = /ID:\s*(\w{32})/;
67+
const match = output.stdout.match(regex);
68+
69+
if (match && match[1]) {
70+
cachedSecretId = match[1];
71+
}
72+
73+
expect(normalize(output.stdout)).toContain(
74+
"🔐 Creating secret... (Name: tmp-e2e-secrets-store-secret-00000000-0000-0000-0000-000000000000, Value: REDACTED, Scopes: workers, Comment: test"
75+
);
76+
expect(normalize(output.stdout)).toContain(
77+
"✅ Created secret! (ID: 00000000000000000000000000000000)"
78+
);
79+
});
80+
81+
it("gets a secret", async () => {
82+
const output = await helper.run(
83+
`wrangler secrets-store secret get ${cachedStoreId} --secret-id ${cachedSecretId} --remote`
84+
);
85+
86+
expect(normalize(output.stdout)).toContain(
87+
"🔐 Getting secret... (ID: 00000000000000000000000000000000)"
88+
);
89+
expect(normalize(output.stdout)).toContain(
90+
"tmp-e2e-secrets-store-secret-00000000-0000-0000-0000-000000000000"
91+
);
92+
});
93+
94+
it("updates a secret", async () => {
95+
const output = await helper.run(
96+
`wrangler secrets-store secret update ${cachedStoreId} --secret-id ${cachedSecretId} --value shh --remote`
97+
);
98+
99+
expect(normalize(output.stdout)).toContain(
100+
"🔐 Updating secret... (ID: 00000000000000000000000000000000)"
101+
);
102+
expect(normalize(output.stdout)).toContain(
103+
"✅ Updated secret! (ID: 00000000000000000000000000000000)"
104+
);
105+
expect(normalize(output.stdout)).toContain(
106+
"tmp-e2e-secrets-store-secret-00000000-0000-0000-0000-00000000000"
107+
);
108+
});
109+
110+
it("deletes a secret", async () => {
111+
const output = await helper.run(
112+
`wrangler secrets-store secret delete ${cachedStoreId} --secret-id ${cachedSecretId} --remote`
113+
);
114+
115+
expect(normalize(output.stdout)).toMatchInlineSnapshot(`
116+
"🔐 Deleting secret... (ID: 00000000000000000000000000000000)
117+
✅ Deleted secret! (ID: 00000000000000000000000000000000)"
118+
`);
119+
});
120+
121+
it("validates a secret is deleted", async () => {
122+
const output = await helper.run(
123+
`wrangler secrets-store secret get ${cachedStoreId} --secret-id ${cachedSecretId} --remote`
124+
);
125+
126+
expect(normalize(output.stdout)).toContain(
127+
"🔐 Getting secret... (ID: 00000000000000000000000000000000)"
128+
);
129+
expect(normalize(output.stdout)).toContain("secret_not_found [code: 1001]");
130+
});
131+
132+
it("deletes a store", async () => {
133+
const output = await helper.run(
134+
`wrangler secrets-store store delete ${cachedStoreId} --remote`
135+
);
136+
137+
expect(normalize(output.stdout)).toMatchInlineSnapshot(`
138+
"🔐 Deleting store... (Name: 00000000000000000000000000000000)
139+
✅ Deleted store! (ID: 00000000000000000000000000000000)"
140+
`);
141+
});
142+
143+
it("validates a store is deleted", async () => {
144+
const output = await helper.run(
145+
`wrangler secrets-store secret get ${cachedStoreId} --secret-id ${cachedSecretId} --remote`
146+
);
147+
148+
expect(normalize(output.stdout)).toContain(
149+
"🔐 Getting secret... (ID: 00000000000000000000000000000000)"
150+
);
151+
expect(normalize(output.stdout)).toContain("store_not_found [code: 1001]");
152+
});
153+
});

‎packages/wrangler/src/__tests__/deploy.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ describe("deploy", () => {
560560

561561
expect(std.out).toMatchInlineSnapshot(`
562562
"Attempting to login via OAuth...
563-
Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
563+
Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
564564
Successfully logged in.
565565
Total Upload: xx KiB / gzip: xx KiB
566566
Worker Startup Time: 100 ms
@@ -602,7 +602,7 @@ describe("deploy", () => {
602602

603603
expect(std.out).toMatchInlineSnapshot(`
604604
"Attempting to login via OAuth...
605-
Opening a link in your default browser: https://dash.staging.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
605+
Opening a link in your default browser: https://dash.staging.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
606606
Successfully logged in.
607607
Total Upload: xx KiB / gzip: xx KiB
608608
Worker Startup Time: 100 ms

‎packages/wrangler/src/__tests__/index.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ describe("wrangler", () => {
6666
wrangler login 🔓 Login to Cloudflare
6767
wrangler logout 🚪 Logout from Cloudflare
6868
wrangler whoami 🕵️ Retrieve your user information
69+
wrangler secrets-store 🔐 Manage the Secrets Store [alpha]
6970
7071
GLOBAL FLAGS
7172
-c, --config Path to Wrangler configuration file [string]
@@ -124,6 +125,7 @@ describe("wrangler", () => {
124125
wrangler login 🔓 Login to Cloudflare
125126
wrangler logout 🚪 Logout from Cloudflare
126127
wrangler whoami 🕵️ Retrieve your user information
128+
wrangler secrets-store 🔐 Manage the Secrets Store [alpha]
127129
128130
GLOBAL FLAGS
129131
-c, --config Path to Wrangler configuration file [string]

‎packages/wrangler/src/__tests__/secrets-store.test.ts

+939
Large diffs are not rendered by default.

‎packages/wrangler/src/__tests__/user.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe("User", () => {
6868
expect(counter).toBe(1);
6969
expect(std.out).toMatchInlineSnapshot(`
7070
"Attempting to login via OAuth...
71-
Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
71+
Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
7272
Successfully logged in."
7373
`);
7474
expect(readAuthConfigFile()).toEqual<UserAuthConfig>({
@@ -107,7 +107,7 @@ describe("User", () => {
107107
expect(counter).toBe(1);
108108
expect(std.out).toMatchInlineSnapshot(`
109109
"Attempting to login via OAuth...
110-
Opening a link in your default browser: https://dash.staging.cloudflare.com/oauth2/auth?response_type=code&client_id=4b2ea6cc-9421-4761-874b-ce550e0e3def&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
110+
Opening a link in your default browser: https://dash.staging.cloudflare.com/oauth2/auth?response_type=code&client_id=4b2ea6cc-9421-4761-874b-ce550e0e3def&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
111111
Successfully logged in."
112112
`);
113113

@@ -210,7 +210,7 @@ describe("User", () => {
210210
expect(counter).toBe(1);
211211
expect(std.out).toMatchInlineSnapshot(`
212212
"Attempting to login via OAuth...
213-
Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
213+
Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
214214
Successfully logged in."
215215
`);
216216
expect(std.warn).toMatchInlineSnapshot(`""`);

‎packages/wrangler/src/index.ts

+66
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,22 @@ import {
140140
secretNamespace,
141141
secretPutCommand,
142142
} from "./secret";
143+
import {
144+
secretsStoreNamespace,
145+
secretsStoreSecretNamespace,
146+
secretsStoreStoreNamespace,
147+
} from "./secrets-store";
148+
import {
149+
secretsStoreSecretCreateCommand,
150+
secretsStoreSecretDeleteCommand,
151+
secretsStoreSecretDuplicateCommand,
152+
secretsStoreSecretGetCommand,
153+
secretsStoreSecretListCommand,
154+
secretsStoreSecretUpdateCommand,
155+
secretsStoreStoreCreateCommand,
156+
secretsStoreStoreDeleteCommand,
157+
secretsStoreStoreListCommand,
158+
} from "./secrets-store/commands";
143159
import {
144160
addBreadcrumb,
145161
captureGlobalException,
@@ -811,6 +827,56 @@ export function createCLIParser(argv: string[]) {
811827
return ai(aiYargs.command(subHelp));
812828
});
813829

830+
// secrets store
831+
registry.define([
832+
{ command: "wrangler secrets-store", definition: secretsStoreNamespace },
833+
{
834+
command: "wrangler secrets-store store",
835+
definition: secretsStoreStoreNamespace,
836+
},
837+
{
838+
command: "wrangler secrets-store store create",
839+
definition: secretsStoreStoreCreateCommand,
840+
},
841+
{
842+
command: "wrangler secrets-store store delete",
843+
definition: secretsStoreStoreDeleteCommand,
844+
},
845+
{
846+
command: "wrangler secrets-store store list",
847+
definition: secretsStoreStoreListCommand,
848+
},
849+
{
850+
command: "wrangler secrets-store secret",
851+
definition: secretsStoreSecretNamespace,
852+
},
853+
{
854+
command: "wrangler secrets-store secret create",
855+
definition: secretsStoreSecretCreateCommand,
856+
},
857+
{
858+
command: "wrangler secrets-store secret list",
859+
definition: secretsStoreSecretListCommand,
860+
},
861+
{
862+
command: "wrangler secrets-store secret get",
863+
definition: secretsStoreSecretGetCommand,
864+
},
865+
{
866+
command: "wrangler secrets-store secret update",
867+
definition: secretsStoreSecretUpdateCommand,
868+
},
869+
{
870+
command: "wrangler secrets-store secret delete",
871+
definition: secretsStoreSecretDeleteCommand,
872+
},
873+
{
874+
command: "wrangler secrets-store secret duplicate",
875+
definition: secretsStoreSecretDuplicateCommand,
876+
},
877+
]);
878+
registry.registerNamespace("cert");
879+
814880
// workflows
815881
registry.define([
816882
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
import { fetchResult } from "../cfetch";
2+
3+
// Stores API
4+
5+
export type Store = {
6+
id: string;
7+
account_id: string;
8+
name: string;
9+
created: string;
10+
modified: string;
11+
};
12+
13+
export type CreateStore = {
14+
name: string;
15+
};
16+
17+
export async function createStore(
18+
accountId: string,
19+
body: CreateStore
20+
): Promise<Store> {
21+
return await fetchResult(`/accounts/${accountId}/secrets_store/stores`, {
22+
method: "POST",
23+
body: JSON.stringify(body),
24+
});
25+
}
26+
27+
export async function deleteStore(
28+
accountId: string,
29+
storeId: string
30+
): Promise<Store> {
31+
return await fetchResult(
32+
`/accounts/${accountId}/secrets_store/stores/${storeId}`,
33+
{
34+
method: "DELETE",
35+
}
36+
);
37+
}
38+
39+
export async function listStores(
40+
accountId: string,
41+
urlParams: URLSearchParams
42+
): Promise<Store[]> {
43+
return await fetchResult(
44+
`/accounts/${accountId}/secrets_store/stores`,
45+
{
46+
method: "GET",
47+
},
48+
urlParams
49+
);
50+
}
51+
52+
// Secrets API
53+
54+
export type Secret = {
55+
id: string;
56+
store_id: string;
57+
name: string;
58+
comment: string;
59+
scopes: string[];
60+
created: string;
61+
modified: string;
62+
status: string;
63+
};
64+
65+
export async function listSecrets(
66+
accountId: string,
67+
storeId: string,
68+
urlParams: URLSearchParams
69+
): Promise<Secret[]> {
70+
return await fetchResult(
71+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets`,
72+
{
73+
method: "GET",
74+
},
75+
urlParams
76+
);
77+
}
78+
79+
export async function getSecret(
80+
accountId: string,
81+
storeId: string,
82+
secretId: string
83+
): Promise<Secret> {
84+
return await fetchResult(
85+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}`,
86+
{
87+
method: "GET",
88+
}
89+
);
90+
}
91+
92+
export type CreateSecret = {
93+
name: string;
94+
value: string;
95+
scopes: string[];
96+
comment?: string;
97+
};
98+
99+
export async function createSecret(
100+
accountId: string,
101+
storeId: string,
102+
body: CreateSecret
103+
): Promise<Secret[]> {
104+
return await fetchResult(
105+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets`,
106+
{
107+
method: "POST",
108+
body: JSON.stringify([body]),
109+
}
110+
);
111+
}
112+
113+
export type UpdateSecret = {
114+
value?: string;
115+
scopes?: string[];
116+
comment?: string;
117+
};
118+
119+
export async function updateSecret(
120+
accountId: string,
121+
storeId: string,
122+
secretId: string,
123+
body: UpdateSecret
124+
): Promise<Secret> {
125+
return await fetchResult(
126+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}`,
127+
{
128+
method: "PATCH",
129+
body: JSON.stringify(body),
130+
}
131+
);
132+
}
133+
134+
export async function deleteSecret(
135+
accountId: string,
136+
storeId: string,
137+
secretId: string
138+
): Promise<Secret> {
139+
return await fetchResult(
140+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}`,
141+
{
142+
method: "DELETE",
143+
}
144+
);
145+
}
146+
147+
export type DuplicateSecret = {
148+
name: string;
149+
scopes: string[];
150+
comment: string;
151+
};
152+
153+
export async function duplicateSecret(
154+
accountId: string,
155+
storeId: string,
156+
secretId: string,
157+
body: DuplicateSecret
158+
): Promise<Secret> {
159+
return await fetchResult(
160+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}/duplicate`,
161+
{
162+
method: "POST",
163+
body: JSON.stringify(body),
164+
}
165+
);
166+
}

‎packages/wrangler/src/secrets-store/commands.ts

+608
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { createNamespace } from "../core/create-command";
2+
3+
export const secretsStoreNamespace = createNamespace({
4+
metadata: {
5+
description: `🔐 Manage the Secrets Store`,
6+
status: "alpha",
7+
owner: "Product: SSL",
8+
},
9+
});
10+
11+
export const secretsStoreStoreNamespace = createNamespace({
12+
metadata: {
13+
description: "🔐 Manage Stores within the Secrets Store",
14+
status: "alpha",
15+
owner: "Product: SSL",
16+
},
17+
});
18+
19+
export const secretsStoreSecretNamespace = createNamespace({
20+
metadata: {
21+
description: "🔐 Manage Secrets within the Secrets Store",
22+
status: "alpha",
23+
owner: "Product: SSL",
24+
},
25+
});

‎packages/wrangler/src/user/user.ts

+2
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ const DefaultScopes = {
354354
"queues:write": "See and change Cloudflare Queues settings and data",
355355
"pipelines:write":
356356
"See and change Cloudflare Pipelines configurations and data",
357+
"secrets_store:write":
358+
"See and change secrets + stores within the Secrets Store",
357359
} as const;
358360

359361
const OptionalScopes = {

0 commit comments

Comments
 (0)
Please sign in to comment.