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

Fix code scanning alert - Failure to use secure cookies #176

Closed

Conversation

samuelhwilliams
Copy link
Contributor

@samuelhwilliams samuelhwilliams commented Oct 21, 2024

Fixes #174

Fix the code scanning alert for failure to use secure cookies.

  • Set the secure attribute to True in the set_language_cookie method in fsd_utils/locale_selector/set_lang.py.
  • Set the samesite attribute to Lax in the set_language_cookie method in fsd_utils/locale_selector/set_lang.py.
  • Set the httponly attribute to True in the set_language_cookie method in fsd_utils/locale_selector/set_lang.py.
  • Add tests in tests/test_set_lang.py to check if the secure, samesite, and httponly attributes are set correctly in the set_language_cookie and select_language methods.

For more details, open the Copilot Workspace session.

samuelhwilliams and others added 2 commits October 21, 2024 09:24
Fixes communitiesuk#174

Fix the code scanning alert for failure to use secure cookies.

* Set the `secure` attribute to `True` in the `set_language_cookie` method in `fsd_utils/locale_selector/set_lang.py`.
* Set the `samesite` attribute to `Lax` in the `set_language_cookie` method in `fsd_utils/locale_selector/set_lang.py`.
* Set the `httponly` attribute to `True` in the `set_language_cookie` method in `fsd_utils/locale_selector/set_lang.py`.
* Add tests in `tests/test_set_lang.py` to check if the `secure`, `samesite`, and `httponly` attributes are set correctly in the `set_language_cookie` and `select_language` methods.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/communitiesuk/funding-service-design-utils/issues/174?shareId=XXXX-XXXX-XXXX-XXXX).
@samuelhwilliams samuelhwilliams deleted the fix-secure-cookies-1 branch October 21, 2024 08:26
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

Successfully merging this pull request may close these issues.

Fix code scanning alert - Failure to use secure cookies
1 participant