Class Introspectable
- All Implemented Interfaces:
RestConverter
ObjectIntrospector support on response objects returned by a
When enabled, public methods can be called on objects returned through the RestResponse.setContent(Object)
method.
Note that opening up public methods for calling through a REST interface can be dangerous, and should be done with caution.
Security - deny-by-default: As of Juneau 10.0, ObjectIntrospector is secure-by-default and
denies reflective method dispatch unless the caller has explicitly allow-listed the target method(s). This
converter is off by default as shipped — with no IntrospectableSettings bean registered,
every MethodNotAllowlistedException wrapped
in InternalServerError). A resource opts specific methods in explicitly by registering an
IntrospectableSettings bean in its bean store:
For a trusted resource that needs the pre-10.0 behavior of dispatching to any public, non-deprecated method,
call allowAll() instead — but never do this on a
resource whose response objects expose methods you wouldn't want an arbitrary caller to invoke, since the
method name and arguments always come from untrusted request query parameters. See
IntrospectableSettings for the full builder API.
Java methods are invoked by passing in the following URL parameters:
-
&invokeMethod - The Java method name, optionally with arguments if necessary to differentiate between methods. -
&invokeArgs - The arguments as an array.
See Also:
ObjectIntrospector- Additional information on introspection of POJO methods.IntrospectableSettings- Per-resource allow-list configuration for this converter.RestOp.converters()- Registering converters with REST resources.- Converters
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert(RestRequest req, Object o) Performs post-call conversion on the specified response object.
-
Field Details
-
SWAGGER_PARAMS
Swagger parameters for this converter.- See Also:
-
-
Constructor Details
-
Introspectable
public Introspectable()
-
-
Method Details
-
convert
Description copied from interface:RestConverterPerforms post-call conversion on the specified response object.- Specified by:
convertin interfaceRestConverter- Parameters:
req- The servlet request.o- The response object set by the REST method through theRestResponse.setContent(Object)method.- Returns:
- The converted object.
- Throws:
InternalServerError
-