-
Notifications
You must be signed in to change notification settings - Fork 468
Finalized Content Security Policy Fix #1567
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
Open
BrianRaymond800
wants to merge
11
commits into
OpenEnergyDashboard:development
Choose a base branch
from
BrianRaymond800:pr-update
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+97
−9
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9cd1cfd
Added Documentation and pushing the initial CSP tag as well.
CamClendenon 2cb4ac9
Merge branch 'development' of https://github.com/CamClendenon/OED int…
CamClendenon 8cdc2da
Updates to documentation based on Steve's reccomendation
CamClendenon 956e878
Grammar correction
CamClendenon 2e17a9c
Merge branch 'OpenEnergyDashboard:development' into development
CamClendenon fc1eb21
Current Attempt to Mend CSP rule (STILL IN PROGRESS)
CamClendenon 5824620
Semi Working Page with CSP rule, Still csp blocking some things
CamClendenon d45135d
Added new file to add Emotion/Cache which helps let the nonce be save…
CamClendenon ceab8a8
Merge branch 'OpenEnergyDashboard:development' into development
CamClendenon 6ac1a5b
Updated the CSP fix with improved comments
BrianRaymond800 28c2cd9
Improved the formatting to align with OED's
BrianRaymond800 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import createCache from '@emotion/cache'; | ||
|
|
||
| //creates the nonce for the script being run | ||
| //the nonce works alongside the webpack_nonce and plotly_nonce to protect against unwanted scripts | ||
| const nonce = (document.querySelector('script[nonce]') as HTMLScriptElement | null)?.nonce; | ||
|
|
||
| const emotionCache = createCache({ | ||
| key: 'css', | ||
| nonce: nonce, | ||
| }); | ||
|
|
||
| export default emotionCache; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
|
|
||
| const LodashModuleReplacementPlugin = require('lodash-webpack-plugin'); | ||
| const TerserPlugin = require('terser-webpack-plugin'); | ||
| const NodePolyfillPlugin = require('node-polyfill-webpack-plugin') | ||
| const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); | ||
| const webpack = require('webpack'); | ||
| const path = require('path'); | ||
|
|
||
|
|
@@ -38,10 +38,17 @@ const config = { | |
| module: { | ||
| rules: [ | ||
| // All TypeScript ('.ts' or '.tsx') will be handled by 'awesome-typescript-loader'. | ||
| { test: /\.[jt]sx?$/, exclude: /node_modules/, use: 'ts-loader' }, | ||
| { test: /\.[jt]sx?$/, exclude: /node_modules/, use: 'ts-loader'}, | ||
|
Member
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 space before the final } was removed but should be there. There are some other formatting issues so doing format document to fix (even though there before this wor) would be nice. |
||
| // CSS stylesheet loader. | ||
| { test: /\.css$/, use: [ | ||
| {loader: 'style-loader'}, | ||
| {loader: 'style-loader', | ||
| options: { | ||
| attributes: { | ||
| //this line allows the webpack nonce to be applied to styles | ||
| nonce: '__webpack_nonce__' | ||
| } | ||
| } | ||
| }, | ||
| {loader: 'css-loader'} | ||
| ] }, | ||
| // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
A number of commented out lines were removed here from the original PR. I wanted to check if they had any value or were examples.
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.
From what I can tell, those lines were an alternate implementation of the CSP that was rejected and replaced with the current one, but never fully removed. That is why I chose to remove it.