-
Notifications
You must be signed in to change notification settings - Fork 82
Forbidden fields are now ignored #240
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
Kudos, SonarCloud Quality Gate passed! |
|
||
private String getProblem(MBeanSelector selector) { | ||
if (selector.isRequestForPrivilegedProperty()) | ||
return "You seem to have encountered a bug in the WebLogic REST API.\n" + |
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.
Can this text come from a resource bundle?
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.
Actually, nevermind. This is for an internal error. If it's easy then do it, but it's not critical.
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.
It could; actually, it could probably be removed, since I know have altered the code to exclude it.
@@ -24,6 +24,10 @@ | |||
* @author Russell Gold | |||
*/ | |||
public class ExporterConfig implements MetricsProcessor { | |||
// Due to a bug in the WLS REST API, a query that includes this field will fail if not run with admin privileges. | |||
// The code thus ensures that it is excluded from all queries. | |||
private static final String[] FORBIDDEN_FIELDS = {"JDBCServiceRuntime:JDBCDataSourceRuntimeMBeans:properties"}; |
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.
Just curious... Is this the only affected field or just the only one that we know about?
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.
It's the only one we've found so far. But I have written the exclusion code to make it easy to add others if we find them.
Customer (Jose Luis Molina Dueñas) reported problems:
Requesting metrics from
fails because the mbean contains a field,
properties
, which requires admin access.Under some conditions, if a higher-level bean is filtered but no matching keys exist on one server, the request was asking for all beans.
This change attempts to fix both by cleaning up the filtering when there is no match, and by detecting an attempt to request a forbidden field and either removing it from the query if specified, or adding an
excludeFields
element if the containing bean is specified without values.