-
Notifications
You must be signed in to change notification settings - Fork 24
[FIX] Fix and improve API Log #882
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
Conversation
Summary of ChangesHello @reichie020212, 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 significantly enhances the API logging functionality by addressing critical issues related to data visibility and integrity. It enables the proper display of API log details through a new form view, ensures accurate recording of diverse request data formats, and establishes a clear association between logs and their originating namespaces. Furthermore, it adds a layer of security and detail by logging request headers with sensitive information automatically redacted. 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 introduces several valuable improvements to the API logging functionality, including associating logs with a namespace, adding sanitized header logging, and correcting the way request data is captured. The fix to enable the form view for API logs is also a good usability improvement.
My review has identified a couple of high-severity issues. One is a security concern where sensitive headers might not be redacted due to a case-sensitive comparison. The other is a potential bug in how namespaces are looked up, which could lead to errors if multiple API versions share the same name. I've provided specific suggestions to address these points.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 17.0 #882 +/- ##
==========================================
- Coverage 81.33% 81.30% -0.04%
==========================================
Files 821 821
Lines 25105 25120 +15
Branches 2928 2931 +3
==========================================
+ Hits 20420 20424 +4
- Misses 3948 3961 +13
+ Partials 737 735 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Red <redickbutay02@gmail.com>
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Signed-off-by: Red <redickbutay02@gmail.com>
|



Why is this change needed?
Encountered several problems regaring logging of API
How was the change implemented?
formin theview_modeofspp_api_log_list_actionto be able to view the form viewNew unit tests
None
Unit tests executed by the author
None
How to test manually
Related links
After the fix screenshots

Note
Medium Risk
Logging now persists request bodies and headers (even though sensitive keys are redacted), which increases exposure risk if other secrets appear in payloads/headers and may impact storage volume/performance.
Overview
Fixes and enriches OpenAPI request/response logging. Request logs now link to the resolved
spp_api.namespace(optionally matchingversion), store the raw query string, capture request bodies more accurately (parsed JSON when possible, else decoded raw bytes), and persist sanitized HTTP headers with sensitive values redacted.Updates the
spp_api.logmodel/UI to support this data by adding aheadersfield, exposingheadersandrequest_parameteron the log form, and enablingtree,formview mode so logs can be opened from the list view.Written by Cursor Bugbot for commit d604986. This will update automatically on new commits. Configure here.