feat(spp_dci_client): mask OAuth2 client secret in UI#27
feat(spp_dci_client): mask OAuth2 client secret in UI#27gonzalesedwin1123 merged 2 commits into19.0from
Conversation
Add a computed display field that masks the stored secret with asterisks and only writes through when a new value is provided. Prevents accidental secret exposure when viewing the data source form. Includes formatting fixes from prettier.
Summary of ChangesHello @gonzalesedwin1123, 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 enhances the security of OAuth2 client secret handling by introducing a UI-specific field that masks the secret value. This change ensures that sensitive credentials are not inadvertently exposed to users viewing data source configurations, while still allowing for secure updates. The implementation includes robust logic for computing and inversely writing the secret, backed by new tests to guarantee its reliability. Highlights
Changelog
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.
Code Review
This pull request introduces a security enhancement by masking the OAuth2 client secret in the data source form. The implementation uses a computed field with an inverse method, which is a solid approach in Odoo. The changes are well-tested, covering various scenarios like updating, clearing, and preserving the secret. The addition of copy=False to the secret field is also a good security practice. I've found a few minor improvement opportunities in the tests to increase maintainability by using the defined constant for the secret mask instead of a hardcoded string.
…rdcoded value The secret display tests hardcoded "********" in three places. If the mask value changes in the model, the tests would silently break. Now references cls.SECRET_MASK set from DCIDataSource._SECRET_MASK.
Add a computed display field that masks the stored secret with asterisks and only writes through when a new value is provided. Prevents accidental secret exposure when viewing the data source form. Includes formatting fixes from prettier.