-
Notifications
You must be signed in to change notification settings - Fork 0
Add Cloudflare Secrets Store binding support #4
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
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "r2-explorer": minor | ||
| --- | ||
|
|
||
| Add support for Cloudflare Workers Secrets Store bindings. The `AppEnv` type now includes `SecretsStoreSecret` alongside `R2Bucket` and `Fetcher`, so workers with `[[secrets_store_secrets]]` bindings in `wrangler.toml` are fully typed. Example configuration added to the template `wrangler.toml`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ describe("Server Endpoints", () => { | |
| expect(body.buckets).not.toEqual( | ||
| expect.arrayContaining([ | ||
| expect.objectContaining({ name: "NON_R2_BINDING" }), | ||
| expect.objectContaining({ name: "MY_SECRET" }), | ||
| ]), | ||
|
Comment on lines
38
to
40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since expect.objectContaining({ name: "NON_R2_BINDING" }),
expect.objectContaining({ name: "MY_SECRET" }),
expect.objectContaining({ name: "ASSETS" }), |
||
| ); | ||
| // Check for at least the expected buckets (test environment may create additional ones) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ export default defineWorkersConfig({ | |
| }, | ||
| bindings: { | ||
| NON_R2_BINDING: { type: "var", value: "some_value" }, // For testing non-bucket bindings | ||
| MY_SECRET: { type: "var", value: "mock-secret-value" }, // Mock SecretsStoreSecret binding | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The mock for |
||
| // Add other global bindings if needed by the worker, e.g., KV or D1 | ||
| // EMAIL_SENDER: { type: "send_email", ... } // if using abstract senders for emails | ||
| }, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.