-
Notifications
You must be signed in to change notification settings - Fork 5
Get ui tests passing #153
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
base: main
Are you sure you want to change the base?
Get ui tests passing #153
Conversation
Summary of ChangesHello @cesine, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses critical configuration issues that were preventing UI tests from passing and hindering local development workflows. The main change involves modifying the Content Security Policy to explicitly allow script execution from the local CouchDB instance. This adjustment is essential for resolving problems where local applications fail to load or interact correctly with the backend, thereby establishing a functional local development environment and ensuring the reliability of UI tests. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request updates the Content Security Policy (CSP) in etc/local.ini to allow scripts from localhost:6984, which is a necessary step for local development and testing. My review focuses on ensuring the CSP is correctly formatted and secure. I've pointed out that the quotes around the CSP value should be removed, as noted in a new comment, to make the policy effective. Additionally, I've raised a concern about the use of 'unsafe-eval' and 'unsafe-inline', which are insecure and should be avoided if possible, even in a development environment.
| ; " quotes are in the csp and need to be removed | ||
| attachments_header_value = "child-src 'self' data: blob:; default-src 'self'; connect-src 'self' https://corpusdev.example.com https://localhost:3183 https://www.google-analytics.com; img-src 'self' data: https://secure.gravatar.com; font-src 'self' https://themes.googleusercontent.com; script-src 'self' https://localhost:6984 'unsafe-eval' https://www.google-analytics.com; style-src 'self' 'unsafe-inline';" |
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.
This comment correctly notes that the quotes in the attachments_header_value should be removed, but they are still present on the next line. The quotes will likely cause the Content Security Policy to be invalid. Please remove the quotes from the value, and you can remove this comment as well.
attachments_header_value = child-src 'self' data: blob:; default-src 'self'; connect-src 'self' https://corpusdev.example.com https://localhost:3183 https://www.google-analytics.com; img-src 'self' data: https://secure.gravatar.com; font-src 'self' https://themes.googleusercontent.com; script-src 'self' https://localhost:6984 'unsafe-eval' https://www.google-analytics.com; style-src 'self' 'unsafe-inline';
| ; use nginx instead to allow only signed couchapps when on deployed server | ||
| attachments_header_value = "child-src 'self' data: blob:; default-src 'self'; connect-src 'self' https://corpusdev.example.com https://localhost:3183 https://www.google-analytics.com; img-src 'self' data: https://secure.gravatar.com; font-src 'self' https://themes.googleusercontent.com; script-src 'self' 'unsafe-eval' https://www.google-analytics.com; style-src 'self' 'unsafe-inline';" | ||
| ; " quotes are in the csp and need to be removed | ||
| attachments_header_value = "child-src 'self' data: blob:; default-src 'self'; connect-src 'self' https://corpusdev.example.com https://localhost:3183 https://www.google-analytics.com; img-src 'self' data: https://secure.gravatar.com; font-src 'self' https://themes.googleusercontent.com; script-src 'self' https://localhost:6984 'unsafe-eval' https://www.google-analytics.com; style-src 'self' 'unsafe-inline';" |
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.
The Content Security Policy includes 'unsafe-eval' and 'unsafe-inline'. These directives significantly weaken the security of your application and should be avoided as they create openings for Cross-Site Scripting (XSS) attacks.
'unsafe-inline'allows inline<script>and<style>tags, as well as inline event handlers (e.g.,onclick). Consider moving all scripts and styles to external files.'unsafe-eval'allows the use ofeval()and similar functions. It's best to refactor any code that relies on these.
Even for a local development configuration, it's a security best practice to have a strict CSP. This helps catch potential issues before they reach production.
Manual testing
and showing a spinner