public final class UnrestrictedMethodAuthorizer extends Object implements MethodInvocationAuthorizer
MethodInvocationAuthorizer
that allows any method execution
as long as the target object does not belong to a Geode package, or does belong but it's marked
as safe (see RestrictedMethodAuthorizer.isAllowedGeodeMethod(Method, Object)
).
Some known dangerous methods, like Object.getClass()
, are also rejected by this
authorizer implementation, no matter whether the target object belongs to Geode or not
(see RestrictedMethodAuthorizer.isPermanentlyForbiddenMethod(Method, Object)
).
This authorizer implementation addresses only three of the four known security risks:
Java Reflection
, Cache Modification
and Region Modification
.
The Region Entry Modification
security risk still exists: users with the
DATA:READ:RegionName
privilege will be able to execute ANY method (even mutators) on the
objects stored within the region and on instances used as bind parameters of the OQL, so this
authorizer implementation must be used with extreme care.
Usage of this authorizer implementation is only recommended for secured clusters on which only trusted users and applications have access to the OQL engine. It might also be used on clusters on which the entries stored are immutable.
Constructor and Description |
---|
UnrestrictedMethodAuthorizer(Cache cache)
Creates a
UnrestrictedMethodAuthorizer object and initializes it so it can be safely
used in a multi-threaded environment. |
UnrestrictedMethodAuthorizer(RestrictedMethodAuthorizer restrictedMethodAuthorizer)
Creates a
UnrestrictedMethodAuthorizer object and initializes it so it can be safely
used in a multi-threaded environment. |
Modifier and Type | Method and Description |
---|---|
boolean |
authorize(Method method,
Object target)
Executes the authorization logic to determine whether the
method is allowed to be
executed on the target object instance. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialize
public UnrestrictedMethodAuthorizer(Cache cache)
UnrestrictedMethodAuthorizer
object and initializes it so it can be safely
used in a multi-threaded environment.
Applications can use this constructor as part of the initialization for custom authorizers
(see Declarable.initialize(Cache, Properties)
), when using a declarative approach.
cache
- the Cache
instance that owns this authorizer, required in order to
configure the default RestrictedMethodAuthorizer
.public UnrestrictedMethodAuthorizer(RestrictedMethodAuthorizer restrictedMethodAuthorizer)
UnrestrictedMethodAuthorizer
object and initializes it so it can be safely
used in a multi-threaded environment.
restrictedMethodAuthorizer
- the default RestrictedMethodAuthorizer
to use.public boolean authorize(Method method, Object target)
method
is allowed to be
executed on the target
object instance.
If the target
object is an instance of Region
, this methods also ensures that
the user has the DATA:READ
permission granted for the target Region
.
authorize
in interface MethodInvocationAuthorizer
method
- the Method
that should be authorized.target
- the Object
on which the Method
will be executed.true
if the method
can be executed on on the target
instance,
false
otherwise.MethodInvocationAuthorizer