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 compatibility #287

Closed
bmihelac opened this issue May 26, 2024 · 3 comments
Closed

Content-Security-Policy compatibility #287

bmihelac opened this issue May 26, 2024 · 3 comments

Comments

@bmihelac
Copy link
Contributor

  • Which version of Django are you using?:

Django 4.2

  • Which version of django-rosetta are you using?:

0.10.0

  • Have you looked trough recent issues and checked this isn't a duplicate?

Yes


It would be nice to ditch using inline styles and scripts so that the Django Rosetta admin interface can be used with CSP headers without needing to specify SHA-256 hashes.

The workaround for 0.10.0 is:

CSP_STYLE_SRC += [
    "'sha256-q5rmgt0qnS6vusTX681CxP1llW8fGLSs67L4+dVXYgM='",
    "'sha256-r6dGmfJqBIB7bl4g+OioPKi2r6BGt6yJMK3smPY2W3o='",
    "'unsafe-hashes'",
]
CSP_SCRIPT_SRC += [
    "'sha256-+cShGZPBVbwcgDZxLez6BVyIIip5Ei8dtU08wGULPgA='",
    "'sha256-TcUB1mzXiQO4GxpTRZ0EMpOXKMU3u+n/q1WrgVIcs1I='",
]
@mbi
Copy link
Owner

mbi commented May 26, 2024

Yea, I see that could be useful, although not my highest priority at the moment! A PR would be appreciated if you feel like digging into this.

@bmihelac
Copy link
Contributor Author

@mbi Thanks for suggestion. I’ll keep this in mind and see if I can find some time to work on it.

@mbi
Copy link
Owner

mbi commented Jun 2, 2024

Merged, thank you so much!

@mbi mbi closed this as completed Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants