-
Notifications
You must be signed in to change notification settings - Fork 925
Restrict access to .dev.vars files #9513
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
Conversation
🦋 Changeset detectedLatest commit: f5922b2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
@@ -0,0 +1,5 @@ | |||
export default { | |||
async fetch() { | |||
return new Response("Worker response"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once #9510 lands we should also check that env.ASSETS.fetch()
also doesn't expose these files.
const defaultDeniedFiles = [ | ||
".env", | ||
".env.*", | ||
"*.{crt,pem}", | ||
"**/.git/**", | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these the default Vite ones? Did you have to copy them over?
Is it not possible to just add our .dev.vars
etc paths over the top of what Vite provides??
Doesn't Vite just merge them automatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't get merged automatically, unfortunately. I was expecting them to be exported for this purpose (like they export defaultAllowedOrigins
) but they're not. I could open a PR to Vite to export.
2a15a5c
to
5c3535a
Compare
5c3535a
to
f5922b2
Compare
Fixes #000.
Note: access to Worker config files has not been restricted as they can have any names. These do not contain sensitive content, however.