Allow csp configuration to dynamically read env variables
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
I have an "adapter-node" app deployed somewhere, I have different environments (dev, qa, prod) and i would like to provide different values to the csp configuration based on the env variables set in each environment at runtime.
Describe the proposed solution
Maybe sveltekit may support "app.html" like syntax to read the env variables at runtime:
csp: {
directives: {
'frame-src': ['self', '%sveltekit.env.APP_PUBLIC_TRUSTED_DOMAIN%']
}
}
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing adapter-node's CSP configuration and the app.html environment-variable handling. Determine how runtime values should be supplied for each deployment environment, and define tests showing that CSP directives receive those values without requiring a rebuild.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- security, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100