public class RBACDecorator extends Object implements RBACDecoratorMBean
An MBean that may be used by hawtio:type=security,name=RBACRegistry
to decorate optimized
jolokia list
operation with RBAC info.
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
RBACDecorator(org.osgi.framework.BundleContext bundleContext) |
Modifier and Type | Method and Description |
---|---|
void |
decorate(Map<String,Object> result)
If we have access to
ConfigurationAdmin , we can add RBAC information |
static List<String> |
iterateDownPids(List<String> segments)
see:
org.apache.karaf.management.KarafMBeanServerGuard#iterateDownPids(java.util.List)
Given a list of segments, return a list of PIDs that are searched in this order. |
static boolean |
mayShareRBACInfo(List<String> realJmxAclPids,
ObjectName o1,
ObjectName o2)
Checks if two
ObjectName s may share RBAC info - if the same configadmin PIDs are examined by Karaf |
static List<String> |
nameSegments(ObjectName objectName)
see:
org.apache.karaf.management.KarafMBeanServerGuard#getNameSegments(javax.management.ObjectName)
Assuming full ObjectName (not null, not containing wildcards and other funny stuff),
split objectName to elements used then co contruct ordered list of PIDs to check for MBean permissions. |
static String |
pidListKey(List<String> allJmxAclPids,
ObjectName n)
Converts
ObjectName to a key that helps verifying whether different MBeans can produce same RBAC info |
public RBACDecorator(org.osgi.framework.BundleContext bundleContext)
public void decorate(Map<String,Object> result) throws Exception
ConfigurationAdmin
, we can add RBAC informationdecorate
in interface RBACDecoratorMBean
result
- Exception
public static String pidListKey(List<String> allJmxAclPids, ObjectName n) throws NoSuchAlgorithmException, UnsupportedEncodingException
ObjectName
to a key that helps verifying whether different MBeans can produce same RBAC infoallJmxAclPids
- n
- NoSuchAlgorithmException
UnsupportedEncodingException
public static List<String> nameSegments(ObjectName objectName)
org.apache.karaf.management.KarafMBeanServerGuard#getNameSegments(javax.management.ObjectName)
Assuming full ObjectName
(not null, not containing wildcards and other funny stuff),
split objectName to elements used then co contruct ordered list of PIDs to check for MBean permissions.public static List<String> iterateDownPids(List<String> segments)
org.apache.karaf.management.KarafMBeanServerGuard#iterateDownPids(java.util.List)
Given a list of segments, return a list of PIDs that are searched in this order.
For example, given the following segments: org.foo, bar, test
the following list of PIDs will be generated (in this order):
jmx.acl.org.foo.bar.test
jmx.acl.org.foo.bar
jmx.acl.org.foo
jmx.acl
The order is used as a search order, in which the most specific PID is searched first.
Assume that none of the segments contain special/wildcard values.segments
- the ObjectName segments.public static boolean mayShareRBACInfo(List<String> realJmxAclPids, ObjectName o1, ObjectName o2)
ObjectName
s may share RBAC info - if the same configadmin PIDs are examined by KarafrealJmxAclPids
- o1
- o2
- Copyright © 2017 JBoss by Red Hat. All rights reserved.