Skip to content
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

Content Security Policy - setup a Nonce #167

Open
jovana opened this issue Oct 12, 2023 · 2 comments
Open

Content Security Policy - setup a Nonce #167

jovana opened this issue Oct 12, 2023 · 2 comments

Comments

@jovana
Copy link

jovana commented Oct 12, 2023

Hi, Using this integration but I noticed it is not possible to set a nonce to be compliant on the CSP policies.
Is there any way to set the nonce to the inline style?

<PopupButton 
   nonce="CODE"
   // other config ...
/>

More info: https://content-security-policy.com/examples/allow-inline-style/

@tcampb
Copy link
Owner

tcampb commented Oct 13, 2023

Hey @jovana, it doesn't look like the rollup plugin we use to inject the styles supports adding a nonce:

egoist/rollup-plugin-postcss#424

Is there a build tool that you use that supports this feature? If so, I can take a look at changing the build process.

@jovana
Copy link
Author

jovana commented Oct 27, 2023

Hey @jovana, it doesn't look like the rollup plugin we use to inject the styles supports adding a nonce:

egoist/rollup-plugin-postcss#424

Is there a build tool that you use that supports this feature? If so, I can take a look at changing the build process.

Hi,

Thanks for your reply. No not using some kind of tool for this. Try to have libraries where is support is out of the box.
The problem is there are a lot of issues running CSP fully locked down using ReactJS. So right now I have to run the app using style-src 'self' 'unsafe-inline'

It's fine for now, but in the future, it's nice to have we can set a nonce also.

If you want you can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants