-
Notifications
You must be signed in to change notification settings - Fork 92
fix: respect disabled state for resources #14049
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: respect disabled state for resources #14049
Conversation
Summary of ChangesHello @vikrantgravitee, 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 resolves a critical security oversight where disabling an OAuth2 resource did not prevent it from validating tokens, allowing unauthorized access. The changes ensure that the gateway properly respects the disabled state of OAuth2 resources by filtering them out during initialization. This prevents disabled resources from being loaded and used for token validation, thereby enforcing security policies and returning appropriate 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 aims to fix an issue where disabled OAuth2 resources were still being used. The change correctly filters out disabled resources during initialization. However, the filter is applied to all resource types, which could be a breaking change for non-OAuth2 resources that previously relied on being loaded even when disabled. I've left a comment suggesting to scope the filter to only OAuth2 resources to avoid unintended side effects. Additionally, I've pointed out a misleading test name in the new test case for better maintainability.
...ateway-resource/src/main/java/io/gravitee/gateway/resource/internal/ResourceManagerImpl.java
Show resolved
Hide resolved
...ay-resource/src/test/java/io/gravitee/gateway/resource/internal/ResourceManagerImplTest.java
Outdated
Show resolved
Hide resolved
9845ba9 to
9a70673
Compare
9a70673 to
d161060
Compare
d161060 to
194778f
Compare
Issue
https://gravitee.atlassian.net/browse/APIM-11119
Description
Disabled OAuth2 resources now properly block token validation. Previously, disabling a OAuth2 resource had no effect, allowing OAuth2 plans to continue validating tokens and granting access.
Changes:
Before: Disabling OAuth2 resource → tokens still validated → 200 OK
After: Disabling OAuth2 resource → token validation blocked → 401 Unauthorized
Additional context