-
Notifications
You must be signed in to change notification settings - Fork 678
Fix issue when registering a KM for 'Other' KM type #13554
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
base: master
Are you sure you want to change the base?
Conversation
...imgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java
Show resolved
Hide resolved
...imgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java
Show resolved
Hide resolved
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.
AI Agent Log Improvement Checklist
- The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
- Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.
✅ Before merging this pull request:
- Review all AI-generated comments for accuracy and relevance.
- Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
| Comment | Accepted (Y/N) | Reason |
|---|---|---|
| #### Log Improvement Suggestion No: 1 | N | |
| #### Log Improvement Suggestion No: 2 | N |
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds null/empty guards and two recursive helper methods in APIAdminImpl to safely apply masking to nested key manager and gateway configuration fields during maskValues processing. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (23)📓 Common learnings📚 Learning: 2025-08-14T05:36:06.216ZApplied to files:
📚 Learning: 2025-08-26T05:35:40.184ZApplied to files:
📚 Learning: 2025-09-26T04:38:12.018ZApplied to files:
📚 Learning: 2025-10-13T09:56:46.003ZApplied to files:
📚 Learning: 2025-08-14T07:22:15.846ZApplied to files:
📚 Learning: 2025-08-11T06:25:44.255ZApplied to files:
📚 Learning: 2025-09-11T15:07:24.831ZApplied to files:
📚 Learning: 2025-07-30T13:59:48.856ZApplied to files:
📚 Learning: 2025-11-14T11:27:25.922ZApplied to files:
📚 Learning: 2025-10-10T05:10:50.118ZApplied to files:
📚 Learning: 2025-09-25T09:28:42.598ZApplied to files:
📚 Learning: 2025-06-18T10:07:57.821ZApplied to files:
📚 Learning: 2025-09-04T06:19:19.370ZApplied to files:
📚 Learning: 2025-08-08T18:04:07.174ZApplied to files:
📚 Learning: 2025-09-09T05:00:15.216ZApplied to files:
📚 Learning: 2025-09-09T06:18:41.445ZApplied to files:
📚 Learning: 2025-09-10T11:22:38.891ZApplied to files:
📚 Learning: 2025-09-17T08:56:08.224ZApplied to files:
📚 Learning: 2025-09-10T08:43:34.290ZApplied to files:
📚 Learning: 2025-08-08T06:17:39.942ZApplied to files:
📚 Learning: 2025-08-22T10:58:02.268ZApplied to files:
📚 Learning: 2025-08-27T11:55:56.357ZApplied to files:
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Pull request overview
This PR fixes a NullPointerException that occurs when registering a Key Manager (KM) of type 'Other' with only 'Token Exchange' option selected. The issue arose because the getKeyManagerConnectorConfiguration() method returns null for 'Other' type KMs, causing the maskValues() method to fail when attempting to access connection and authentication configurations.
Changes:
- Added a null check in the
maskValues(KeyManagerConfigurationDTO)method to guard against nullKeyManagerConnectorConfigurationobjects - Updated comment explaining when the configuration can be null (Token Exchange use case)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR fixes below issue.
The error occured because there is no keyManagerConfigurationDTO for 'Other' type. As the fix added a null check.