Understanding ORDS Pre-Hook Functions
In Oracle REST Data Services (ORDS), pre-hook functions are utilised to perform preliminary checks before a REST API service processes a request. These checks may include user verification, enforcement of business rules, or restriction of access.
Overview of Operation:
When a client submits a request to the REST API, ORDS first verifies authorisation based on predefined roles and privileges. If authorisation is granted, ORDS invokes the designated pre-hook function. The pre-hook logic determines whether the request proceeds (by returning true) or is blocked (by returning false, resulting in a 403 Forbidden response). Should authorisation fail initially, ORDS will immediately return a 401 Unauthorized status, bypassing the pre-hook entirely.