-
Notifications
You must be signed in to change notification settings - Fork 86
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
feat(frontend-canister)!: default secure configuration for assets in frontend project template #2359
Conversation
.ic-assets.json
files for node starter project asset
@robin-kunzler @eduard-dfinity here is a little script so you can test things on your end. git clone https://github.com/dfinity/sdk sdk_sec_headers
cd sdk_sec_headers
git checkout SDK-473-default-security-headers
cargo run -- new sec_headers
cd sec_headers/
cargo run --manifest-path ../Cargo.toml -- start --clean --background
cargo run --manifest-path ../Cargo.toml -- deploy
FE_CAN_ID=$(cargo run --manifest-path=../Cargo.toml -- canister id sec_headers_frontend)
open "http://127.0.0.1:8000/?canisterId=${FE_CAN_ID}"
curl --head "http://127.0.0.1:8000/index.js?canisterId=${FE_CAN_ID}"
curl --head "http://127.0.0.1:8000/main.css?canisterId=${FE_CAN_ID}" OutputThe headers are loaded as expected, and to my untrained eye, everything is working also in the browser.
|
Hey @smallstepman sorry for the late reply. I've reviewed the PR, everything looks good to me: headers are correct and I haven't seen any CSP violation or other errors in the browser. btw, it would be nice to have a FOLLOW ticket for the http security headers comments so we can track its progress, would you mind creating it in your side? |
src/dfx/assets/new_project_node_files/src/__project_name___frontend/assets/.ic-assets.json5
Show resolved
Hide resolved
src/dfx/assets/new_project_node_files/src/__project_name___frontend/assets/.ic-assets.json5
Outdated
Show resolved
Hide resolved
@ericswanson-dfinity please suggest a better PR name
? (I'll modify the changelog header too) |
What you put in the changelog looks good
|
I like the second one better |
ready for re-review @ericswanson-dfinity |
Co-authored-by: Eric Swanson <[email protected]>
Description
blocked by:
.ic-assets.json5
config files #2489allow_raw_access
config option #2824Closes https://dfinity.atlassian.net/browse/SDK-473
Closes https://dfinity.atlassian.net/browse/PSEC-710
How Has This Been Tested?
e2e
Checklist: