10 ORDS PRE-HOOK
Oracle REST Data Services (ORDS) provides the ability to use PL/SQL based pre-hook functions that are invoked prior to an ORDS based REST call. These functions can be used for a variety of purposes including auditing, custom authentication and authorization, and metrics gathering.
Each provided RDS workspace comes pre-configured with a simple
pre-hook function named ORDS_PREHOOK
, and it has
a default implementation that simply returns true
. As such, it has no effect on the REST calls made into custom applications.
It is provided as a starting point for extension to teams that required
additional processing on each REST call. For those teams, replacing
the implementation of the ORDS_PREHOOK
function will
enable the additional capabilities they require. For more information
on pre-hook functions, please refer to Oracle REST Data Services Installation, Configuration,
and Development Guide: Overview of Pre-hook Functions.
Note that, a pre-hook function is invoked for every REST service call. Therefore, the pre-hook function must be designed to be efficient. If a pre-hook function is inefficient, then it has a negative effect on the performance of the REST service call. Invoking the pre-hook involves at least one additional database round trip. It is critical that the ORDS instance and the database are located close together so that the round-trip latency overhead is minimized.
Be aware that some extensions, such as those provided by the Oracle Retail Cloud Value team, use ORDS PRE_HOOK to enhance security. Incomplete configuration of these extensions as well as failure to communicate their presence to the broader customer implementation team can result in unexpected authentication failures.