Conversation
There was a problem hiding this comment.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Fix Detected |
|---|---|---|
| Weak Authentication Error Detection ▹ view |
Files scanned
| File Path | Reviewed |
|---|---|
| superset/db_engine_specs/trino.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-reviewon this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-reviewcommand in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-descriptioncommand in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolvecommand in any comment on your PR.- Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ❌ Issue Categories
Category Enabled Naming ✅ Database Operations ✅ Documentation ✅ Logging ✅ Error Handling ✅ Systems and Environment ✅ Objects and Data Structures ✅ Readability and Maintainability ✅ Asynchronous Processing ✅ Design Patterns ✅ Third-Party Libraries ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
Note
Korbit Pro is free for open source projects 🎉
Looking to add Korbit to your team? Get started with a free 2 week trial here
| return isinstance( | ||
| instance, HttpError | ||
| ) and "error 401: b'Invalid credentials'" in str(instance) | ||
| return isinstance(instance, HttpError) and "error 401" in str(instance) |
There was a problem hiding this comment.
Weak Authentication Error Detection 
Tell me more
What is the issue?
The authentication error check is overly permissive by only checking for 'error 401' in the error message.
Why this matters
This loose string matching could lead to false positives in authentication error detection, potentially causing security misclassifications that affect the authentication flow.
Suggested change ∙ Feature Preview
return isinstance(instance, HttpError) and "error 401: b'Invalid credentials'" in str(instance)💡 Does this comment miss the mark? Tell us why and Korbit will adapt to your team’s feedback.
💬 Chat with Korbit by mentioning @korbit-ai.
There was a problem hiding this comment.
It is overly specific & restrictive. Check for 401 is enough i guess.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #31993 +/- ##
===========================================
+ Coverage 60.48% 83.35% +22.86%
===========================================
Files 1931 544 -1387
Lines 76236 38983 -37253
Branches 8568 0 -8568
===========================================
- Hits 46114 32494 -13620
+ Misses 28017 6489 -21528
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@betodealmeida @nytai, hello! what do you think about the change? i don't really think we need to check anything except for the status code to make it work correctly. i can do some changes if needed, lets discuss it. |
betodealmeida
left a comment
There was a problem hiding this comment.
This looks good, and it makes sense to be more lenient. Thanks for the PR!
(cherry picked from commit 7ce1a34)
(cherry picked from commit 7ce1a34)
fix(trino): compare only error code for oauth2 auth
SUMMARY
I guess this message "invalid credentials" is specific for google oauth2 server (or the one that was used to develop the feature), there is a (link) I found that makes me think so. With the change applied it started to work good with identity server 4, and I guess this comparison makes it impossible for people to use oauth2 right now, for example here.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
This is how it looks with the change applied.

TESTING INSTRUCTIONS
There is an example of how I configured oauth2 for trino.
P.S.: I didn't copy other configuration except for the part need to make oauth work.
ADDITIONAL INFORMATION